Description
stringlengths
19
200
IaC
stringlengths
128
8.16k
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "name": "[variables('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('storageaccounttype')]"}, "kind": "storagev2", "properties": {}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"type": "microsoft.resources/deployments", "apiversion": "2020-06-01", "name": "deployflowlogs", "resourcegroup": "networkwatcherrg", "dependson": ["[variables('storageaccountname')]"], "properties": {"mode": "incremental", "expressionevaluationoptions": {"scope": "inner"}, "template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymenttemplate.json#", "contentversion": "1.0.0.0", "parameters": {"location": {"type": "string"}, "networkwatchername": {"type": "string"}, "flowlogname": {"type": "string"}, "existingnsg": {"type": "string"}, "retentiondays": {"type": "int"}, "flowlogsversion": {"type": "string"}, "storageaccountresourceid": {"type": "string"}}, "resources": [{"type": "microsoft.network/networkwatchers/flowlogs", "apiversion": "2020-06-01", "name": "[concat(parameters('networkwatchername'), "/", parameters('flowlogname'))]", "location": "[parameters('location')]", "properties": {"targetresourceid": "[parameters('existingnsg')]", "storageid": "[parameters('storageaccountresourceid')]", "enabled": true, "retentionpolicy": {"days": "[parameters('retentiondays')]", "enabled": true}, "format": {"type": "json", "version": "[parameters('flowlogsversion')]"}}}]}, "parameters": {"location": {"value": "[parameters('location')]"}, "networkwatchername": {"value": "[parameters('networkwatchername')]"}, "flowlogname": {"value": "[parameters('flowlogname')]"}, "existingnsg": {"value": "[parameters('existingnsg')]"}, "retentiondays": {"value": "[parameters('retentiondays')]"}, "flowlogsversion": {"value": "[parameters('flowlogsversion')]"}, "storageaccountresourceid": {"value": "[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2017-03-30", "type": "microsoft.compute/availabilitysets", "name": "as1", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2017-03-30", "type": "microsoft.compute/availabilitysets", "name": "as1", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[concat(variables('vmname'), copyindex())]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "nicloop", "microsoft.compute/availabilitysets/as1"], "copy": {"name": "vmloop", "count": 2}, "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets", "as1')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[concat(variables('vmname'), copyindex())]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2016-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat('nic",copyindex()))]"}]}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "name": "[variables('storageaccountname')]", "apiversion": "2017-06-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", parameters('vnetname'))]"], "sku": {"name": "[parameters('storageaccounttype')]"}, "kind": "storage", "properties": {"networkacls": {"bypass": "none", "virtualnetworkrules": [{"id": "[variables('subnetid')[0]]", "action": "allow"}], "defaultaction": "deny"}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/availabilitysets", "name": "as1", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/availabilitysets", "name": "as1", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[concat(variables('vmname'), copyindex())]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "nicloop", "microsoft.compute/availabilitysets/as1"], "copy": {"name": "vmloop", "count": 2}, "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets", "as1')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[concat(variables('vmname'), copyindex())]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2016-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat('nic",copyindex()))]"}]}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "name": "[variables('storageaccountname')]", "apiversion": "2017-06-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", parameters('vnetname'))]"], "sku": {"name": "[parameters('storageaccounttype')]"}, "kind": "storage", "properties": {"networkacls": {"bypass": "none", "virtualnetworkrules": [{"id": "[variables('subnetid')[0]]", "action": "allow"}], "defaultaction": "deny"}}}
Application Gateway routing Internet traffic to a virtual network (internal mode) API Management instance which services a web API hosted in an Azure Web App.
{"type": "microsoft.web/serverfarms", "apiversion": "2020-12-01", "name": "[parameters('appserviceplanname')]", "location": "[parameters('location')]", "sku": {"name": "s1", "tier": "standard"}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('jumpboxsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "disksizegb": 127}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('jumpboxsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "disksizegb": 127}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))).primaryendpoints.blob]"}}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "server", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('serversize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "disksizegb": 127}}, "osprofile": {"computername": "server", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "name": "[variables('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storage", "properties": {}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('jumpboxsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "disksizegb": 127}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('jumpboxsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "disksizegb": 127}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))).primaryendpoints.blob]"}}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "server", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('serversize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "disksizegb": 127}}, "osprofile": {"computername": "server", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "name": "[variables('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storage", "properties": {}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "server", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "server", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "name": "[variables('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storagev2", "properties": {}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "server", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "server", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "name": "[variables('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storagev2", "properties": {}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"apiversion": "2020-06-01", "type": "microsoft.resources/deployments", "name": "associatensg", "resourcegroup": "[parameters('existingvirtualnetworkresourcegroupname')]", "dependson": ["[parameters('newnsgname')]"], "properties": {"mode": "incremental", "template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymenttemplate.json#", "contentversion": "1.0.0.0", "resources": [{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks/subnets", "name": "[concat(parameters('existingvirtualnetworkname'), "/", parameters('existingsubnetname'))]", "location": "[parameters('location')]", "properties": {"addressprefix": "[reference(variables('subnetid'), "2020-05-01').addressprefix]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", parameters('newnsgname'))]"}}}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", parameters('networkinterfacename'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"ostype": "linux", "name": "[concat(parameters('vmname'), "_disk1')]", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "premium_lrs"}, "disksizegb": 30}}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "linuxconfiguration": {"disablepasswordauthentication": false, "provisionvmagent": true}, "allowextensionoperations": true}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", parameters('networkinterfacename'))]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", parameters('networkinterfacename'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"ostype": "linux", "name": "[concat(parameters('vmname'), "_disk1')]", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "premium_lrs"}, "disksizegb": 30}}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "linuxconfiguration": {"disablepasswordauthentication": false, "provisionvmagent": true}, "allowextensionoperations": true}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", parameters('networkinterfacename'))]"}]}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"apiversion": "2020-06-01", "name": "deploy", "type": "microsoft.resources/deployments", "resourcegroup": "[parameters('virtualnetworkresourcegroupname')]", "dependson": ["new-nsg"], "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('nested/updatesubnet.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"virtualnetworkname": {"value": "[parameters('virtualnetworkname')]"}, "subnetname": {"value": "[parameters('subnetname')]"}, "subnetaddressprefix": {"value": "[reference(resourceid(parameters('virtualnetworkresourcegroupname'), "microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname')), "2020-08-01').addressprefix]"}, "nsgid": {"value": "[resourceid('microsoft.network/networksecuritygroups", "new-nsg')]"}, "location": {"value": "[parameters('location')]"}}}}
This template creates a data collection rule defining the data source (Syslog) and the destination workspace.
{"condition": "[parameters('enablediagnostics')]", "type": "microsoft.insights/diagnosticsettings", "apiversion": "2021-05-01-preview", "scope": "[format('microsoft.network/publicipaddresses/{0}", parameters('publicipaddressname'))]", "name": "[variables('publicipdiagnosticsname')]", "properties": {"workspaceid": "[if(empty(parameters('loganalyticsworkspaceid')), null(), parameters('loganalyticsworkspaceid'))]", "storageaccountid": "[if(empty(parameters('diagnosticstorageaccountid')), null(), parameters('diagnosticstorageaccountid'))]", "logs": [{"category": "ddosprotectionnotifications", "enabled": true}, {"category": "ddosmitigationflowlogs", "enabled": true}, {"category": "ddosmitigationreports", "enabled": true}], "metrics": [{"category": "allmetrics", "enabled": true}]}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", parameters('publicipaddressname'))]"]}
This template creates a data collection rule defining the data source (Syslog) and the destination workspace.
{"condition": "[parameters('enablediagnostics')]", "type": "microsoft.insights/diagnosticsettings", "apiversion": "2021-05-01-preview", "scope": "[format('microsoft.network/publicipaddresses/{0}", parameters('publicipaddressname'))]", "name": "[variables('publicipdiagnosticsname')]", "properties": {"workspaceid": "[if(empty(parameters('loganalyticsworkspaceid')), null(), parameters('loganalyticsworkspaceid'))]", "storageaccountid": "[if(empty(parameters('diagnosticstorageaccountid')), null(), parameters('diagnosticstorageaccountid'))]", "logs": [{"category": "ddosprotectionnotifications", "enabled": true}, {"category": "ddosmitigationflowlogs", "enabled": true}, {"category": "ddosmitigationreports", "enabled": true}], "metrics": [{"category": "allmetrics", "enabled": true}]}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", parameters('publicipaddressname'))]"]}{"condition": "[parameters('enablediagnostics')]", "type": "microsoft.insights/diagnosticsettings", "apiversion": "2021-05-01-preview", "scope": "[format('microsoft.network/applicationgateways/{0}", parameters('applicationgatewayname'))]", "name": "[variables('appgatewaydiagnosticsname')]", "properties": {"workspaceid": "[if(empty(parameters('loganalyticsworkspaceid')), null(), parameters('loganalyticsworkspaceid'))]", "storageaccountid": "[if(empty(parameters('diagnosticstorageaccountid')), null(), parameters('diagnosticstorageaccountid'))]", "logs": [{"category": "applicationgatewayaccesslog", "enabled": true}, {"category": "applicationgatewayperformancelog", "enabled": true}, {"category": "applicationgatewayfirewalllog", "enabled": true}], "metrics": [{"category": "allmetrics", "enabled": true}]}, "dependson": ["[resourceid('microsoft.network/applicationgateways", parameters('applicationgatewayname'))]"]}
This template uses Azure Managed Identity to assign access to Azure Maps. See more at https://aka.ms/amauth
{"condition": "[parameters('enabledeletelock')]", "type": "microsoft.authorization/locks", "apiversion": "2017-04-01", "scope": "[format('microsoft.network/publicipaddresses/{0}", parameters('publicipaddressname'))]", "name": "[variables('publiciplockname')]", "properties": {"level": "cannotdelete"}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", parameters('publicipaddressname'))]"]}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"comments": "linux web server", "name": "[parameters('vmname')]", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", concat(parameters('vmname'),"-nic'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": "[variables('imageinfo')]", "osdisk": {"name": "[concat(parameters('vmname'),"-osdisk')]", "caching": "readwrite", "createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstoragetype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat(parameters('vmname'),"-nic'))]"}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"comments": "linux web server", "name": "[parameters('vmname')]", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", concat(parameters('vmname'),"-nic'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": "[variables('imageinfo')]", "osdisk": {"name": "[concat(parameters('vmname'),"-osdisk')]", "caching": "readwrite", "createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstoragetype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat(parameters('vmname'),"-nic'))]"}]}}}{"comments": "installs ngnix", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('vmname'),"/linuxconfig')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[parameters('vmname')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('scripturl')]"], "commandtoexecute": "sh install_nginx.sh"}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"comments": "linux web server", "name": "[parameters('vmname')]", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", concat(parameters('vmname'),"-nic'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": "[variables('imageinfo')]", "osdisk": {"name": "[concat(parameters('vmname'),"-osdisk')]", "caching": "readwrite", "createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstoragetype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat(parameters('vmname'),"-nic'))]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"comments": "linux web server", "name": "[parameters('vmname')]", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", concat(parameters('vmname'),"-nic'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": "[variables('imageinfo')]", "osdisk": {"name": "[concat(parameters('vmname'),"-osdisk')]", "caching": "readwrite", "createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstoragetype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat(parameters('vmname'),"-nic'))]"}]}}}{"comments": "installs ngnix", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('vmname'),"/linuxconfig')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[parameters('vmname')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('scripturl')]"], "commandtoexecute": "sh install_nginx.sh"}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jump-srv", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", "netinterface-jump-srv')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}, "disksizegb": 127}}, "osprofile": {"computername": "jump-srv", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"provisionvmagent": true, "enableautomaticupdates": true}, "allowextensionoperations": true}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", "netinterface-jump-srv')]"}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jump-srv", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", "netinterface-jump-srv')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}, "disksizegb": 127}}, "osprofile": {"computername": "jump-srv", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"provisionvmagent": true, "enableautomaticupdates": true}, "allowextensionoperations": true}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", "netinterface-jump-srv')]"}]}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "workload-srv", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", "netinterface-workload-srv')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}, "disksizegb": 127}}, "osprofile": {"computername": "workload-srv", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"provisionvmagent": true, "enableautomaticupdates": true}, "allowextensionoperations": true}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", "netinterface-workload-srv')]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jump-srv", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", "netinterface-jump-srv')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}, "disksizegb": 127}}, "osprofile": {"computername": "jump-srv", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"provisionvmagent": true, "enableautomaticupdates": true}, "allowextensionoperations": true}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", "netinterface-jump-srv')]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "jump-srv", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", "netinterface-jump-srv')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}, "disksizegb": 127}}, "osprofile": {"computername": "jump-srv", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"provisionvmagent": true, "enableautomaticupdates": true}, "allowextensionoperations": true}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", "netinterface-jump-srv')]"}]}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "workload-srv", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", "netinterface-workload-srv')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}, "disksizegb": 127}}, "osprofile": {"computername": "workload-srv", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"provisionvmagent": true, "enableautomaticupdates": true}, "allowextensionoperations": true}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", "netinterface-workload-srv')]"}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"name": "jumpbox", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"name": "jumpbox", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"name": "jumpbox", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}{"name": "server", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "server", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat(parameters('projectname'),"-vm", copyindex(1), "/", "installwebserver')]", "location": "[parameters('location')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat(parameters('projectname'),"-vm", copyindex(1), "/", "installwebserver')]", "location": "[parameters('location')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[concat(parameters('projectname'),"-vm", copyindex(1))]", "location": "[parameters('location')]", "dependson": ["networkinterfacecopy"], "copy": {"name": "vmcopy", "count": 3}, "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstorageaccounttype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(parameters('projectname'),"-vm", copyindex(1), "-networkinterface'))]"}]}, "osprofile": {"computername": "[concat(parameters('projectname'),"-vm", copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat(parameters('projectname'),"-vm", copyindex(1), "/", "installwebserver')]", "location": "[parameters('location')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat(parameters('projectname'),"-vm", copyindex(1), "/", "installwebserver')]", "location": "[parameters('location')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[concat(parameters('projectname'),"-vm", copyindex(1))]", "location": "[parameters('location')]", "dependson": ["networkinterfacecopy"], "copy": {"name": "vmcopy", "count": 3}, "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstorageaccounttype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(parameters('projectname'),"-vm", copyindex(1), "-networkinterface'))]"}]}, "osprofile": {"computername": "[concat(parameters('projectname'),"-vm", copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat(parameters('projectname'),"-vm", copyindex(1), "/", "installwebserver')]", "location": "[parameters('location')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[concat(parameters('projectname'),"-vm", copyindex(1))]", "location": "[parameters('location')]", "zones": ["[copyindex(1)]"], "copy": {"name": "vmcopy", "count": 3}, "dependson": ["networkinterfacecopy"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstorageaccounttype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(parameters('projectname'),"-vm", copyindex(1), "-networkinterface'))]"}]}, "osprofile": {"computername": "[concat(parameters('projectname'),"-vm", copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}
Application Gateway routing Internet traffic to a virtual network (internal mode) API Management instance which services a web API hosted in an Azure Web App.
{"apiversion": "2019-08-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "tags": {"displayname": "hostingplan"}, "sku": {"name": "s1", "capacity": "1"}, "properties": {"name": "[variables('hostingplanname')]"}}
Application Gateway routing Internet traffic to a virtual network (internal mode) API Management instance which services a web API hosted in an Azure Web App.
{"apiversion": "2019-08-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "tags": {"displayname": "hostingplan"}, "sku": {"name": "s1", "capacity": "1"}, "properties": {"name": "[variables('hostingplanname')]"}}{"apiversion": "2019-08-01", "name": "[parameters('sitename')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "dependson": ["[variables('hostingplanname')]"], "properties": {"name": "[parameters('sitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "resources": [{"apiversion": "2019-08-01", "type": "config", "name": "connectionstrings", "dependson": ["[parameters('sitename')]"], "properties": {"defaultconnection": {"value": "[concat('database=", variables('databasename'), ";data source=", reference(resourceid('microsoft.dbformysql/servers",variables('servername'))).fullyqualifieddomainname, ";user id=", parameters('administratorlogin'),"@", variables('servername'),";password=", parameters('administratorloginpassword'))]", "type": "mysql"}}}, {"apiversion": "2019-08-01", "type": "config", "name": "web", "dependson": ["[parameters('sitename')]", "fetchipaddress"], "properties": {"ipsecurityrestrictions": [{"ipaddress": "[concat(reference('fetchipaddress').outputs.ipaddress.value,"/32')]"}]}}]}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"apiversion": "2020-06-01", "name": "fetchipaddress", "type": "microsoft.resources/deployments", "dependson": ["[variables('applicationgatewayname')]"], "properties": {"mode": "incremental", "templatelink": {"contentversion": "1.0.0.0", "uri": "[uri(parameters('_artifactslocation'), concat('fetchipaddress.json", parameters('_artifactslocationsastoken')))]"}, "parameters": {"publicipaddressid": {"value": "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"}}}}
This template provides a way to deploy an Azure database for MySQL with VNet integration.
{"apiversion": "2017-12-01", "location": "[parameters('location')]", "name": "[variables('servername')]", "properties": {"createmode": "default", "version": "[parameters('mysqlversion')]", "administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]", "storagemb": "[parameters('databaseskusizemb')]"}, "sku": {"name": "[parameters('databaseskuname')]", "tier": "[parameters('databaseskutier')]", "size": "[parameters('databaseskusizemb')]", "family": "[parameters('databaseskufamily')]"}, "type": "microsoft.dbformysql/servers", "resources": [{"type": "firewallrules", "apiversion": "2017-12-01", "dependson": ["[resourceid('microsoft.dbformysql/servers/", variables('servername'))]"], "location": "[parameters('location')]", "name": "[concat(variables('servername'),"firewall')]", "properties": {"startipaddress": "0.0.0.0", "endipaddress": "255.255.255.255"}}, {"name": "[variables('databasename')]", "type": "databases", "apiversion": "2017-12-01", "properties": {"charset": "utf8", "collation": "utf8_general_ci"}, "dependson": ["[resourceid('microsoft.dbformysql/servers/", variables('servername'))]"]}]}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/availabilitysets", "name": "[variables('availabilitysetname')]", "apiversion": "2020-12-01", "location": "[parameters('location')]", "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}, "sku": {"name": "aligned"}}{"apiversion": "2020-12-01", "type": "microsoft.compute/virtualmachines", "name": "[concat(variables('vmnameprefix'), copyindex())]", "copy": {"name": "virtualmachineloop", "count": "[variables('numberofinstances')]"}, "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces/",concat(variables('nicnameprefix'),copyindex()))]", "[resourceid('microsoft.compute/availabilitysets", variables('availabilitysetname'))]"], "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets",variables('availabilitysetname'))]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[concat(variables('vmnameprefix'), copyindex())]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2012-r2-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat(variables('nicnameprefix'),copyindex()))]"}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2016-04-30-preview", "type": "microsoft.compute/virtualmachines", "name": "[concat(parameters('vmnameprefix'), copyindex())]", "location": "[parameters('location')]", "copy": {"name": "vmloop", "count": "[variables('scalenumber')]"}, "dependson": ["[resourceid('microsoft.network/networkinterfaces", "nic0')]", "[resourceid('microsoft.network/networkinterfaces", "nic1')]", "[resourceid('microsoft.network/networkinterfaces", "nic2')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[concat(parameters('vmnameprefix'), copyindex())]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[parameters('windowsosversion')]", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat('nic", copyindex()))]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2016-04-30-preview", "type": "microsoft.compute/virtualmachines", "name": "[concat(parameters('vmnameprefix'), copyindex())]", "location": "[parameters('location')]", "copy": {"name": "vmloop", "count": "[variables('scalenumber')]"}, "dependson": ["[resourceid('microsoft.network/networkinterfaces", "nic0')]", "[resourceid('microsoft.network/networkinterfaces", "nic1')]", "[resourceid('microsoft.network/networkinterfaces", "nic2')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[concat(parameters('vmnameprefix'), copyindex())]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[parameters('windowsosversion')]", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat('nic", copyindex()))]"}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "server", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "server", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-02-01", "name": "[variables('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storage", "properties": {}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "jumpbox", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "server", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "server", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-02-01", "name": "[variables('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storage", "properties": {}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"copy": {"name": "vm", "count": "[length(range(0, variables('numvms')))]"}, "type": "microsoft.compute/virtualmachines", "apiversion": "2021-07-01", "name": "[format('{0}{1}", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "location": "[parameters('location')]", "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[format('{0}{1}", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": "[variables('imagereference')]", "osdisk": {"name": "[format('{0}{1}-osdisk", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", format('{0}{1}-nic", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex()]]))]"}]}}, "dependson": ["[resourceid('microsoft.network/networkinterfaces", format('{0}{1}-nic", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex()]]))]"]}
Create a VM from a Windows Image with 4 Empty Data Disks
{"copy": {"name": "vm", "count": "[length(range(0, variables('numvms')))]"}, "type": "microsoft.compute/virtualmachines", "apiversion": "2021-07-01", "name": "[format('{0}{1}", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "location": "[parameters('location')]", "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[format('{0}{1}", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": "[variables('imagereference')]", "osdisk": {"name": "[format('{0}{1}-osdisk", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", format('{0}{1}-nic", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex()]]))]"}]}}, "dependson": ["[resourceid('microsoft.network/networkinterfaces", format('{0}{1}-nic", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex()]]))]"]}
Create a VM from a Windows Image with 4 Empty Data Disks
{"copy": {"name": "vm", "count": "[length(range(0, variables('numvms')))]"}, "type": "microsoft.compute/virtualmachines", "apiversion": "2021-07-01", "name": "[format('{0}{1}", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "location": "[parameters('location')]", "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[format('{0}{1}", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": "[variables('imagereference')]", "osdisk": {"name": "[format('{0}{1}-osdisk", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", format('{0}{1}-nic", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex()]]))]"}]}}, "dependson": ["[resourceid('microsoft.network/networkinterfaces", format('{0}{1}-nic", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex()]]))]"]}{"copy": {"name": "customscript", "count": "[length(range(0, variables('numvms')))]"}, "type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2021-07-01", "name": "[format('{0}/{1}", format('{0}{1}", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex()]]), "installcustomscript')]", "location": "[parameters('location')]", "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "sudo bash -c "sudo apt-get install -f -y && sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get install -y apache2 && echo \\"you\"re connected to $(hostname)\\" | sudo tee /var/www/html/index.html""}}, "dependson": ["[resourceid('microsoft.compute/virtualmachines", format('{0}{1}", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex()]]))]"]}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1),"/","installwebserver')]", "location": "[parameters('location-r1')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1),"/","installwebserver')]", "location": "[parameters('location-r1')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1))]", "location": "[parameters('location-r1')]", "zones": ["[copyindex(1)]"], "copy": {"name": "vmcopy", "count": 3}, "dependson": ["networkinterfacecopy"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstorageaccounttype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat('vm-r1","-", copyindex(1), "-networkinterface'))]"}]}, "osprofile": {"computername": "[concat('vm-r1","-",copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1),"/","installwebserver')]", "location": "[parameters('location-r1')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1))]", "location": "[parameters('location-r1')]", "zones": ["[copyindex(1)]"], "copy": {"name": "vmcopy", "count": 3}, "dependson": ["networkinterfacecopy"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstorageaccounttype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat('vm-r1","-", copyindex(1), "-networkinterface'))]"}]}, "osprofile": {"computername": "[concat('vm-r1","-",copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat('vm-r2","-",copyindex(1),"/","installwebserver')]", "location": "[parameters('location-r2')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1),"/","installwebserver')]", "location": "[parameters('location-r1')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1))]", "location": "[parameters('location-r1')]", "zones": ["[copyindex(1)]"], "copy": {"name": "vmcopy", "count": 3}, "dependson": ["networkinterfacecopy"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstorageaccounttype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat('vm-r1","-", copyindex(1), "-networkinterface'))]"}]}, "osprofile": {"computername": "[concat('vm-r1","-",copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat('vm-r2","-",copyindex(1),"/","installwebserver')]", "location": "[parameters('location-r2')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[concat('vm-r2","-",copyindex(1))]", "location": "[parameters('location-r2')]", "zones": ["[copyindex(1)]"], "copy": {"name": "vmcopy", "count": 3}, "dependson": ["networkinterfacecopy"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstorageaccounttype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat('vm-r2","-", copyindex(1), "-networkinterface'))]"}]}, "osprofile": {"computername": "[concat('vm-r2","-",copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1),"/","installwebserver')]", "location": "[parameters('location-r1')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1),"/","installwebserver')]", "location": "[parameters('location-r1')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1))]", "location": "[parameters('location-r1')]", "zones": ["[copyindex(1)]"], "copy": {"name": "vmcopy", "count": 3}, "dependson": ["networkinterfacecopy"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstorageaccounttype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat('vm-r1","-", copyindex(1), "-networkinterface'))]"}]}, "osprofile": {"computername": "[concat('vm-r1","-",copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1),"/","installwebserver')]", "location": "[parameters('location-r1')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[concat('vm-r1","-",copyindex(1))]", "location": "[parameters('location-r1')]", "zones": ["[copyindex(1)]"], "copy": {"name": "vmcopy", "count": 3}, "dependson": ["networkinterfacecopy"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2019-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('vmstorageaccounttype')]"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat('vm-r1","-", copyindex(1), "-networkinterface'))]"}]}, "osprofile": {"computername": "[concat('vm-r1","-",copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-06-01", "name": "[concat('vm-r2","-",copyindex(1),"/","installwebserver')]", "location": "[parameters('location-r2')]", "copy": {"name": "extensioncopy", "count": 3}, "dependson": ["vmcopy"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.7", "autoupgrademinorversion": true, "settings": {"commandtoexecute": "powershell.exe install-windowsfeature -name web-server -includemanagementtools && powershell.exe remove-item "c:\\inetpub\\wwwroot\\iisstart.htm" && powershell.exe add-content -path "c:\\inetpub\\wwwroot\\iisstart.htm" -value $('hello world from " + $env:computername)"}}}
This template creates a data collection rule defining the data source (Syslog) and the destination workspace.
{"name": "[parameters('appinsightsname')]", "type": "microsoft.insights/components", "apiversion": "2018-05-01-preview", "location": "[parameters('location')]", "kind": "web", "tags": {"name": "[parameters('appinsightsname')]", "resource": "[parameters('apimservicename')]", "service": "application insights"}, "properties": {"application_type": "web", "request_source": "rest"}}
This template provides an example of how to create API Management service and configure all sub-entities
{"type": "microsoft.apimanagement/service/loggers", "name": "[concat(parameters('apimservicename'), "/", parameters('appinsightsname'))]", "apiversion": "2019-12-01", "dependson": ["[variables('apimid')]"], "properties": {"loggertype": "applicationinsights", "description": "logger resources to apim", "credentials": {"instrumentationkey": "[reference(variables('appinsightsid'), "2015-05-01').instrumentationkey]"}}}
This template provides an example of how to create API Management service and configure all sub-entities
{"type": "microsoft.apimanagement/service/loggers", "name": "[concat(parameters('apimservicename'), "/", parameters('appinsightsname'))]", "apiversion": "2019-12-01", "dependson": ["[variables('apimid')]"], "properties": {"loggertype": "applicationinsights", "description": "logger resources to apim", "credentials": {"instrumentationkey": "[reference(variables('appinsightsid'), "2015-05-01').instrumentationkey]"}}}{"name": "[parameters('apimservicename')]", "type": "microsoft.apimanagement/service", "apiversion": "2019-12-01", "location": "[parameters('location')]", "tags": {"name": "[parameters('apimservicename')]", "service": "apim"}, "sku": {"name": "[parameters('apimsku')]", "capacity": "[parameters('apimcapacity')]"}, "identity": {"type": "systemassigned"}, "dependson": ["[variables('vnetid')]"], "properties": {"publisheremail": "[parameters('apimpublisheremail')]", "publishername": "[parameters('apimpublishername')]", "virtualnetworktype": "external", "virtualnetworkconfiguration": {"subnetresourceid": "[variables('apimsubnetid')]"}}, "resources": [{"apiversion": "2019-12-01", "type": "products", "name": "custom", "dependson": ["[variables('apimid')]", "[variables('mockapiid')]", "[variables('postmanechoapiid')]"], "properties": {"displayname": "custom", "description": "subscribers have completely unlimited access to the api. administrator approval is required.", "subscriptionrequired": true, "approvalrequired": false, "subscriptionslimit": 1, "state": "published"}, "resources": [{"apiversion": "2019-12-01", "type": "apis", "name": "mockapi", "dependson": ["[variables('apimid')]", "[variables('mockapiid')]", "[variables('customproductid')]"], "properties": {"displayname": "mock api", "apirevision": "1", "description": "this is a mock api.", "subscriptionrequired": true, "path": "mock", "protocols": ["https", "http"], "subscriptionkeyparameternames": {"header": "ocp-apim-subscription-key", "query": "subscription-key"}, "iscurrent": true}}, {"apiversion": "2019-12-01", "type": "apis", "name": "postmanechoapi", "dependson": ["[variables('apimid')]", "[variables('postmanechoapiid')]", "[variables('customproductid')]"], "properties": {"displayname": "postman echo api", "apirevision": "1", "description": "this is the postman echo api.", "subscriptionrequired": true, "serviceurl": "https://postman-echo.com", "path": "postman-echo", "protocols": ["https", "http"], "subscriptionkeyparameternames": {"header": "ocp-apim-subscription-key", "query": "subscription-key"}, "iscurrent": true}}]}, {"type": "apis", "name": "mockapi", "apiversion": "2019-12-01", "dependson": ["[variables('apimid')]"], "properties": {"displayname": "mock api", "apirevision": "1", "description": "this is a mock api.", "subscriptionrequired": true, "path": "mock", "protocols": ["https", "http"], "subscriptionkeyparameternames": {"header": "ocp-apim-subscription-key", "query": "subscription-key"}, "iscurrent": true}, "resources": [{"type": "operations", "name": "test", "apiversion": "2019-12-01", "dependson": ["[variables('apimid')]", "[variables('mockapiid')]"], "properties": {"displayname": "test", "method": "get", "urltemplate": "/test", "description": "this method always return 200.", "responses": [{"statuscode": 200, "description": "the get mock methods always returns a given response", "representations": [{"contenttype": "application/json", "sample": "[concat(\"{"company": "contoso", "api": "mock api", "method": "get", "operation": "test"}\')]"}]}]}, "resources": [{"name": "policy", "type": "policies", "apiversion": "2019-12-01", "dependson": ["[variables('apimid')]", "[variables('mockapiid')]", "[variables('testmethodid')]"], "properties": {"value": "<policies>\r\n <inbound>\r\n <base />\r\n <mock-response status-code="200" content-type="application/json" />\r\n </inbound>\r\n <backend>\r\n <base />\r\n </backend>\r\n <outbound>\r\n <base />\r\n </outbound>\r\n <on-error>\r\n <base />\r\n </on-error>\r\n</policies>", "format": "xml"}}]}, {"apiversion": "2019-12-01", "type": "policies", "name": "policy", "dependson": ["[variables('apimid')]", "[variables('mockapiid')]"], "properties": {"format": "xml", "value": "<policies>\r\n\t<inbound>\r\n\t\t<base />\r\n\t\t<cors>\r\n\t\t\t<allowed-origins>\r\n\t\t\t\t<origin>*</origin>\r\n\t\t\t</allowed-origins>\r\n\t\t\t<allowed-methods>\r\n\t\t\t\t<method>get</method>\r\n\t\t\t\t<method>post</method>\r\n\t\t\t\t<method>put</method>\r\n\t\t\t\t<method>delete</method>\r\n\t\t\t\t<method>head</method>\r\n\t\t\t\t<method>options</method>\r\n\t\t\t\t<method>patch</method>\r\n\t\t\t\t<method>trace</method>\r\n\t\t\t</allowed-methods>\r\n\t\t\t<allowed-headers>\r\n\t\t\t\t<header>*</header>\r\n\t\t\t</allowed-headers>\r\n\t\t\t<expose-headers>\r\n\t\t\t\t<header>*</header>\r\n\t\t\t</expose-headers>\r\n\t\t</cors>\r\n\t</inbound>\r\n\t<backend>\r\n\t\t<base />\r\n\t</backend>\r\n\t<outbound>\r\n\t\t<base />\r\n\t</outbound>\r\n\t<on-error>\r\n\t\t<base />\r\n\t</on-error>\r\n</policies>"}}, {"type": "diagnostics", "name": "applicationinsights", "apiversion": "2019-12-01", "dependson": ["[variables('apimid')]", "[variables('loggerid')]", "[variables('mockapiid')]"], "properties": {"alwayslog": "allerrors", "loggerid": "[variables('loggerid')]", "sampling": {"samplingtype": "fixed", "percentage": 100}, "enablehttpcorrelationheaders": true}}]}, {"type": "apis", "name": "postmanechoapi", "apiversion": "2019-12-01", "dependson": ["[variables('apimid')]"], "properties": {"displayname": "postman echo api", "apirevision": "1", "description": "this is the postman echo api.", "subscriptionrequired": true, "serviceurl": "https://postman-echo.com", "path": "postman-echo", "protocols": ["https", "http"], "subscriptionkeyparameternames": {"header": "ocp-apim-subscription-key", "query": "subscription-key"}, "iscurrent": true}, "resources": [{"type": "operations", "name": "get", "apiversion": "2019-12-01", "dependson": ["[variables('apimid')]", "[variables('postmanechoapiid')]"], "properties": {"displayname": "get request", "method": "get", "urltemplate": "/get", "description": "the http get request method is meant to retrieve data from a server. the data is identified by a unique uri (uniform resource identifier). "}}, {"apiversion": "2019-12-01", "type": "policies", "name": "policy", "dependson": ["[variables('apimid')]", "[variables('postmanechoapiid')]"], "properties": {"format": "xml", "value": "<policies>\r\n\t<inbound>\r\n\t\t<base />\r\n\t\t<cors>\r\n\t\t\t<allowed-origins>\r\n\t\t\t\t<origin>*</origin>\r\n\t\t\t</allowed-origins>\r\n\t\t\t<allowed-methods>\r\n\t\t\t\t<method>get</method>\r\n\t\t\t\t<method>post</method>\r\n\t\t\t\t<method>put</method>\r\n\t\t\t\t<method>delete</method>\r\n\t\t\t\t<method>head</method>\r\n\t\t\t\t<method>options</method>\r\n\t\t\t\t<method>patch</method>\r\n\t\t\t\t<method>trace</method>\r\n\t\t\t</allowed-methods>\r\n\t\t\t<allowed-headers>\r\n\t\t\t\t<header>*</header>\r\n\t\t\t</allowed-headers>\r\n\t\t\t<expose-headers>\r\n\t\t\t\t<header>*</header>\r\n\t\t\t</expose-headers>\r\n\t\t</cors>\r\n\t</inbound>\r\n\t<backend>\r\n\t\t<base />\r\n\t</backend>\r\n\t<outbound>\r\n\t\t<base />\r\n\t</outbound>\r\n\t<on-error>\r\n\t\t<base />\r\n\t</on-error>\r\n</policies>"}}, {"type": "diagnostics", "name": "applicationinsights", "apiversion": "2019-12-01", "dependson": ["[variables('apimid')]", "[variables('loggerid')]", "[variables('postmanechoapiid')]"], "properties": {"alwayslog": "allerrors", "loggerid": "[variables('loggerid')]", "sampling": {"samplingtype": "fixed", "percentage": 100}, "enablehttpcorrelationheaders": true}}]}]}
This template uses Azure Managed Identity to assign access to Azure Maps. See more at https://aka.ms/amauth
{"condition": "[parameters('enabledeletelock')]", "type": "microsoft.authorization/locks", "apiversion": "2016-09-01", "scope": "[format('microsoft.network/networkwatchers/{0}", parameters('networkwatchername'))]", "name": "[variables('lockname')]", "properties": {"level": "cannotdelete"}, "dependson": ["[resourceid('microsoft.network/networkwatchers", parameters('networkwatchername'))]"]}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"name": "jumpbox", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-03-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"name": "jumpbox", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-03-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}{"name": "server", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-03-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "server", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"name": "jumpbox", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-03-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"name": "jumpbox", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"name": "jumpbox", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}{"name": "server", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "server", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "name": "[variables('storageaccountname')]", "apiversion": "2021-02-01", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storage", "properties": {}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"name": "jumpbox", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"name": "jumpbox", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "jumpbox", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('jumpboxnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}{"name": "server", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "osprofile": {"computername": "server", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('servernicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob]"}}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "name": "[variables('storageaccountname')]", "apiversion": "2021-02-01", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storage", "properties": {}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('imagesku')]", "version": "latest"}, "osdisk": {"caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('nicname'))]"}]}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"type": "microsoft.resources/deployments", "apiversion": "2020-06-01", "name": "deployflowlogs", "resourcegroup": "[parameters('networkwatcherresourcegroup')]", "properties": {"expressionevaluationoptions": {"scope": "inner"}, "mode": "incremental", "parameters": {"flowlogname": {"value": "[parameters('flowlogname')]"}, "location": {"value": "[parameters('location')]"}, "networkwatchername": {"value": "[parameters('networkwatchername')]"}, "existingnsgid": {"value": "[parameters('existingnsgid')]"}, "existingflowlogstorageaccountid": {"value": "[parameters('existingflowlogstorageaccountid')]"}, "loganalyticsworkspaceid": {"value": "[parameters('loganalyticsworkspaceid')]"}}, "template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymenttemplate.json#", "contentversion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": "0.4.1008.15138", "templatehash": "4407055582915177902"}}, "parameters": {"flowlogname": {"type": "string", "metadata": {"description": "flow log name"}}, "location": {"type": "string", "metadata": {"description": "flow log location"}}, "networkwatchername": {"type": "string", "metadata": {"description": "network watcher name"}}, "existingnsgid": {"type": "string", "metadata": {"description": "network security group resource id"}}, "existingflowlogstorageaccountid": {"type": "string", "metadata": {"description": "storage account resource id"}}, "loganalyticsworkspaceid": {"type": "string", "defaultvalue": "", "metadata": {"description": "log analytics workspace resource id"}}}, "functions": [], "variables": {"flowlogsstorageretention": 60}, "resources": [{"type": "microsoft.network/networkwatchers/flowlogs", "apiversion": "2021-02-01", "name": "[format('{0}/{1}", parameters('networkwatchername'), parameters('flowlogname'))]", "location": "[parameters('location')]", "properties": {"enabled": true, "flowanalyticsconfiguration": {"networkwatcherflowanalyticsconfiguration": {"enabled": "[if(empty(parameters('loganalyticsworkspaceid')), false(), true())]", "trafficanalyticsinterval": 60, "workspaceresourceid": "[if(empty(parameters('loganalyticsworkspaceid')), null(), parameters('loganalyticsworkspaceid'))]"}}, "format": {"type": "json", "version": 2}, "retentionpolicy": {"days": "[variables('flowlogsstorageretention')]", "enabled": true}, "storageid": "[parameters('existingflowlogstorageaccountid')]", "targetresourceid": "[parameters('existingnsgid')]"}}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"comments": "vm1", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[variables('vm1name')]", "location": "[variables('location1')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nic1name'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vm1name')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagereference').publisher]", "offer": "[variables('imagereference').offer]", "sku": "[variables('imagereference').sku]", "version": "[variables('imagereference').version]"}, "osdisk": {"name": "[concat(variables('vm1name'),"-osdisk')]", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nic1name'))]"}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"comments": "vm1", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[variables('vm1name')]", "location": "[variables('location1')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nic1name'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vm1name')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagereference').publisher]", "offer": "[variables('imagereference').offer]", "sku": "[variables('imagereference').sku]", "version": "[variables('imagereference').version]"}, "osdisk": {"name": "[concat(variables('vm1name'),"-osdisk')]", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nic1name'))]"}]}}}{"comments": "vm2", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[variables('vm2name')]", "location": "[variables('location2')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nic2name'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vm2name')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagereference').publisher]", "offer": "[variables('imagereference').offer]", "sku": "[variables('imagereference').sku]", "version": "[variables('imagereference').version]"}, "osdisk": {"name": "[concat(variables('vm2name'),"-osdisk')]", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nic2name'))]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"comments": "vm1", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[variables('vm1name')]", "location": "[variables('location1')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nic1name'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vm1name')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagereference').publisher]", "offer": "[variables('imagereference').offer]", "sku": "[variables('imagereference').sku]", "version": "[variables('imagereference').version]"}, "osdisk": {"name": "[concat(variables('vm1name'),"-osdisk')]", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nic1name'))]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"comments": "vm1", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[variables('vm1name')]", "location": "[variables('location1')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nic1name'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vm1name')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagereference').publisher]", "offer": "[variables('imagereference').offer]", "sku": "[variables('imagereference').sku]", "version": "[variables('imagereference').version]"}, "osdisk": {"name": "[concat(variables('vm1name'),"-osdisk')]", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nic1name'))]"}]}}}{"comments": "vm2", "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[variables('vm2name')]", "location": "[variables('location2')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nic2name'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vm2name')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagereference').publisher]", "offer": "[variables('imagereference').offer]", "sku": "[variables('imagereference').sku]", "version": "[variables('imagereference').version]"}, "osdisk": {"name": "[concat(variables('vm2name'),"-osdisk')]", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nic2name'))]"}]}}}
This template creates a data collection rule defining the data source (Syslog) and the destination workspace.
{"condition": "[parameters('enablediagnostics')]", "type": "microsoft.insights/diagnosticsettings", "apiversion": "2021-05-01-preview", "scope": "[format('microsoft.network/networksecuritygroups/{0}", parameters('nsgname'))]", "name": "[variables('diagnosticsname')]", "properties": {"workspaceid": "[if(empty(parameters('loganalyticsworkspaceid')), null(), parameters('loganalyticsworkspaceid'))]", "storageaccountid": "[if(empty(parameters('diagnosticstorageaccountid')), null(), parameters('diagnosticstorageaccountid'))]", "logs": [{"category": "networksecuritygroupevent", "enabled": true}, {"category": "networksecuritygrouprulecounter", "enabled": true}]}, "dependson": ["[resourceid('microsoft.network/networksecuritygroups", parameters('nsgname'))]"]}
This template uses Azure Managed Identity to assign access to Azure Maps. See more at https://aka.ms/amauth
{"condition": "[parameters('enabledeletelock')]", "type": "microsoft.authorization/locks", "apiversion": "2017-04-01", "scope": "[format('microsoft.network/networksecuritygroups/{0}", parameters('nsgname'))]", "name": "[variables('lockname')]", "properties": {"level": "cannotdelete"}, "dependson": ["[resourceid('microsoft.network/networksecuritygroups", parameters('nsgname'))]"]}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/dependencyagent')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]", "[variables('dnsomsagentforlinuxid')]"], "properties": {"publisher": "microsoft.azure.monitoring.dependencyagent", "type": "dependencyagentlinux", "typehandlerversion": "9.10", "autoupgrademinorversion": true}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/dependencyagent')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]", "[variables('dnsomsagentforlinuxid')]"], "properties": {"publisher": "microsoft.azure.monitoring.dependencyagent", "type": "dependencyagentlinux", "typehandlerversion": "9.10", "autoupgrademinorversion": true}}{"apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines", "name": "[parameters('devvmname')]", "location": "[parameters('location')]", "identity": {"type": "systemassigned"}, "dependson": ["[variables('adlsstorageaccountadlsprivateendpointid')]", "[variables('adlsstorageaccountblobprivateendpointid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('devvmnicid')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('devvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('devvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('devvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('devvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/dependencyagent')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]", "[variables('dnsomsagentforlinuxid')]"], "properties": {"publisher": "microsoft.azure.monitoring.dependencyagent", "type": "dependencyagentlinux", "typehandlerversion": "9.10", "autoupgrademinorversion": true}}{"apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines", "name": "[parameters('devvmname')]", "location": "[parameters('location')]", "identity": {"type": "systemassigned"}, "dependson": ["[variables('adlsstorageaccountadlsprivateendpointid')]", "[variables('adlsstorageaccountblobprivateendpointid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('devvmnicid')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('devvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('devvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('devvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('devvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('devvmname'), "/customscript')]", "location": "[parameters('location')]", "dependson": ["[variables('devvmid')]", "[variables('devcontributorroleassignmentid')]", "[variables('devstorageblobdatacontributorroleassignmentid')]", "[variables('firewallpolicydefaultnetworkrulecollectiongroupid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.1", "autoupgrademinorversion": true, "settings": {"skipdos2unix": false, "timestamp": 123456789, "fileuris": ["[variables('testvmscriptfileuri')]"]}, "protectedsettings": {"commandtoexecute": "[concat('bash ", variables('testvmscriptfilename'), " ", parameters('privatednszonename'), " ", parameters('devvmname'), " ", parameters('prodvmname'), " ", variables('adlsserviceprimaryendpoint'), " ", variables('blobserviceprimaryendpoint'))]"}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/dependencyagent')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]", "[variables('dnsomsagentforlinuxid')]"], "properties": {"publisher": "microsoft.azure.monitoring.dependencyagent", "type": "dependencyagentlinux", "typehandlerversion": "9.10", "autoupgrademinorversion": true}}{"apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines", "name": "[parameters('devvmname')]", "location": "[parameters('location')]", "identity": {"type": "systemassigned"}, "dependson": ["[variables('adlsstorageaccountadlsprivateendpointid')]", "[variables('adlsstorageaccountblobprivateendpointid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('devvmnicid')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('devvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('devvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('devvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('devvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('devvmname'), "/customscript')]", "location": "[parameters('location')]", "dependson": ["[variables('devvmid')]", "[variables('devcontributorroleassignmentid')]", "[variables('devstorageblobdatacontributorroleassignmentid')]", "[variables('firewallpolicydefaultnetworkrulecollectiongroupid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.1", "autoupgrademinorversion": true, "settings": {"skipdos2unix": false, "timestamp": 123456789, "fileuris": ["[variables('testvmscriptfileuri')]"]}, "protectedsettings": {"commandtoexecute": "[concat('bash ", variables('testvmscriptfilename'), " ", parameters('privatednszonename'), " ", parameters('devvmname'), " ", parameters('prodvmname'), " ", variables('adlsserviceprimaryendpoint'), " ", variables('blobserviceprimaryendpoint'))]"}}}{"apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('devvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('devvmid')]", "[variables('workspaceid')]", "[variables('devcustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"apiversion": "2021-01-01", "type": "microsoft.storage/storageaccounts", "name": "[parameters('adlsstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_ragrs"}, "kind": "storagev2", "properties": {"networkacls": {"defaultaction": "[parameters('adlsstorageaccountnetworkaclsdefaultaction')]", "bypass": "azureservices"}, "allowblobpublicaccess": "[parameters('adlsstorageaccountallowblobpublicaccess')]"}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"apiversion": "2021-01-01", "type": "microsoft.storage/storageaccounts", "name": "[parameters('adlsstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_ragrs"}, "kind": "storagev2", "properties": {"networkacls": {"defaultaction": "[parameters('adlsstorageaccountnetworkaclsdefaultaction')]", "bypass": "azureservices"}, "allowblobpublicaccess": "[parameters('adlsstorageaccountallowblobpublicaccess')]"}}{"apiversion": "2021-01-01", "type": "microsoft.storage/storageaccounts", "name": "[parameters('blobstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storagev2", "properties": {"networkacls": {"defaultaction": "[parameters('blobstorageaccountnetworkaclsdefaultaction')]", "bypass": "azureservices"}, "allowblobpublicaccess": "[parameters('blobstorageaccountallowblobpublicaccess')]"}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}