nav-arm-templates/getnavworkshopvms.json

796 строки
37 KiB
JSON

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"vmName": {
"type": "string",
"defaultValue": "",
"minLength": 3,
"metadata": {
"Description": "Select the name of the deployment"
}
},
"TimezoneId": {
"type": "string",
"defaultValue": "GMT Standard Time",
"allowedValues": [ "Dateline Standard Time","UTC-11","Aleutian Standard Time","Hawaiian Standard Time","Marquesas Standard Time","Alaskan Standard Time","UTC-09","Pacific Standard Time (Mexico)","UTC-08","Pacific Standard Time","US Mountain Standard Time","Mountain Standard Time (Mexico)","Mountain Standard Time","Central America Standard Time","Central Standard Time","Easter Island Standard Time","Central Standard Time (Mexico)","Canada Central Standard Time","SA Pacific Standard Time","Eastern Standard Time (Mexico)","Eastern Standard Time","Haiti Standard Time","Cuba Standard Time","US Eastern Standard Time","Turks And Caicos Standard Time","Paraguay Standard Time","Atlantic Standard Time","Venezuela Standard Time","Central Brazilian Standard Time","SA Western Standard Time","Pacific SA Standard Time","Newfoundland Standard Time","Tocantins Standard Time","E. South America Standard Time","SA Eastern Standard Time","Argentina Standard Time","Greenland Standard Time","Montevideo Standard Time","Magallanes Standard Time","Saint Pierre Standard Time","Bahia Standard Time","UTC-02","Mid-Atlantic Standard Time","Azores Standard Time","Cape Verde Standard Time","UTC","Morocco Standard Time","GMT Standard Time","Greenwich Standard Time","W. Europe Standard Time","Central Europe Standard Time","Romance Standard Time","Central European Standard Time","W. Central Africa Standard Time","Jordan Standard Time","GTB Standard Time","Middle East Standard Time","Egypt Standard Time","E. Europe Standard Time","Syria Standard Time","West Bank Standard Time","South Africa Standard Time","FLE Standard Time","Israel Standard Time","Kaliningrad Standard Time","Sudan Standard Time","Libya Standard Time","Namibia Standard Time","Arabic Standard Time","Turkey Standard Time","Arab Standard Time","Belarus Standard Time","Russian Standard Time","E. Africa Standard Time","Iran Standard Time","Arabian Standard Time","Astrakhan Standard Time","Azerbaijan Standard Time","Russia Time Zone 3","Mauritius Standard Time","Saratov Standard Time","Georgian Standard Time","Caucasus Standard Time","Afghanistan Standard Time","West Asia Standard Time","Ekaterinburg Standard Time","Pakistan Standard Time","India Standard Time","Sri Lanka Standard Time","Nepal Standard Time","Central Asia Standard Time","Bangladesh Standard Time","Omsk Standard Time","Myanmar Standard Time","SE Asia Standard Time","Altai Standard Time","W. Mongolia Standard Time","North Asia Standard Time","N. Central Asia Standard Time","Tomsk Standard Time","China Standard Time","North Asia East Standard Time","Singapore Standard Time","W. Australia Standard Time","Taipei Standard Time","Ulaanbaatar Standard Time","North Korea Standard Time","Aus Central W. Standard Time","Transbaikal Standard Time","Tokyo Standard Time","Korea Standard Time","Yakutsk Standard Time","Cen. Australia Standard Time","AUS Central Standard Time","E. Australia Standard Time","AUS Eastern Standard Time","West Pacific Standard Time","Tasmania Standard Time","Vladivostok Standard Time","Lord Howe Standard Time","Bougainville Standard Time","Russia Time Zone 10","Magadan Standard Time","Norfolk Standard Time","Sakhalin Standard Time","Central Pacific Standard Time","Russia Time Zone 11","New Zealand Standard Time","UTC+12","Fiji Standard Time","Kamchatka Standard Time","Chatham Islands Standard Time","UTC+13","Tonga Standard Time","Samoa Standard Time","Line Islands Standard Time" ],
"metadata": {
"Description": "Timezone of VM."
}
},
"AcceptEula": {
"type": "string",
"defaultValue": "No",
"allowedValues": [ "Yes", "No" ],
"minLength": 3,
"metadata": {
"Description": "In order to deploy the VM, you need to accept the EULA, which can be found here: https://go.microsoft.com/fwlink/?linkid=861843"
}
},
"RemoteDesktopAccess": {
"type": "string",
"defaultValue": "",
"minLength": 1,
"metadata": {
"Description": "Specify * (star) to allow all remote desktop access, specify - (minus) to deny all remote desktop access or provide an address range using CIDR notation, e.g. 10.0.0.0/24; an IP address; or a list of address ranges or IP addresses"
}
},
"WinRMAccess": {
"type": "string",
"defaultValue": "-",
"minLength": 1,
"metadata": {
"Description": "Specify * (star) to allow all WinRM access, specify - (minus) to deny all WinRM access or provide an address range using CIDR notation, e.g. 10.0.0.0/24; an IP address; or a list of address ranges or IP addresses"
}
},
"OperatingSystem": {
"type": "string",
"defaultValue": "Windows Server 2019",
"allowedValues": [
"Windows 11",
"Windows Server 2019",
"Windows Server 2019 with Containers",
"Windows Server 2022"
],
"metadata": {
"Description": "Select the Operating System of the VM"
}
},
"vmSize": {
"type": "string",
"defaultValue": "Standard_D4s_v3",
"allowedValues": [
"Standard_D2_v2",
"Standard_D3_v2",
"Standard_D4_v2",
"Standard_D5_v2",
"Standard_D2_v3",
"Standard_D4_v3",
"Standard_D8_v3",
"Standard_D16_v3",
"Standard_D32_v3",
"Standard_D48_v3",
"Standard_D64_v3",
"Standard_D2s_v3",
"Standard_D4s_v3",
"Standard_D8s_v3",
"Standard_D16s_v3",
"Standard_D32s_v3",
"Standard_D48s_v3",
"Standard_D64s_v3",
"Standard_D2_v4",
"Standard_D4_v4",
"Standard_D8_v4",
"Standard_D16_v4",
"Standard_D32_v4",
"Standard_D48_v4",
"Standard_D64_v4",
"Standard_D2s_v4",
"Standard_D4s_v4",
"Standard_D8s_v4",
"Standard_D16s_v4",
"Standard_D32s_v4",
"Standard_D48s_v4",
"Standard_D64s_v4",
"Standard_D2a_v4",
"Standard_D4a_v4",
"Standard_D8a_v4",
"Standard_D16a_v4",
"Standard_D32a_v4",
"Standard_D48a_v4",
"Standard_D64a_v4",
"Standard_D2as_v4",
"Standard_D4as_v4",
"Standard_D8as_v4",
"Standard_D16as_v4",
"Standard_D32as_v4",
"Standard_D48as_v4",
"Standard_D64as_v4",
"Standard_D2_v5",
"Standard_D4_v5",
"Standard_D8_v5",
"Standard_D16_v5",
"Standard_D32_v5",
"Standard_D48_v5",
"Standard_D64_v5",
"Standard_D2s_v5",
"Standard_D4s_v5",
"Standard_D8s_v5",
"Standard_D16s_v5",
"Standard_D32s_v5",
"Standard_D48s_v5",
"Standard_D64s_v5",
"Standard_D2a_v5",
"Standard_D4a_v5",
"Standard_D8a_v5",
"Standard_D16a_v5",
"Standard_D32a_v5",
"Standard_D48a_v5",
"Standard_D64a_v5",
"Standard_D2as_v5",
"Standard_D4as_v5",
"Standard_D8as_v5",
"Standard_D16as_v5",
"Standard_D32as_v5",
"Standard_D48as_v5",
"Standard_D64as_v5"
],
"metadata": {
"Description": "Select the VM size of the deployment"
}
},
"Isolation": {
"type": "string",
"defaultValue": "Default",
"allowedValues": [ "Default", "Process", "Hyperv" ],
"metadata": {
"Description": "What isolation do you want to use for the main container. Default will allow BcContainerHelper to decide."
}
},
"StorageAccountType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Premium_LRS"
],
"metadata": {
"Description": "Select the preferred storage account type. Standard_LRS is HDD, Premium_LRS is SSD. Premium is not available for all VM sizes, please refer to Azure documentation."
}
},
"vmAdminUsername": {
"type": "string",
"defaultValue": "student",
"minLength": 1,
"metadata": {
"Description": "Specify administrator user name for connecting to the VM"
}
},
"navAdminUsername": {
"type": "string",
"defaultValue": "student",
"minLength": 1,
"metadata": {
"Description": "Specify administrator user name for NAV"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"Description": "Specify administrator password for VM, NAV and SQL (if applicable)"
}
},
"AssignPremiumPlan": {
"type": "string",
"defaultValue": "Yes",
"allowedValues": [ "Yes", "No" ],
"metadata": {
"Description": "Assign Premium Plan to admin user"
}
},
"CreateTestUsers": {
"type": "string",
"defaultValue": "Yes",
"allowedValues": [ "Yes", "No" ],
"metadata": {
"Description": "Create a set of users for test purposes (ExternalAccountant, Premium, Essential, InternalAdmin, TeamMember and DelegatedAdmin)."
}
},
"EnableSymbolLoading": {
"type": "string",
"defaultValue": "Yes",
"allowedValues": [ "Yes", "No" ],
"metadata": {
"Description": "EnableSymbolLoading to support hybrid development"
}
},
"IncludeCSIDE": {
"type": "string",
"defaultValue": "Yes",
"allowedValues": [ "Yes", "No" ],
"metadata": {
"Description": "Include CSIDE for C/AL development"
}
},
"ClickOnce": {
"type": "string",
"defaultValue": "No",
"allowedValues": [ "Yes", "No" ],
"metadata": {
"Description": "Include ClickOnce deployed Windows Client"
}
},
"IncludeAL": {
"type": "string",
"defaultValue": "Yes",
"allowedValues": [ "Yes", "No" ],
"metadata": {
"Description": "Prepare Container for System App and BaseApp AL development"
}
},
"ArtifactUrl": {
"type": "string",
"defaultValue": "bcartifacts/sandbox//us/latest",
"metadata": {
"Description": "Specify the Business Central Artifact URL or a /-separated string with parameters for Get-BcArtifactUrl: storageaccount/type/version/country/select/sasToken. This value is ignored if a Docker Image is specified."
}
},
"navDockerImage": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Select the Business Central Docker Image to deploy. ArtifactUrl is ignored if you specify a Docker Image."
}
},
"registryUsername": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Specify username for private Docker Registry (leave blank for public Docker hub == microsoft/dynamics-nav:tag)"
}
},
"registryPassword": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"Description": "Specify password for private Docker Registry (leave blank for public Docker hub == microsoft/dynamics-nav:tag)"
}
},
"count": {
"type": "int",
"defaultValue": 2,
"metadata": {
"Description": "Select the number of Workshop VMs you want to create ()"
}
},
"offset": {
"type": "int",
"defaultValue": 1,
"metadata": {
"Description": "Select the offset of the VM numbering"
}
},
"LicenseFileUri": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Optional: Specify a secure Url of your NAV Partner License File for the developer preview. If you do not specify a license file Url here, you will have to upload the license manually later."
}
},
"FobFileUrl": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Optional: Specify a Url to a .fob file, which will be imported to the container."
}
},
"WorkshopFilesUrl": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Optional: Specify a Url to a .zip file containing the content of C:/WORKSHOPFILES on the VM."
}
},
"BeforeContainerSetupScriptUrl": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Optional: Specify a Url to a PowerShell script that should be executed on the VM before the Container is setup."
}
},
"FinalSetupScriptUrl": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Optional: Specify a Url to a PowerShell script that should be executed on the VM to do the final setup of the VM."
}
},
"RequestToken": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Request Token for http request service allowing predefined commands to be invoked through a simple http request"
}
},
"RunWindowsUpdate": {
"type": "string",
"defaultValue": "Yes",
"allowedValues": [ "Yes", "No" ],
"metadata": {
"Description": "Run Windows Update after Deployment (might take significant time)"
}
},
"CertificatePfxUrl": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Optional: Specify a secure Url of your Certificate Pfx File. If you do not specify a certificate, you will get a Self Signed Certificate."
}
},
"CertificatePfxPassword": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"Description": "Optional: Specify the password of the Certificate Pfx File specified in CertificatePfxUrl."
}
},
"PublicDnsName": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Public DNS Name (CNAME record pointing to your VM). A # in the name will be replaced by the VM number. If you do not specify a public DNS name, you will get a Self Signed Certificate."
}
},
"ContactEMailForLetsEncrypt": {
"type": "string",
"defaultValue": "",
"metadata": {
"Description": "Specify an email address of the person accepting subscriber agreement for LetsEncrypt (https://letsencrypt.org/repository/) in order to use Lets Encrypt to generate a secure SSL certificate, which is valid for 3 months."
}
}
},
"variables": {
"nchbranch": "",
"passwords": "[split(parameters('adminPassword'),',')]",
"noOfPasswords": "[length(variables('passwords'))]",
"RemoteDesktopAccess": "[parameters('RemoteDesktopAccess')]",
"WinRmAccess": "[parameters('WinRmAccess')]",
"Isolation": "[parameters('Isolation')]",
"OperatingSystem": "[parameters('OperatingSystem')]",
"imagePublisher": "[if(equals(variables('OperatingSystem'),'Windows 11'),'MicrosoftWindowsDesktop','MicrosoftWindowsServer')]",
"imageOffer": "[if(equals(variables('OperatingSystem'),'Windows 11'),'Windows-11','WindowsServer')]",
"imageSku": "[if(equals(variables('OperatingSystem'),'Windows 11'),'win11-21h2-pro',if(equals(variables('OperatingSystem'),'Windows Server 2022'),'2022-Datacenter',if(equals(variables('OperatingSystem'),'Windows Server 2019'),'2019-Datacenter','2019-Datacenter-with-containers')))]",
"storageAccountType": "[parameters('StorageAccountType')]",
"storageAccountName": "[concat('storage', uniqueString(resourceGroup().id))]",
"networkSecurityGroupName": "networksecuritygroup",
"addressPrefix": "10.0.0.0/8",
"subnetName": "Subnet",
"subnetPrefix": "10.0.0.0/16",
"virtualNetworkName": "virtualnetwork",
"delimiters": [ ",", ";" ],
"rdpAddresses": "[if(equals(variables('RemoteDesktopAccess'),'-'),'',variables('RemoteDesktopAccess'))]",
"rdpSourceAddressPrefix": "[split(variables('rdpAddresses'),variables('delimiters'))]",
"noOfRdpAddresses": "[length(variables('rdpSourceAddressPrefix'))]",
"winRmAddresses": "[if(equals(variables('WinRmAccess'),'-'),'',variables('WinRmAccess'))]",
"winRmSourceAddressPrefix": "[split(variables('winRmAddresses'),variables('delimiters'))]",
"noOfWinRmAddresses": "[length(variables('winRmSourceAddressPrefix'))]",
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
"ScriptCommandToExecute": "powershell.exe -executionpolicy unrestricted -file "
},
"resources": [
{
"apiVersion": "2019-04-01",
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"sku": {
"name": "[variables('storageAccountType')]"
},
"kind": "StorageV2",
"location": "[resourceGroup().location]",
"properties": {
"supportsHttpsTrafficOnly": true
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/publicIPAddresses",
"name": "[concat(parameters('vmName'), string(add(copyIndex(),parameters('offset'))), '_pip')]",
"location": "[resourceGroup().location]",
"properties": {
"publicIPAllocationMethod": "Dynamic",
"dnsSettings": {
"domainNameLabel": "[concat(tolower(parameters('vmName')), string(add(copyIndex(),parameters('offset'))))]"
}
},
"copy": {
"name": "pipcopy",
"count": "[parameters('count')]"
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/networkSecurityGroups",
"name": "[variables('networkSecurityGroupName')]",
"location": "[resourceGroup().location]",
"properties": {
"securityRules": [
{
"name": "HTTP",
"properties": {
"description": "Http access",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "80",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 200,
"direction": "Inbound"
}
},
{
"name": "FILES",
"properties": {
"description": "File access",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "8080",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 210,
"direction": "Inbound"
}
},
{
"name": "HTTPS",
"properties": {
"description": "Http access over Secure Socket Layer",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "443",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 220,
"direction": "Inbound"
}
},
{
"name": "Client",
"properties": {
"description": "Access for Windows Client",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "7046",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 230,
"direction": "Inbound"
}
},
{
"name": "Soap",
"properties": {
"description": "Access to Soap Web Services",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "7047",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 240,
"direction": "Inbound"
}
},
{
"name": "OData",
"properties": {
"description": "Access to OData Services",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "7048",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 250,
"direction": "Inbound"
}
},
{
"name": "Developer",
"properties": {
"description": "Access to Developer Services",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "7049",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 260,
"direction": "Inbound"
}
}
]
}
},
{
"apiVersion": "2015-01-01",
"type": "Microsoft.Resources/deployments",
"name": "rdp-0",
"condition": "[not(equals(variables('RemoteDesktopAccess'),'-'))]",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/',variables('networkSecurityGroupName'))]"
],
"properties": {
"mode":"Incremental",
"parameters":{},
"template": {
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [],
"outputs": {}
}
}
},
{
"apiVersion": "2015-01-01",
"type": "Microsoft.Resources/deployments",
"name": "[concat('rdp-', copyIndex(1))]",
"condition": "[not(equals(variables('RemoteDesktopAccess'),'-'))]",
"dependsOn": [
"[concat('rdp-', copyIndex())]"
],
"copy": {
"name": "iterator",
"count": "[variables('noOfRdpAddresses')]"
},
"properties": {
"mode": "Incremental",
"template": {
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"apiVersion": "2016-09-01",
"name": "[concat(variables('networkSecurityGroupName'),'/Rdp',copyIndex())]",
"type": "Microsoft.Network/networkSecurityGroups/securityRules",
"location":"[resourceGroup().location]",
"properties":{
"description": "Remote Desktop Access",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "3389",
"sourceAddressPrefix": "[variables('rdpSourceAddressPrefix')[copyIndex()]]",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": "[add(copyIndex(),100)]",
"direction": "Inbound"
}
}
],
"outputs": {}
}
}
},
{
"apiVersion": "2015-01-01",
"type": "Microsoft.Resources/deployments",
"name": "winrm-0",
"condition": "[not(equals(variables('WinRmAccess'),'-'))]",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/',variables('networkSecurityGroupName'))]"
],
"properties": {
"mode":"Incremental",
"parameters":{},
"template": {
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [],
"outputs": {}
}
}
},
{
"apiVersion": "2015-01-01",
"type": "Microsoft.Resources/deployments",
"name": "[concat('winrm-', copyIndex(1))]",
"condition": "[not(equals(variables('WinRmAccess'),'-'))]",
"dependsOn": [
"[concat('winrm-', copyIndex())]"
],
"copy": {
"name": "iterator",
"count": "[variables('noOfWinRmAddresses')]"
},
"properties": {
"mode": "Incremental",
"template": {
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"apiVersion": "2016-09-01",
"name": "[concat(variables('networkSecurityGroupName'),'/WinRm',copyIndex())]",
"type": "Microsoft.Network/networkSecurityGroups/securityRules",
"location":"[resourceGroup().location]",
"properties":{
"description": "WinRm Access",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "5986",
"sourceAddressPrefix": "[variables('winRmSourceAddressPrefix')[copyIndex()]]",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": "[add(copyIndex(),300)]",
"direction": "Inbound"
}
}
],
"outputs": {}
}
}
},
{
"apiVersion": "2015-05-01-preview",
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('virtualNetworkName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/networkSecurityGroups/',variables('networkSecurityGroupName'))]"
],
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('addressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('subnetName')]",
"properties": {
"addressPrefix": "[variables('subnetPrefix')]",
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
}
}
}
]
}
},
{
"apiVersion": "2018-11-01",
"type": "Microsoft.Network/networkInterfaces",
"name": "[concat(parameters('vmName'), string(add(copyIndex(),parameters('offset'))), '_nic')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', parameters('vmName'), string(add(copyIndex(),parameters('offset'))), '_pip')]",
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]",
"[concat('Microsoft.Network/networkSecurityGroups/',variables('networkSecurityGroupName'))]"
],
"properties": {
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
},
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',concat(parameters('vmName'), string(add(copyIndex(),parameters('offset'))), '_pip'))]"
},
"subnet": {
"id": "[variables('subnetRef')]"
}
}
}
]
},
"copy": {
"name": "niccopy",
"count": "[parameters('count')]"
}
},
{
"apiVersion": "2018-10-01",
"type": "Microsoft.Compute/virtualMachines",
"name": "[concat(tolower(parameters('vmName')),string(add(copyIndex(),parameters('offset'))))]",
"location": "[resourceGroup().location]",
"condition": "[equals(parameters('acceptEula'),'Yes')]",
"dependsOn": [
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"[concat('Microsoft.Network/networkInterfaces/', parameters('vmName'),string(add(copyIndex(),parameters('offset'))),'_nic')]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": {
"computerName": "[concat(tolower(parameters('vmName')),string(add(copyIndex(),parameters('offset'))))]",
"adminUsername": "[parameters('vmAdminUsername')]",
"adminPassword": "[variables('passwords')[mod(copyIndex(),variables('noOfPasswords'))]]",
"windowsConfiguration": {
"provisionVmAgent": "true"
}
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('imagePublisher')]",
"offer": "[variables('imageOffer')]",
"sku": "[variables('imageSku')]",
"version": "latest"
},
"osDisk": {
"createOption": "FromImage",
"osType": "Windows",
"name": "[concat(tolower(parameters('vmName')), string(add(copyIndex(),parameters('offset'))), '_osdisk')]",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "[variables('storageAccountType')]"
},
"diskSizeGB": 128
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(parameters('vmName'),string(add(copyIndex(),parameters('offset'))),'_nic'))]"
}
]
}
},
"resources": [
],
"copy": {
"name": "vmcopy",
"count": "[parameters('count')]"
}
},
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(tolower(parameters('vmName')),string(add(copyIndex(),parameters('offset'))),'/extension',string(add(copyIndex(),parameters('offset'))))]",
"location": "[resourceGroup().location]",
"condition": "[equals(parameters('acceptEula'),'Yes')]",
"tags": {
"displayName": "PowerShellScript"
},
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/',tolower(parameters('vmName')),string(add(copyIndex(),parameters('offset'))))]"
],
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.9",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"[uri(deployment().properties.templateLink.uri, 'initialize.ps1')]"
]
},
"protectedSettings": {
"commandToExecute": "[concat(variables('ScriptCommandToExecute'),'initialize.ps1',' -TemplateLink \"',deployment().properties.templateLink.uri,'\" -hostName \"',reference(concat(parameters('vmName'), string(add(copyIndex(),parameters('offset'))), '_pip')).dnsSettings.fqdn,'\" -RemoteDesktopAccess \"',variables('rdpAddresses'),'\" -WinRmAccess \"',variables('winRmAddresses'),'\" -Isolation \"',variables('Isolation'),'\" -VMAdminUsername \"',trim(parameters('vmAdminUsername')),'\" -NAVAdminUsername \"',trim(parameters('navAdminUsername')),'\" -AdminPassword \"',variables('passwords')[mod(copyIndex(),variables('noOfPasswords'))],'\" -artifactUrl \"',parameters('artifactUrl'),'\" -navDockerImage \"',trim(parameters('navDockerImage')),'\" -registryUsername \"',parameters('registryUsername'),'\" -registryPassword \"',replace(parameters('registryPassword'),'\"','\\\"'),'\" -LicenseFileUri \"',parameters('licenseFileUri'),'\" -style \"workshop\" -fobfileurl \"',parameters('FobFileUrl'),'\" -workshopFilesUrl \"',parameters('workshopFilesUrl'),'\" -CertificatePfxUrl \"',parameters('CertificatePfxUrl'),'\" -CertificatePfxPassword \"',replace(parameters('CertificatePfxPassword'),'\"','\\\"'),'\" -PublicDnsName \"',replace(parameters('PublicDnsName'),'#',string(add(copyIndex(),parameters('offset')))),'\" -beforeContainerSetupScriptUrl \"',parameters('beforeContainerSetupScriptUrl'),'\" -finalSetupScriptUrl \"',parameters('finalSetupScriptUrl'),'\" -RequestToken \"',parameters('RequestToken'),'\" -AssignPremiumPlan \"',parameters('AssignPremiumPlan'),'\" -CreateTestUsers \"',parameters('CreateTestUsers'),'\" -EnableSymbolLoading \"',parameters('EnableSymbolLoading'),'\" -IncludeCSIDE \"',parameters('IncludeCSIDE'),'\" -ClickOnce \"',parameters('ClickOnce'),'\" -IncludeAL \"',parameters('IncludeAL'),'\" -RunWindowsUpdate \"',parameters('RunWindowsUpdate'),'\" -ContactEMailForLetsEncrypt \"',parameters('ContactEMailForLetsEncrypt'),'\" -nchbranch \"',variables('nchbranch'),'\"')]"
}
},
"copy": {
"name" : "copyext",
"count" : "[parameters('count')]"
}
}
],
"outputs": {
}
}