{ "$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" } }, "AcceptInsiderEula": { "type": "string", "defaultValue": "No", "allowedValues": [ "Yes", "No" ], "metadata": { "Description": "If you are going to deploy an insider build of Business Central on the VM, you will need to accept the insider EULA (https://go.microsoft.com/fwlink/?linkid=2245051)" } }, "RemoteDesktopAccess": { "type": "string", "defaultValue": "", "minLength": 1, "metadata": { "Description": "Specify * (star) to allow all remote desktop access, specify - (minus) to deny all remote desktop access (use JIT) 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 2022", "allowedValues": [ "Windows Server 2022", "Windows Server 2019" ], "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" } }, "ContainerName": { "type": "string", "defaultValue": "bcserver", "minLength": 2, "metadata": { "Description": "Name of the default container to create in the VM" } }, "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." } }, "vmAdminUsername": { "type": "string", "defaultValue": "vmadmin", "minLength": 1, "metadata": { "Description": "Specify administrator user name for connecting to the VM" } }, "BCAdminUsername": { "type": "string", "defaultValue": "admin", "minLength": 1, "metadata": { "Description": "Specify administrator user name for Business Central" } }, "adminPassword": { "type": "securestring", "defaultValue": "", "metadata": { "Description": "Specify administrator password for VM, Business Central and SQL (if applicable)" } }, "ArtifactUrl": { "type": "string", "defaultValue": "bcartifacts/onprem//w1/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." } }, "BCDockerImage": { "type": "string", "defaultValue": "", "metadata": { "Description": "Select the Business Central Docker Image to deploy. ArtifactUrl is ignored if you specify a Docker Image." } }, "TestToolkit": { "type": "string", "defaultValue": "No", "allowedValues": [ "No", "Framework", "Libraries", "All" ], "metadata": { "Description": "Specify whether you want the Test Toolkit to be installed. Installing the Test Toolkit requires you to specify a license file. Specifying All installs Test Framework, Test Libraries and all Microsoft Tests." } }, "AssignPremiumPlan": { "type": "string", "defaultValue": "No", "allowedValues": [ "Yes", "No" ], "metadata": { "Description": "Assign Premium Plan to admin user. This setting only makes sense for Sandbox images (mcr.microsoft.com/businesscentral/sandbox:*)." } }, "CreateTestUsers": { "type": "string", "defaultValue": "No", "allowedValues": [ "Yes", "No" ], "metadata": { "Description": "Create a set of users for test purposes (ExternalAccountant, Premium, Essential, InternalAdmin, TeamMember and DelegatedAdmin). This setting only makes sense for Sandbox images (mcr.microsoft.com/businesscentral/sandbox:*). Setting this option to Yes requires you to specify a license file." } }, "LicenseFileUri": { "type": "string", "defaultValue": "", "metadata": { "Description": "Optional: Specify a secure Url of your Partner License File. If you do not specify a license file Url here, you will have to upload the license manually later." } }, "EnableTaskScheduler": { "type": "string", "defaultValue": "Yes", "allowedValues": [ "Yes", "No" ], "metadata": { "Description": "Enable Task Scheduler in Container" } }, "Office365UserName": { "type": "string", "defaultValue": "", "metadata": { "Description": "Enter Office 365 Administrator Email (leave empty to skip Office 365 integration)" } }, "Office365Password": { "type": "securestring", "defaultValue": "", "metadata": { "Description": "Enter Office 365 Administrator Password (leave empty if no Office 365 integration)" } }, "CreateAadUsers": { "type": "string", "defaultValue": "No", "allowedValues": [ "Yes", "No" ], "metadata": { "Description": "Create users from the Aad (users in Office 365) as SUPER (only when using Office 365 integration)" } }, "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." } }, "BingMapsKey": { "type": "string", "defaultValue": "", "metadata": { "Description": "Bing Maps Key for Bing Maps Integration App installation (leave empty to skip Bing Maps Integration)" } }, "RunWindowsUpdate": { "type": "string", "defaultValue": "No", "allowedValues": [ "Yes", "No" ], "metadata": { "Description": "Run Windows Update after Deployment (might take significant time)" } }, "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." } }, "AutoShutdown": { "type": "string", "defaultValue": "Disabled", "allowedValues": [ "Enabled", "Disabled" ], "metadata": { "Description": "Specifies whether you want to enable autoshutdown of the VM." } }, "AutoShutdownTime": { "type": "string", "defaultValue": "20:00", "metadata": { "Description": "Time of day on which the VM will be auto-shutdown (if enabled)." } }, "AddTraefik": { "type": "string", "defaultValue": "No", "allowedValues": [ "Yes", "No" ], "metadata": { "Description": "Add traefik.io as reverse proxy. When using traefik, you will find the landing page on http://publicdnsname:8180." } } }, "variables": { "nchbranch": "", "vmName": "[trim(parameters('vmName'))]", "TimezoneId": "[parameters('TimezoneId')]", "AcceptEula": "[parameters('AcceptEula')]", "AcceptInsiderEula": "[parameters('AcceptInsiderEula')]", "vmSize": "[parameters('vmSize')]", "RemoteDesktopAccess": "[parameters('RemoteDesktopAccess')]", "WinRmAccess": "[parameters('WinRmAccess')]", "containerName": "[parameters('ContainerName')]", "Isolation": "[parameters('Isolation')]", "vmAdminUsername": "[trim(parameters('vmAdminUsername'))]", "navAdminUsername": "[trim(parameters('BCAdminUsername'))]", "azureSqlAdminUsername": "sqladmin", "adminPassword": "[parameters('adminPassword')]", "artifactUrl": "[parameters('artifactUrl')]", "navDockerImage": "[trim(parameters('BCDockerImage'))]", "registryUsername": "", "registryPassword": "", "LicenseFileUri": "[parameters('LicenseFileUri')]", "SQLServerType": "SQLExpress", "AppBacpacUri": "", "TenantBacpacUri": "", "IncludeAppUris": "", "CertificatePfxUrl": "", "CertificatePfxPassword": "", "PublicDnsName": "", "Multitenant": "No", "TestToolkit": "[parameters('TestToolkit')]", "AssignPremiumPlan": "[parameters('AssignPremiumPlan')]", "CreateTestUsers": "[parameters('CreateTestUsers')]", "CreateAadUsers": "[parameters('CreateAadUsers')]", "EnableSymbolLoading": "No", "IncludeCSIDE": "No", "IncludeAL": "No", "ClickOnce": "No", "EnableTaskScheduler": "[parameters('EnableTaskScheduler')]", "Office365UserName": "[parameters('Office365UserName')]", "Office365Password": "[parameters('Office365Password')]", "BingMapsKey": "[parameters('BingMapsKey')]", "FinalSetupScriptUrl": "[parameters('FinalSetupScriptUrl')]", "RunWindowsUpdate": "[parameters('RunWindowsUpdate')]", "ContactEMailForLetsEncrypt": "[parameters('ContactEMailForLetsEncrypt')]", "AutoShutdown": "[parameters('AutoShutdown')]", "AutoShutdownTime": "[parameters('AutoShutdownTime')]", "AddTraefik": "[parameters('AddTraefik')]", "style": "demo", "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": "Standard_LRS", "OSDiskName": "[concat(variables('vmName'),'_osdisk')]", "publicIPAddressName": "[concat(variables('vmName'), '_pip')]", "storageAccountName": "[concat('storage', uniqueString(resourceGroup().id))]", "networkSecurityGroupName": "[concat('networksecuritygroup',if(equals(parameters('AddTraefik'),'Yes'),'_traefik',''))]", "dnsName": "[tolower(variables('vmName'))]", "addressPrefix": "10.0.0.0/16", "subnetName": "Subnet", "subnetPrefix": "10.0.0.0/24", "virtualNetworkName": "virtualnetwork", "server1Name": "[tolower(variables('vmName'))]", "nic1Name": "[concat(variables('vmName'),'_nic')]", "delimiters": [ ",", ";" ], "RdpAddresses": "[if(equals(variables('RemoteDesktopAccess'),'-'),'',variables('RemoteDesktopAccess'))]", "rdpSourceAddressPrefix": "[split(variables('RdpAddresses'),variables('delimiters'))]", "noOfAddresses": "[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 ", "azureSqlServer": "[concat('sql', replace(tolower(variables('vmName')),'-',''))]", "azureSqlServerDnsName": "[concat(variables('azureSqlServer'),'.database.windows.net')]", "SqlCollation": "Latin1_General_100_CS_AS" }, "resources": [ { "apiVersion": "2014-04-01-preview", "type": "Microsoft.Sql/servers", "name": "[variables('azureSqlServer')]", "location": "[resourceGroup().location]", "condition": "[equals(variables('sqlServerType'),'AzureSQL')]", "tags": { "displayName": "SqlServer" }, "properties": { "administratorLogin": "[variables('azureSqlAdminUsername')]", "administratorLoginPassword": "[variables('adminPassword')]", "version": "12.0" }, "resources": [ { "apiVersion": "2014-04-01-preview", "type": "firewallrules", "name": "AllowAllAzureIps", "location": "[resourceGroup().location]", "condition": "[equals(variables('sqlServerType'),'AzureSQL')]", "dependsOn": [ "[variables('azureSqlServer')]" ], "properties": { "endIpAddress": "0.0.0.0", "startIpAddress": "0.0.0.0" } }, { "apiVersion": "2014-04-01-preview", "type": "databases", "name": "App", "location": "[resourceGroup().location]", "condition": "[and(equals(variables('sqlServerType'),'AzureSQL'),not(equals(variables('AppBacpacUri'),'')))]", "dependsOn": [ "[concat('Microsoft.Sql/servers/', variables('azureSqlServer'))]" ], "tags": { "displayName": "App Database" }, "properties": { "collation": "[variables('SqlCollation')]", "edition": "Standard", "maxSizeBytes": "1073741824", "requestedServiceObjectiveName": "S0" }, "resources": [ { "apiVersion": "2014-04-01-preview", "type": "extensions", "name": "Import", "condition": "[and(equals(variables('sqlServerType'),'AzureSQL'),not(equals(variables('AppBacpacUri'),'')))]", "dependsOn": [ "[concat('Microsoft.Sql/servers/', variables('azureSqlServer'), '/databases/App')]" ], "tags": { "displayName": "Import" }, "properties": { "storageKeyType": "SharedAccessKey", "storageUri": "[split(variables('AppBacpacUri'),'?')[0]]", "storageKey": "[if(contains(variables('AppBacpacUri'),'?'),concat('?',split(variables('AppBacpacUri'),'?')[1]),'')]", "administratorLogin": "[variables('azureSqlAdminUsername')]", "administratorLoginPassword": "[variables('adminPassword')]", "operationMode": "Import" } } ] }, { "apiVersion": "2014-04-01-preview", "type": "databases", "name": "Tenant", "location": "[resourceGroup().location]", "condition": "[and(equals(variables('sqlServerType'),'AzureSQL'),not(equals(variables('TenantBacpacUri'),'')))]", "dependsOn": [ "[concat('Microsoft.Sql/servers/', variables('azureSqlServer'))]" ], "tags": { "displayName": "Tenant Template" }, "properties": { "collation": "[variables('SqlCollation')]", "edition": "Standard", "maxSizeBytes": "1073741824", "requestedServiceObjectiveName": "S0" }, "resources": [ { "apiVersion": "2014-04-01-preview", "type": "extensions", "name": "Import", "condition": "[and(equals(variables('sqlServerType'),'AzureSQL'),not(equals(variables('TenantBacpacUri'),'')))]", "dependsOn": [ "[concat('Microsoft.Sql/servers/', variables('azureSqlServer'), '/databases/Tenant')]" ], "tags": { "displayName": "Import" }, "properties": { "storageKeyType": "SharedAccessKey", "storageUri": "[split(variables('TenantBacpacUri'),'?')[0]]", "storageKey": "[if(contains(variables('TenantBacpacUri'),'?'),concat('?',split(variables('TenantBacpacUri'),'?')[1]),'')]", "administratorLogin": "[variables('azureSqlAdminUsername')]", "administratorLoginPassword": "[variables('adminPassword')]", "operationMode": "Import" } } ] } ] }, { "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": "[variables('publicIPAddressName')]", "location": "[resourceGroup().location]", "properties": { "publicIPAllocationMethod": "Dynamic", "dnsSettings": { "domainNameLabel": "[variables('dnsName')]" } } }, { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/networkSecurityGroups", "name": "networkSecurityGroup", "condition": "[equals(variables('AddTraefik'),'No')]", "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": "Soap", "properties": { "description": "Access to Soap Web Services", "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "7047", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 230, "direction": "Inbound" } }, { "name": "OData", "properties": { "description": "Access to OData Services", "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "7048", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 240, "direction": "Inbound" } }, { "name": "Developer", "properties": { "description": "Access to Developer Services", "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "7049", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 250, "direction": "Inbound" } } ] } }, { "apiVersion": "2015-05-01-preview", "type": "Microsoft.Network/networkSecurityGroups", "name": "networkSecurityGroup_traefik", "condition": "[equals(variables('AddTraefik'),'Yes')]", "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": "Log", "properties": { "description": "Access to status log if Traefik is used", "protocol": "Tcp", "sourcePortRange": "*", "destinationPortRange": "8180", "sourceAddressPrefix": "*", "destinationAddressPrefix": "*", "access": "Allow", "priority": 230, "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('noOfAddresses')]" }, "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": "[variables('nic1Name')]", "location": "[resourceGroup().location]", "dependsOn": [ "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]", "[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',variables('publicIPAddressName'))]" }, "subnet": { "id": "[variables('subnetRef')]" } } } ] } }, { "apiVersion": "2018-10-01", "type": "Microsoft.Compute/virtualMachines", "name": "[variables('server1Name')]", "location": "[resourceGroup().location]", "condition": "[equals(variables('acceptEula'),'Yes')]", "dependsOn": [ "[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]", "[concat('Microsoft.Network/networkInterfaces/', variables('nic1Name'))]" ], "properties": { "hardwareProfile": { "vmSize": "[variables('vmSize')]" }, "osProfile": { "computerName": "[variables('server1Name')]", "adminUsername": "[variables('vmAdminUsername')]", "adminPassword": "[variables('adminPassword')]", "windowsConfiguration": { "provisionVMAgent": true, "timeZone": "[variables('TimezoneId')]" } }, "storageProfile": { "imageReference": { "publisher": "[variables('imagePublisher')]", "offer": "[variables('imageOffer')]", "sku": "[variables('imageSku')]", "version": "latest" }, "osDisk": { "createOption": "FromImage", "osType": "Windows", "name": "[variables('OSDiskName')]", "caching": "ReadWrite", "managedDisk": { "storageAccountType": "[variables('storageAccountType')]" }, "diskSizeGB": 128 } }, "networkProfile": { "networkInterfaces": [ { "id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nic1Name'))]" } ] } }, "resources": [ { "apiVersion": "2017-04-26-preview", "type": "microsoft.devtestlab/schedules", "name": "[concat('shutdown-computevm-',variables('server1Name'))]", "location": "[resourceGroup().location]", "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/',variables('server1Name'))]" ], "properties": { "status": "[variables('AutoShutdown')]", "taskType": "ComputeVmShutdownTask", "dailyRecurrence": { "time": "[variables('AutoShutdownTime')]" }, "timeZoneId": "[variables('TimezoneId')]", "notificationSettings": { "status": "Disabled", "timeInMinutes": 15 }, "targetResourceId": "[resourceId('Microsoft.Compute/virtualMachines',variables('server1Name'))]" } } ] }, { "apiVersion": "2015-06-15", "type": "Microsoft.Compute/virtualMachines/extensions", "name": "[concat(variables('server1Name'),'/vmextension1')]", "location": "[resourceGroup().location]", "condition": "[equals(variables('acceptEula'),'Yes')]", "tags": { "displayName": "PowerShellScript2" }, "dependsOn": [ "[concat('Microsoft.Compute/virtualMachines/', variables('server1Name'))]" ], "properties": { "publisher": "Microsoft.Compute", "type": "CustomScriptExtension", "typeHandlerVersion": "1.9", "autoUpgradeMinorVersion": true, "settings": { "fileUris": [ "[uri(deployment().properties.templateLink.uri, 'initialize.ps1')]" ], "commandToExecute": "[concat(variables('ScriptCommandToExecute'),'initialize.ps1',' -TemplateLink \"',deployment().properties.templateLink.uri,'\" -hostName \"',reference(variables('publicIPAddressName')).dnsSettings.fqdn,'\" -AcceptInsiderEula \"',variables('AcceptInsiderEula'),'\" -RemoteDesktopAccess \"',variables('RdpAddresses'),'\" -WinRmAccess \"',variables('winRmAddresses'),'\" -Isolation \"',variables('Isolation'),'\" -VMAdminUsername \"',variables('vmAdminUsername'),'\" -NAVAdminUsername \"',variables('navAdminUsername'),'\" -AzureSQLAdminUsername \"',variables('azureSqlAdminUsername'),'\" -AdminPassword \"',replace(variables('adminPassword'),'\"','\\\"'),'\" -artifactUrl \"',variables('artifactUrl'),'\" -navDockerImage \"',variables('navDockerImage'),'\" -registryUsername \"',variables('registryUsername'),'\" -registryPassword \"',replace(variables('registryPassword'),'\"','\\\"'),'\" -LicenseFileUri \"',variables('licenseFileUri'),'\" -SQLServerType \"',variables('SQLServerType'),'\" -AzureSqlServer \"',if(equals(variables('SQLServerType'),'AzureSQL'),variables('azureSqlServerDnsName'),''),'\" -AppBacpacUri \"',variables('AppBacpacUri'),'\" -TenantBacpacUri \"',variables('TenantBacpacUri'),'\" -IncludeAppUris \"',variables('IncludeAppUris'),'\" -CertificatePfxUrl \"',variables('CertificatePfxUrl'),'\" -CertificatePfxPassword \"',replace(variables('CertificatePfxPassword'),'\"','\\\"'),'\" -PublicDnsName \"',variables('PublicDnsName'),'\" -Multitenant \"',variables('Multitenant'),'\" -TestToolkit \"',variables('TestToolkit'),'\" -AssignPremiumPlan \"',variables('AssignPremiumPlan'),'\" -CreateTestUsers \"',variables('CreateTestUsers'),'\" -CreateAadUsers \"',variables('CreateAadUsers'),'\" -EnableSymbolLoading \"',variables('EnableSymbolLoading'),'\" -IncludeCSIDE \"',variables('IncludeCSIDE'),'\" -IncludeAL \"',variables('IncludeAL'),'\" -ClickOnce \"',variables('ClickOnce'),'\" -EnableTaskScheduler \"',variables('EnableTaskScheduler'),'\" -Office365UserName \"',variables('Office365UserName'),'\" -Office365Password \"',replace(variables('Office365Password'),'\"','\\\"'),'\" -BingMapsKey \"',variables('BingMapsKey'),'\" -finalSetupScriptUrl \"',variables('finalSetupScriptUrl'),'\" -RunWindowsUpdate \"',variables('RunWindowsUpdate'),'\" -ContactEMailForLetsEncrypt \"',variables('ContactEMailForLetsEncrypt'),'\" -style \"',variables('style'),'\" -nchbranch \"',variables('nchbranch'),'\" -containerName \"',variables('containerName'),'\" -AddTraefik \"',variables('AddTraefik'),'\"')]" }, "protectedSettings": {} } } ], "outputs": { "landingPage": { "value": "[concat('http://',reference(variables('publicIPAddressName')).dnsSettings.fqdn)]", "type": "string" } } }