Description
stringlengths
21
168
IaC
stringlengths
158
8.06k
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)"}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "name": "[variables('storageaccountname')]", "apiversion": "2020-08-01-preview", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}, "kind": "storagev2", "properties": {}}
Create a web app on Azure with Java 13 and Tomcat 9 enabled.
{"apiversion": "2020-06-01", "name": "[parameters('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "tags": {"displayname": "hostingplan"}, "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('skucapacity')]"}, "properties": {"name": "[parameters('hostingplanname')]"}}{"apiversion": "2020-06-01", "name": "[parameters('websitename')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "tags": {"[concat('hidden-related:", resourcegroup().id, "/providers/microsoft.web/serverfarms/", parameters('hostingplanname'))]": "resource", "displayname": "website"}, "dependson": ["[resourceid('microsoft.web/serverfarms/", parameters('hostingplanname'))]"], "properties": {"name": "[parameters('websitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('hostingplanname'))]"}, "resources": [{"apiversion": "2020-06-01", "name": "web", "type": "config", "dependson": ["[resourceid('microsoft.web/sites/", parameters('websitename'))]"], "properties": {"javaversion": "1.8", "javacontainer": "tomcat", "javacontainerversion": "9.0"}}]}
Establish connection to a VNET via an ExpressRoute circuit
{"name": "master-publicip", "type": "microsoft.network/publicipaddresses", "apiversion": "2019-11-01", "location": "[parameters('location')]", "tags": {"displayname": "publicipaddress"}, "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[parameters('jenkins-dns')]"}}}{"name": "master-nsg", "type": "microsoft.network/networksecuritygroups", "apiversion": "2019-11-01", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "nsgrule1", "properties": {"description": "ssh access to master", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}, {"name": "nsgrule2", "properties": {"description": "http access to master", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "8080", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 200, "direction": "inbound"}}]}}{"name": "jenkins-cluster-virtualnetwork", "type": "microsoft.network/virtualnetworks", "apiversion": "2019-11-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", "master-nsg')]"], "tags": {"displayname": "jenkins-virtualnetwork"}, "properties": {"addressspace": {"addressprefixes": ["[variables('netiprange')]"]}, "subnets": [{"name": "jenkins-virtualnetwork-subnet", "properties": {"addressprefix": "[variables('subnetrange')]"}}]}}{"name": "master-networkinterface", "type": "microsoft.network/networkinterfaces", "apiversion": "2019-11-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", "master-publicip')]", "[resourceid('microsoft.network/virtualnetworks", "jenkins-cluster-virtualnetwork')]", "[resourceid('microsoft.network/networksecuritygroups","master-nsg')]"], "tags": {"displayname": "jenkins-master-networkinterface"}, "properties": {"networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups","master-nsg')]"}, "ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "static", "privateipaddress": "10.0.1.10", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", "master-publicip')]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", "jenkins-cluster-virtualnetwork", "jenkins-virtualnetwork-subnet')]"}}}]}}{"name": "node-1-publicip", "type": "microsoft.network/publicipaddresses", "apiversion": "2019-11-01", "location": "[parameters('location')]", "tags": {"displayname": "publicipaddress"}, "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[concat('node-1-",parameters('jenkins-dns'))]"}}}{"name": "node-1-nsg", "type": "microsoft.network/networksecuritygroups", "apiversion": "2019-11-01", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "nsgrule1", "properties": {"description": "ssh allow", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}}{"name": "node-1-networkinterface", "type": "microsoft.network/networkinterfaces", "apiversion": "2019-11-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", "node-1-publicip')]", "[resourceid('microsoft.network/virtualnetworks", "jenkins-cluster-virtualnetwork')]", "[resourceid('microsoft.network/networksecuritygroups","node-1-nsg')]"], "tags": {"displayname": "node-1-networkinterface"}, "properties": {"networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups","node-1-nsg')]"}, "ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "static", "privateipaddress": "10.0.1.11", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", "node-1-publicip')]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", "jenkins-cluster-virtualnetwork", "jenkins-virtualnetwork-subnet')]"}}}]}}{"name": "node-2-publicip", "type": "microsoft.network/publicipaddresses", "apiversion": "2019-11-01", "location": "[parameters('location')]", "tags": {"displayname": "publicipaddress"}, "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[concat('node-2-",parameters('jenkins-dns'))]"}}}
Network Security Group with diagnostic logs
{"type": "microsoft.network/networksecuritygroups", "apiversion": "2021-02-01", "name": "[parameters('nsgname')]", "location": "[parameters('location')]", "properties": {"copy": [{"name": "securityrules", "count": "[length(parameters('securityrules'))]", "input": {"name": "[parameters('securityrules')[copyindex('securityrules')].name]", "properties": "[parameters('securityrules')[copyindex('securityrules')].properties]"}}]}}
This template creates a metric alert rule that monitors the CPU Percentage metric of a virtual machine using a dynamic threshold condition type.
{"name": "[parameters('alertname')]", "type": "microsoft.insights/metricalerts", "location": "global", "apiversion": "2018-03-01", "properties": {"description": "[parameters('alertdescription')]", "severity": "[parameters('alertseverity')]", "enabled": "[parameters('isenabled')]", "scopes": ["[parameters('resourceid')]"], "evaluationfrequency": "[parameters('evaluationfrequency')]", "windowsize": "[parameters('windowsize')]", "criteria": {"odata.type": "microsoft.azure.monitor.multipleresourcemultiplemetriccriteria", "allof": [{"criteriontype": "dynamicthresholdcriterion", "name": "1st criterion", "metricname": "[parameters('metricname')]", "operator": "[parameters('operator')]", "alertsensitivity": "[parameters('alertsensitivity')]", "failingperiods": {"numberofevaluationperiods": "[parameters('numberofevaluationperiods')]", "minfailingperiodstoalert": "[parameters('minfailingperiodstoalert')]"}, "ignoredatabefore": "[parameters('ignoredatabefore')]", "timeaggregation": "[parameters('timeaggregation')]"}]}}}
Create an Azure Automation account and create a new Azure Monitor Log Analytics workspace if it doesn't exist, and then link them together.
{"type": "microsoft.automation/automationaccounts", "apiversion": "2021-04-01", "location": "[parameters('location')]", "name": "[parameters('automationaccountname')]", "tags": {"arotoolkitversion": "[variables('arotoolkitversion')]"}, "comments": "automation account", "properties": {"sku": {"name": "basic"}}}{"type": "microsoft.automation/automationaccounts/variables", "apiversion": "2021-04-01", "name": "[concat(parameters('automationaccountname'), "/", variables('automationvariables')[copyindex()].name)]", "dependson": ["[resourceid('microsoft.automation/automationaccounts", parameters('automationaccountname'))]"], "copy": {"name": "variableloop", "count": "[length(variables('automationvariables'))]"}, "properties": {"description": "[variables('automationvariables')[copyindex()].description]", "value": "[variables('automationvariables')[copyindex()].value]"}}{"type": "microsoft.automation/automationaccounts/variables", "apiversion": "2021-04-01", "name": "[concat(parameters('automationaccountname'), "/", variables('internalazuresubscriptionid').name)]", "dependson": ["[resourceid('microsoft.automation/automationaccounts", parameters('automationaccountname'))]"], "properties": {"description": "[variables('internalazuresubscriptionid').description]", "isencrypted": true, "type": "string", "value": "[variables('internalazuresubscriptionid').value]"}}{"name": "[concat(parameters('automationaccountname'), "/", variables('azurecredentials'))]", "type": "microsoft.automation/automationaccounts/credentials", "apiversion": "2021-04-01", "dependson": ["[resourceid('microsoft.automation/automationaccounts", parameters('automationaccountname'))]"], "properties": {"description": "azure subscription credentials", "password": "[parameters('azureadminpwd')]", "username": "[parameters('azureadmin')]"}}{"comments": "provision the azurerm.profile module first since others are depenedent on it", "name": "[concat(parameters('automationaccountname'), "/", variables('azurerm.profile').name)]", "type": "microsoft.automation/automationaccounts/modules", "apiversion": "2021-04-01", "dependson": ["[resourceid('microsoft.automation/automationaccounts", parameters('automationaccountname'))]"], "properties": {"contentlink": {"uri": "[variables('azurerm.profile').url]"}}}{"name": "[concat(parameters('automationaccountname'), "/", variables('psmodules')[copyindex()].name)]", "type": "microsoft.automation/automationaccounts/modules", "apiversion": "2021-04-01", "dependson": ["[resourceid('microsoft.automation/automationaccounts", parameters('automationaccountname'))]", "[variables('azurerm.profile').name]"], "copy": {"name": "modulesloop", "count": "[length(variables('psmodules'))]"}, "properties": {"contentlink": {"uri": "[variables('psmodules')[copyindex()].url]"}}}{"name": "[concat(parameters('automationaccountname'), "/", variables('runbooks')[copyindex()].name)]", "type": "microsoft.automation/automationaccounts/runbooks", "apiversion": "2020-01-13-preview", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.automation/automationaccounts", parameters('automationaccountname'))]", "[variables('azurerm.profile').name]", "modulesloop"], "tags": {"version": "[variables('runbooks')[copyindex()].version]"}, "copy": {"name": "runbooksloop", "count": "[length(variables('runbooks'))]"}, "properties": {"runbooktype": "[variables('runbooks')[copyindex()].type]", "logprogress": false, "logverbose": false, "description": "[variables('runbooks')[copyindex()].description]", "publishcontentlink": {"uri": "[variables('runbooks')[copyindex()].scripturi]", "version": "[variables('runbooks')[copyindex()].version]"}}}{"name": "[concat(parameters('automationaccountname'), "/", "startbootstrap')]", "type": "microsoft.automation/automationaccounts/schedules", "apiversion": "2021-04-01", "dependson": ["[resourceid('microsoft.automation/automationaccounts", parameters('automationaccountname'))]", "[variables('runbooks')[0].name]"], "properties": {"description": "starts the bootstrap runbooks", "expirytime": "9999-12-31t17:59:00-06:00", "isenabled": true, "frequency": "onetime"}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2019-07-01", "name": "[variables('vmnames')[copyindex()]]", "location": "[parameters('location')]", "copy": {"name": "vmloop", "count": 3}, "dependson": ["nicloop"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('vmnames')[copyindex()]]", "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": "[parameters('freebsdosversion')]", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('nicconfig')[mul(copyindex(),2)].name)]", "properties": {"primary": true}}, {"id": "[resourceid('microsoft.network/networkinterfaces", variables('nicconfig')[add(mul(copyindex(),2),1)].name)]", "properties": {"primary": false}}]}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2019-07-01", "name": "[variables('vmnamesql')]", "location": "[parameters('location')]", "dependson": ["nicloop"], "properties": {"hardwareprofile": {"vmsize": "[parameters('postgresqlvmsize')]"}, "osprofile": {"computername": "[variables('vmnamesql')]", "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": "[parameters('freebsdosversion')]", "version": "latest"}, "osdisk": {"createoption": "fromimage"}, "copy": [{"name": "datadisks", "count": "[parameters('numberofdatadisks')]", "input": {"disksizegb": "[parameters('sizeofdatadisksingb')]", "lun": "[copyindex('datadisks')]", "caching": "[parameters('diskcaching')]", "createoption": "empty"}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('vmnamesql'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2019-07-01", "name": "[concat(variables('vmnames')[copyindex()], "/installnginx')]", "location": "[parameters('location')]", "dependson": ["vmloop"], "copy": {"name": "extloop", "count": 3}, "properties": {"publisher": "microsoft.ostcextensions", "type": "customscriptforlinux", "typehandlerversion": "1.4", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('scripts/install_reverse_nginx.sh", parameters('_artifactslocationsastoken')))]", "[uri(parameters('_artifactslocation'), concat('scripts/install_nginx_php.sh", parameters('_artifactslocationsastoken')))]", "[uri(parameters('_artifactslocation'), concat('conf/frontend_nginx.conf", parameters('_artifactslocationsastoken')))]", "[uri(parameters('_artifactslocation'), concat('conf/frontend_proxy.conf", parameters('_artifactslocationsastoken')))]", "[uri(parameters('_artifactslocation'), concat('conf/backend_nginx.conf", parameters('_artifactslocationsastoken')))]"]}}}
This template creates a disk, backup vault, backup policy, grants necessary permission and enables protection
{"type": "microsoft.dataprotection/backupvaults", "apiversion": "2021-01-01", "name": "[parameters('vaultname')]", "location": "[parameters('location')]", "identity": {"type": "systemassigned"}, "properties": {"storagesettings": [{"datastoretype": "vaultstore", "type": "[parameters('vaultstorageredundancy')]"}]}}{"type": "microsoft.dataprotection/backupvaults/backuppolicies", "apiversion": "2021-01-01", "name": "[format('{0}/{1}", parameters('vaultname'), parameters('backuppolicyname'))]", "properties": {"policyrules": [{"backupparameters": {"backuptype": "incremental", "objecttype": "azurebackupparams"}, "trigger": {"schedule": {"repeatingtimeintervals": ["[variables('repeatingtimeinterval')]"], "timezone": "utc"}, "taggingcriteria": [{"taginfo": {"tagname": "default", "id": "default_"}, "taggingpriority": 99, "isdefault": true}], "objecttype": "schedulebasedtriggercontext"}, "datastore": {"datastoretype": "operationalstore", "objecttype": "datastoreinfobase"}, "name": "backuphourly", "objecttype": "azurebackuprule"}, {"lifecycles": [{"sourcedatastore": {"datastoretype": "operationalstore", "objecttype": "datastoreinfobase"}, "deleteafter": {"objecttype": "absolutedeleteoption", "duration": "[variables('retentionduration')]"}}], "isdefault": true, "name": "default", "objecttype": "azureretentionrule", "ruletype": "retention"}], "datasourcetypes": ["[variables('datasourcetype')]"], "objecttype": "backuppolicy"}, "dependson": ["[resourceid('microsoft.dataprotection/backupvaults", parameters('vaultname'))]"]}{"type": "microsoft.dataprotection/backupvaults/backupinstances", "apiversion": "2021-01-01", "name": "[format('{0}/{1}", parameters('vaultname'), parameters('diskname'))]", "properties": {"objecttype": "backupinstance", "datasourceinfo": {"objecttype": "datasource", "resourceid": "[resourceid('microsoft.compute/disks", parameters('diskname'))]", "resourcename": "[parameters('diskname')]", "resourcetype": "[variables('resourcetype')]", "resourceuri": "[resourceid('microsoft.compute/disks", parameters('diskname'))]", "resourcelocation": "[parameters('location')]", "datasourcetype": "[variables('datasourcetype')]"}, "policyinfo": {"policyid": "[resourceid('microsoft.dataprotection/backupvaults/backuppolicies", parameters('vaultname'), parameters('backuppolicyname'))]", "name": "[parameters('backuppolicyname')]", "policyparameters": {"datastoreparameterslist": [{"objecttype": "azureoperationalstoreparameters", "datastoretype": "operationalstore", "resourcegroupid": "[resourcegroup().id]"}]}}}, "dependson": ["[resourceid('microsoft.dataprotection/backupvaults/backuppolicies", parameters('vaultname'), parameters('backuppolicyname'))]", "[resourceid('microsoft.dataprotection/backupvaults", parameters('vaultname'))]", "[resourceid('microsoft.compute/disks", parameters('diskname'))]", "[resourceid('microsoft.authorization/roleassignments", variables('rolenameguidfordisk'))]", "[resourceid('microsoft.authorization/roleassignments", variables('rolenameguidforsnapshotrg'))]"]}
This template deploys a linux VM with an MSI that has access to a storage account in a different resource group.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2019-03-01", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces/", variables('networkinterfacename'))]"], "identity": {"type": "systemassigned"}, "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": {"osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('osdisktype')]"}}, "imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "[parameters('ubuntuosversion')]", "version": "latest"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]"}]}}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2020-06-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforpublicip')]"}}}{"comments": "default network security group for template", "type": "microsoft.network/networksecuritygroups", "apiversion": "2019-08-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "default-allow-3389", "properties": {"priority": 1000, "access": "allow", "direction": "inbound", "destinationportrange": "3389", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}]}}{"apiversion": "2020-06-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"], "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}{"apiversion": "2020-06-01", "type": "microsoft.network/networkinterfaces", "name": "[variables('nicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]", "[resourceid('microsoft.network/virtualnetworks", variables('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname'))]"}, "subnet": {"id": "[variables('subnetref')]"}}}]}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2019-07-01", "type": "microsoft.compute/virtualmachinescalesets", "location": "[variables('location')]", "name": "[concat(variables('agentvmnameprefix'), "-vmss')]", "sku": {"capacity": "[variables('agentcount')]", "name": "[variables('agentvmsize')]", "tier": "standard"}, "tags": {"creationsource": "[concat('acsengine-", variables('agentvmnameprefix'), "-vmss')]"}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('masterpublicipaddressname'))]", "[variables('virtualnetworkname')]", "[resourceid('microsoft.network/loadbalancers", variables('agentlbname'))]"], "properties": {"upgradepolicy": {"mode": "automatic"}, "virtualmachineprofile": {"networkprofile": {"networkinterfaceconfigurations": [{"name": "nic", "properties": {"ipconfigurations": [{"name": "nicipconfig", "properties": {"loadbalancerbackendaddresspools": [{"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('agentlbname'), variables('agentlbbackendpoolname'))]"}], "subnet": {"id": "[variables('agentvnetsubnetid')]"}}}], "primary": true}}]}, "osprofile": {"adminusername": "[variables('adminusername')]", "computernameprefix": "[variables('agentvmnameprefix')]", "customdata": "[base64(concat(\"#cloud-config\n\nwrite_files:\n - encoding: gzip\n content: !!binary |\n h4siackuqlkaa81zbxpbnhl+zl+xptw1nyaipdsxoweug8dwlp6rly9kd24uawoihczwfkeqogsfq/9+u3ihsfmk3tazowuskuac++wunt0fs/ndoeqycmtkxpn2/vzp24ejky2t6ylnmfywfaqniubqzzi8fbcecvxmegljjhvluwlqwmes0lqskuwaijgdiyxnsqjgamciuuf55rzxrwhj9vbl/smtiudyfzhdm6x+gkge5aqcw8/j0usaj6hzrugrwqk0io0i3ljovciy34uz4t5maspjx/2jf/ugn476p+f9ye/tz73b8kr/1vxbzxan2flrcngkc5azktcm1egchg4veooj/uxzrbdx317agfnb793jv3gk40benqygf4fhxwmcflh0dv9zoehddnv0+opsqxgxj2co8nnpw6pbyfnf5eae37xcem8ph73h5duzhq3/t6x38+nz4wmvezurumui6opglk/f4kpx2icniwg/g+qx7mqw+ezdr63g77983puglz983h/wcd+2w12aa5fumftxr5y9/8xod3ntce51rhenfjk6gebfix5d4jzn4+s2fdgk12tejblucbjheslxos6jzqdk94ed64adg8wlffscnh16sk5x5vh8uxpwr8sa4dvy3t/irs2y6vrk8k7iitptg/c4oiytsmtd/+i/z1wtrh6zt+/dewa7yf5p+mxmfda/el/a5/ecpwpy123j0fjkkcbp4b7dxc27fa2xwggaxtxrox/gfb5mrzrcrknzqujz5lqjbnzcyrg+qomfepdp0ijf9bgqzvqngxf7cyzmwojzdbuwwuymqriv3aquawvzyeo/qiwyyczgylcyo5yzg30/tvrfppzpoe1rxjhxpieyrgmctfwgcgl4o7pmkkfyobcrmenczjnfesekcpmwa2zwu00uddylqxyx8gojriydneurzvmtotnahad0bjd8v0fiwwqcpufp1nna6ch0luwfj9fya6m8932baq8qdseeluhtmmdstlvm1/mrdls4vcaluok5v0weafmxp5jxx9oody5a6nntpjrfai9gjcirs1xs93aaqtpfcqxs4ro1vevqwzx1eq0va89mntbajqdaj+faa37jfpupl437tty83jwftsj0szu8hrmfjs+g24rtom24ajujncppeqtqhopgioqqcimq8qfe1hhinkzzngxry8voizfdin0c0lozivbzvweebsjqzg6tp9pa5qmx8cpeystyuwaxzrdqfvrag2dbeqxhu+2xehzubzohs8ziolsza0wul8nkyvdncczq26zzwxcslkiictfg2vd0zlz0viika+7btoxihhbmu4gmsn+cmadslp3vl2fyfk08dthjvc3ftndkdhxbaty8pdyv++addqkydtg9izmcgpnzevio+tgn7tw0zkq88ytizdgz7hpsh+guu+ttbmvreqyhnrevxsjejoavavicrowiqm8xfe2tqf2bpvkgsylhkcbcgomsuiauwxilklzwwbsec5ahezgvspcywk69paqr7bqxfbgancbavvseaaddtcewklk+cpg10c/vquvu0vtn/cfygkmeboe3gpdhzzocfoo5z/mk5k0iyk6l/nb4bgbx/wtg10llr8u2r7sgi+g3jfqijswisgatdsmdisx5ypnkescxwspyhdy2hwzsxmbodk4ku1pkvxk7vsipu7rsebg0ejm36xuwu67gw7dcne+iczh8h9thtdq5weytskww6bgw8q59abaasxzyl2iju964lnor3rfsy05ydtaan41t7b1erdar1u2wymbiq0ajdqo1mqm/alyqipbygra/2hrxtg5vyfyakr2yx++exerfxkm3/bd4ruxxhstd7jgxkxluxhsoks9yqtur/9ftv7e5jyp7ntc0yl9wdnc2f8ge7xu1jctxhkfrdr1i2kiu7dcdlarjfep07dhqlo2o1hlawcbgmwzilwawon4vgnuvfnofsverfdi1zqueiy7r4fb4hhz9gbp8zmlbqojemmniwhn+e7ivsxhd/leupnqsagucyfouxa3puv62n4fr5yljeawjy37bjyxbfm/swedg6am731qk4znchogjmjprqax7zny/tu4abx9e7osgtb4irthtmpbu7dbselmowupvwwxwvmgy+t0auiwiksjsontvrjamr4pcqso37drtrufooq8mqw1mvs0c6+y18bti88rlfn3s2h5yec/mhexi22jbjsq9q7zqwr9gqlxwjdheox3cbbn7dljnwzfhr+dgthhag+/ctq7bvu1g5it+xp/sme8rseoudh3nlenzkektdqdi7bxnz5sd2lxhif2nlxxug5qe08cf080ql6vraff3blkhwttkosihevjp/nzmzs/y8suc/ap8plnyly6pu/fjnkxtsljrq9qrafdkytxavinq8kv7/1fmvvhlsf01ntmdgkzs+ogl32f9inebjbavo68jtq3tgk8e+lwftm6s6izqi/eyuubfm+zpvkz5mlnkrfk/a3sa8gvncaf15o54m9jfksctylbr8eanodek4jpk9i0ltj/xg5eqsqqczqicane2uq46b75vw/fmy4kxs+wc6jze0u4krbpifjlxx+enmdwtkvci/pgp+nak6zhm50lcdh5j2r32i1og1zusmrgrxjnojru4lsefoohaqili4dkkvqpkpmjdffs+zbu4utnnes+dofqxcp74h9dolc7tgqaa\n path: /opt/azure/containers/configure-swarmmode-cluster.sh\n permissions: "0744"\n\n\",variables(\"agentruncmdfile\'),variables(\"agentruncmd\')))]", "linuxconfiguration": {"disablepasswordauthentication": true, "ssh": {"publickeys": [{"keydata": "[parameters('sshrsapublickey')]", "path": "[variables('sshkeypath')]"}]}}}, "storageprofile": {"imagereference": {"offer": "[variables('osimageoffer')]", "publisher": "[variables('osimagepublisher')]", "sku": "[variables('osimagesku')]", "version": "latest"}, "osdisk": {"caching": "readwrite", "createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('agentdisktype')]"}}}}}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2020-11-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforpublicip')]"}}}{"apiversion": "2018-08-01", "type": "microsoft.network/networksecuritygroups", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "ssh", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 132, "direction": "inbound"}}, {"name": "http", "properties": {"provisioningstate": "succeeded", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "80", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 131, "direction": "inbound"}}, {"name": "https", "properties": {"provisioningstate": "succeeded", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "443", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 130, "direction": "inbound"}}, {"name": "goaccesssocket", "properties": {"provisioningstate": "succeeded", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "8080", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 129, "direction": "inbound"}}]}}{"apiversion": "2018-08-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]"}}]}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines", "name": "[concat('mastervm", copyindex())]", "location": "[parameters('location')]", "copy": {"name": "virtualmachineloopmaster", "count": "[variables('numberofmasterinstances')]"}, "dependson": ["[resourceid('microsoft.resources/deployments/", "shared-resources')]", "[resourceid('microsoft.network/networkinterfaces/", concat('nic", copyindex()))]"], "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets", "sparkcluseras')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[concat(variables('computernameprefix'), copyindex())]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "linuxconfiguration": {"disablepasswordauthentication": false}}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat('mastervm", copyindex(),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat('nic", copyindex()))]"}]}}}{"apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines", "name": "[concat('slavevm", copyindex())]", "location": "[parameters('location')]", "copy": {"name": "virtualmachineloop", "count": "[variables('numberofslavesinstances')]"}, "dependson": ["[resourceid('microsoft.resources/deployments/", "shared-resources')]", "[resourceid('microsoft.network/networkinterfaces/", concat('nicsl", copyindex()))]", "virtualmachineloopmaster"], "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets", "sparkcluseras')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[concat(variables('computernameprefix'),"sl", copyindex())]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "linuxconfiguration": {"disablepasswordauthentication": false}}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat('slavevm", copyindex(),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat('nicsl", copyindex()))]"}]}}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2020-07-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnslabelprefix')]"}}}{"apiversion": "2020-07-01", "type": "microsoft.network/networksecuritygroups", "name": "[variables('frontendnsgname')]", "location": "[parameters('location')]", "tags": {"displayname": "custom network security group"}, "properties": {"securityrules": [{"name": "default-allow-ssh", "properties": {"description": "allow ssh", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 1000, "direction": "inbound"}}, {"name": "default-allow-tomcat", "properties": {"description": "allow web/tomcat", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "80", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 1010, "direction": "inbound"}}, {"name": "default-allow-ftp", "properties": {"description": "allow ftp", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "21", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 1020, "direction": "inbound"}}, {"name": "default-allow-ftps", "properties": {"description": "allow ftps", "protocol": "*", "sourceportrange": "*", "destinationportrange": "13450-13454", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 1030, "direction": "inbound"}}]}}{"apiversion": "2020-07-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups/", variables('frontendnsgname'))]"], "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnet1name')]", "properties": {"addressprefix": "[variables('subnet1prefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('frontendnsgname'))]"}}}]}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2017-03-30", "type": "microsoft.compute/availabilitysets", "location": "[parameters('location')]", "name": "[parameters('gw-availabilityset')]", "properties": {"platformupdatedomaincount": 20, "platformfaultdomaincount": 2}, "sku": {"name": "aligned"}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/availabilitysets", "name": "[variables('avsetnameascs')]", "apiversion": "2016-04-30-preview", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 3, "platformupdatedomaincount": 20}}{"type": "microsoft.compute/availabilitysets", "name": "[variables('avsetnamedb')]", "apiversion": "2016-04-30-preview", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 3, "platformupdatedomaincount": 20}}
This template provides an example of how to create API Management service and configure all sub-entities
{"type": "microsoft.apimanagement/service/loggers", "apiversion": "2020-12-01", "name": "[format('{0}/{1}", variables('apimanagementservicename'), "appinsightslogger')]", "properties": {"loggertype": "applicationinsights", "credentials": {"instrumentationkey": "[reference(resourceid('microsoft.insights/components", format('ai-{0}", variables('basename')))).instrumentationkey]"}}, "dependson": ["[resourceid('microsoft.apimanagement/service", variables('apimanagementservicename'))]", "[resourceid('microsoft.insights/components", format('ai-{0}", variables('basename')))]"]}{"type": "microsoft.apimanagement/service/diagnostics", "apiversion": "2020-12-01", "name": "[format('{0}/{1}", variables('apimanagementservicename'), "applicationinsights')]", "properties": {"loggerid": "[resourceid('microsoft.apimanagement/service/loggers", variables('apimanagementservicename'), "appinsightslogger')]", "logclientip": true, "alwayslog": "allerrors", "verbosity": "information", "sampling": {"percentage": 100, "samplingtype": "fixed"}, "httpcorrelationprotocol": "legacy"}, "dependson": ["[resourceid('microsoft.apimanagement/service", variables('apimanagementservicename'))]", "[resourceid('microsoft.apimanagement/service/loggers", variables('apimanagementservicename'), "appinsightslogger')]"]}{"type": "microsoft.apimanagement/service", "apiversion": "2020-12-01", "name": "[variables('apimanagementservicename')]", "location": "[parameters('location')]", "sku": {"capacity": 1, "name": "[parameters('apimanagementsku')]"}, "properties": {"publisheremail": "[parameters('apimanagementpublisheremailaddress')]", "publishername": "[parameters('apimanagementpublishername')]", "virtualnetworktype": "internal", "virtualnetworkconfiguration": {"subnetresourceid": "[variables('apimsubnetid')]"}, "hostnameconfigurations": [{"type": "developerportal", "hostname": "[parameters('apimanagementportalcustomhostname')]", "encodedcertificate": "[parameters('apimanagementportalcustomhostnamebase64encodedcertificate')]", "certificatepassword": "[parameters('apimanagementportalcertificatepassword')]", "negotiateclientcertificate": false}, {"type": "proxy", "hostname": "[parameters('apimanagementproxycustomhostname')]", "encodedcertificate": "[parameters('apimanagementproxycustomhostnamebase64encodedcertificate')]", "certificatepassword": "[parameters('apimanagementproxycertificatepassword')]", "negotiateclientcertificate": false}, {"type": "management", "hostname": "[parameters('apimanagementmanagementcustomhostname')]", "encodedcertificate": "[parameters('apimanagementmanagementcustomhostnamebase64encodedcertificate')]", "certificatepassword": "[parameters('apimanagementmanagementcertificatepassword')]", "negotiateclientcertificate": false}]}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"]}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2019-07-01", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[variables('nicname')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "secrets": [{"sourcevault": {"id": "[parameters('vaultresourceid')]"}, "vaultcertificates": [{"certificateurl": "[parameters('certificateurl')]", "certificatestore": "my"}]}], "windowsconfiguration": {"provisionvmagent": true, "winrm": {"listeners": [{"protocol": "http"}, {"protocol": "https", "certificateurl": "[parameters('certificateurl')]"}]}, "enableautomaticupdates": true}}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}
Route table with routes
{"type": "microsoft.network/routetables", "apiversion": "2021-02-01", "name": "[parameters('routetablename')]", "location": "[parameters('location')]", "properties": {"copy": [{"name": "routes", "count": "[length(parameters('routes'))]", "input": {"name": "[parameters('routes')[copyindex('routes')].name]", "properties": {"addressprefix": "[parameters('routes')[copyindex('routes')].addressprefix]", "hasbgpoverride": "[if(contains(parameters('routes')[copyindex('routes')], "hasbgpoverride'), parameters('routes')[copyindex('routes')].hasbgpoverride, null())]", "nexthopipaddress": "[if(contains(parameters('routes')[copyindex('routes')], "nexthopipaddress'), parameters('routes')[copyindex('routes')].nexthopipaddress, null())]", "nexthoptype": "[parameters('routes')[copyindex('routes')].nexthoptype]"}}}], "disablebgproutepropagation": "[parameters('disablebgproutepropagation')]"}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"type": "microsoft.resources/deployments", "apiversion": "2019-10-01", "name": "[format('create-{0}", parameters('subscriptionalias'))]", "location": "[deployment().location]", "properties": {"expressionevaluationoptions": {"scope": "inner"}, "mode": "incremental", "parameters": {"billingaccount": {"value": "[parameters('billingaccount')]"}, "enrollmentaccount": {"value": "[parameters('enrollmentaccount')]"}, "subscriptionalias": {"value": "[parameters('subscriptionalias')]"}, "subscriptiondisplayname": {"value": "[parameters('subscriptiondisplayname')]"}, "subscriptionworkload": {"value": "[parameters('subscriptionworkload')]"}}, "template": {"$schema": "https://schema.management.azure.com/schemas/2019-08-01/managementgroupdeploymenttemplate.json#", "contentversion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": "0.4.451.19169", "templatehash": "11044401809782387845"}}, "parameters": {"enrollmentaccount": {"type": "string", "metadata": {"description": "enrollmentaccount used for subscription billing"}}, "billingaccount": {"type": "string", "metadata": {"description": "billingaccount used for subscription billing"}}, "subscriptionalias": {"type": "string", "metadata": {"description": "alias to assign to the subscription"}}, "subscriptiondisplayname": {"type": "string", "metadata": {"description": "display name for the subscription"}}, "subscriptionworkload": {"type": "string", "metadata": {"description": "workload type for the subscription"}}}, "functions": [], "resources": [{"type": "microsoft.subscription/aliases", "apiversion": "2020-09-01", "scope": "/", "name": "[parameters('subscriptionalias')]", "properties": {"workload": "[parameters('subscriptionworkload')]", "displayname": "[parameters('subscriptiondisplayname')]", "billingscope": "[tenantresourceid('microsoft.billing/billingaccounts/enrollmentaccounts", parameters('billingaccount'), parameters('enrollmentaccount'))]"}}], "outputs": {"subscriptionid": {"type": "string", "value": "[reference(tenantresourceid('microsoft.subscription/aliases", parameters('subscriptionalias'))).subscriptionid]"}}}}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2015-06-15", "type": "microsoft.network/publicipaddresses", "name": "[concat(parameters('vmnameprefix'),"mgs')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic", "idletimeoutinminutes": 4, "dnssettings": {"domainnamelabel": "[concat(parameters('dnsnameprefix'),"')]"}}}{"apiversion": "2015-06-15", "type": "microsoft.network/networkinterfaces", "name": "[concat(parameters('vmnameprefix'),"mgs')]", "location": "[parameters('location')]", "dependson": ["[concat('microsoft.resources/deployments/", "vnet')]", "[concat('microsoft.network/publicipaddresses/", concat(parameters('vmnameprefix'),"mgs'))]"], "properties": {"ipconfigurations": [{"name": "ip1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", concat(parameters('vmnameprefix'), "mgs'))]"}, "subnet": {"id": "[variables('subnetserversid')]"}}}]}}{"apiversion": "2015-06-15", "type": "microsoft.network/networkinterfaces", "name": "[concat(parameters('vmnameprefix'),"mds')]", "location": "[parameters('location')]", "dependson": ["[concat('microsoft.resources/deployments/", "vnet')]", "[concat('microsoft.network/networkinterfaces/", parameters('vmnameprefix'), "mgs')]"], "properties": {"ipconfigurations": [{"name": "ip1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('subnetserversid')]"}}}]}}{"apiversion": "2015-06-15", "type": "microsoft.network/networkinterfaces", "name": "[concat(parameters('vmnameprefix'), "oss", copyindex())]", "location": "[parameters('location')]", "dependson": ["[concat('microsoft.resources/deployments/", "vnet')]", "[concat('microsoft.network/networkinterfaces/", parameters('vmnameprefix'), "mds')]"], "copy": {"name": "ossniccopy", "count": "[parameters('osscount')]"}, "properties": {"ipconfigurations": [{"name": "ip1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('subnetserversid')]"}}}]}}{"apiversion": "2015-06-15", "type": "microsoft.network/publicipaddresses", "name": "[concat(parameters('clientvmnameprefix'),"client0')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic", "idletimeoutinminutes": 4, "dnssettings": {"domainnamelabel": "[concat(parameters('dnsnameprefixforclient'),"')]"}}}{"apiversion": "2015-06-15", "type": "microsoft.network/networkinterfaces", "name": "[concat(parameters('clientvmnameprefix'), "client0')]", "location": "[parameters('location')]", "dependson": ["[concat('microsoft.network/publicipaddresses/", parameters('clientvmnameprefix'), "client0')]"], "properties": {"ipconfigurations": [{"name": "ip1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", concat(parameters('clientvmnameprefix'), "client0'))]"}, "subnet": {"id": "[variables('subnetclientsid1')]"}}}]}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"apiversion": "2021-04-01", "name": "[variables('nesteddeploymentnamevnet')]", "type": "microsoft.resources/deployments", "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('shared/", parameters('neworexistingsubnet'), "vnet.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"vnetname": {"value": "[variables('vnetname')]"}, "addressprefix": {"value": "[variables('addressprefix')]"}, "subnetname": {"value": "[variables('subnetname')]"}, "subnetprefix": {"value": "[variables('subnetprefix')]"}, "location": {"value": "[parameters('location')]"}}}}{"apiversion": "2021-04-01", "name": "[variables('nesteddeploymentnamenic')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('shared/nic-config.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"vnetname": {"value": "[variables('vnetname')]"}, "subnetname": {"value": "[variables('subnetname')]"}, "publicipname": {"value": "[variables('publicipname')]"}, "nsgname": {"value": "[variables('nsgname')]"}, "neworexistingsubnet": {"value": "[parameters('neworexistingsubnet')]"}, "subnetid": {"value": "[parameters('subnetid')]"}}}}{"apiversion": "2021-04-01", "name": "[variables('nesteddeploymentnameprof')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('shared/os-disk-parts.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"imagesku": {"value": "[variables('imagesku')]"}, "imagepublisher": {"value": "[variables('imagepublisher')]"}, "imageoffer": {"value": "[variables('imageoffer')]"}, "userimagevhduri": {"value": ""}, "userimagestorageaccount": {"value": ""}, "osdiskvhduri": {"value": ""}, "osdisktype": {"value": "[variables('osdisktype')]"}, "ostype": {"value": "[variables('internalostype')]"}, "sidlower": {"value": "[variables('sidlower')]"}, "vmname": {"value": "[variables('vmname')]"}, "storageaccounturi": {"value": "[reference(variables('storageaccountname'), "2021-01-01').primaryendpoints["blob"]]"}}}}{"apiversion": "2021-04-01", "name": "[variables('nesteddeploymentnamepip')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('shared/", parameters('neworexistingsubnet'), "pip.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"publicipname": {"value": "[variables('publicipname')]"}, "publicipaddresstype": {"value": "[variables('publicipaddresstype')]"}, "location": {"value": "[parameters('location')]"}}}}{"apiversion": "2021-04-01", "name": "[variables('nesteddeploymentnamensg')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('shared/", parameters('neworexistingsubnet'), "nsg.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"nsgname": {"value": "[variables('nsgname')]"}, "location": {"value": "[parameters('location')]"}, "ostype": {"value": "[variables('internalostype')]"}}}}{"apiversion": "2021-04-01", "name": "[variables('nesteddeploymentname')]", "type": "microsoft.resources/deployments", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.resources/deployments/", variables('nesteddeploymentnameprof'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('shared/cs-server-", variables('vmsize'), "_multinic_no.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"imagereference": {"value": "[reference(variables('nesteddeploymentnameprof')).outputs.imagereference.value]"}, "osdisk": {"value": "[reference(variables('nesteddeploymentnameprof')).outputs.osdisk.value]"}, "osdisktype": {"value": "[variables('osdisktype')]"}, "sidlower": {"value": "[variables('sidlower')]"}, "vmname": {"value": "[variables('vmname')]"}, "vmsize": {"value": "[variables('vmsize')]"}, "adminusername": {"value": "[parameters('adminusername')]"}, "adminpassword": {"value": "[parameters('adminpassword')]"}, "storageaccounturi": {"value": "[reference(variables('storageaccountname'), "2021-01-01').primaryendpoints["blob"]]"}, "nicname": {"value": "[variables('nicname')]"}, "location": {"value": "[parameters('location')]"}}}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2020-11-01", "type": "microsoft.network/networksecuritygroups", "name": "[variables('vmnsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "ssh", "properties": {"description": "allows ssh traffic", "protocol": "tcp", "sourceportrange": "22", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}}{"apiversion": "2020-11-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('vmpipname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "static"}}{"apiversion": "2020-11-01", "type": "microsoft.network/networkinterfaces", "name": "[variables('vmnicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.resources/deployments", variables('esdeploymentname'))]", "[resourceid('microsoft.network/networksecuritygroups", variables('vmnsgname'))]", "[resourceid('microsoft.network/publicipaddresses", variables('vmpipname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig2", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('vmpipname'))]"}, "subnet": {"id": "[variables('subnetref')]"}}}], "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('vmnsgname'))]"}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "name": "[variables('storageaccountname')]", "apiversion": "2016-01-01", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}, "kind": "storage", "properties": {}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2020-12-01", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('newstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('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('ubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'),"/newuserscript')]", "apiversion": "2020-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmname'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('scripts/install_shibboleth_idp.sh", parameters('_artifactslocationsastoken')))]"]}, "protectedsettings": {"commandtoexecute": "[concat('sh install_shibboleth_idp.sh", " ", parameters('uniquenameprefix'), " ", parameters('location'))]"}}}
A template for creating a new Azure Container Registry. Use this template as the framework for your custom deployment.
{"name": "[parameters('acrname')]", "type": "microsoft.containerregistry/registries", "apiversion": "2019-12-01-preview", "location": "[parameters('location')]", "comments": "container registry for storing docker images", "dependson": ["[variables('acrprivatednszoneid')]"], "tags": {"displayname": "container registry", "container.registry": "[parameters('acrname')]"}, "sku": {"name": "[parameters('acrsku')]", "tier": "[parameters('acrsku')]"}, "properties": {"adminuserenabled": "[parameters('acradminuserenabled')]"}}
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"}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/networksecuritygroups", "name": "[concat(variables('nsgname'))]", "apiversion": "2020-05-01", "location": "[parameters('location')]", "condition": "[equals(length(parameters('subnetid')), 0)]", "properties": {"securityrules": "[variables('selectedsecurityrules')]"}}{"type": "microsoft.network/virtualnetworks", "name": "[variables('vnetname')]", "apiversion": "2020-05-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"], "condition": "[equals(length(parameters('subnetid')), 0)]", "properties": {"addressspace": {"addressprefixes": ["10.0.0.0/16"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "10.0.0.0/24", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"}}}]}}{"type": "microsoft.network/publicipaddresses", "name": "[variables('publicipnamelbascs')]", "apiversion": "2020-05-01", "condition": "[and(greater(variables('ascsvmcount') , 1), greater(length(parameters('subnetid')), 0))]", "sku": {"name": "standard"}, "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "static"}}{"type": "microsoft.network/loadbalancers", "name": "[variables('loadbalancernamepubascs')]", "apiversion": "2020-05-01", "location": "[parameters('location')]", "condition": "[and(greater(variables('ascsvmcount') , 1), greater(length(parameters('subnetid')), 0))]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('publicipnamelbascs'))]"], "sku": {"name": "standard"}, "properties": {"frontendipconfigurations": [{"name": "[variables('frontendpubascs')]", "properties": {"publicipaddress": {"id": "[variables('pipidascs')]"}}}], "outboundrules": [{"name": "test", "properties": {"frontendipconfigurations": [{"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('loadbalancernamepubascs'), variables('frontendpubascs'))]"}], "allocatedoutboundports": 1000, "idletimeoutinminutes": 4, "enabletcpreset": true, "protocol": "all", "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('loadbalancernamepubascs'), variables('backendpoolpubascs'))]"}}}], "backendaddresspools": [{"name": "[variables('backendpoolpubascs')]"}]}}{"type": "microsoft.network/publicipaddresses", "name": "[concat(variables('publicipnameascs'), "-", copyindex())]", "apiversion": "2020-05-01", "condition": "[equals(length(parameters('subnetid')), 0)]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"], "sku": {"name": "standard"}, "copy": {"name": "piploop", "count": "[variables('ascsvmcount')]"}, "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "static"}}{"type": "microsoft.network/loadbalancers", "name": "[variables('loadbalancernameascs')]", "apiversion": "2020-05-01", "location": "[parameters('location')]", "condition": "[greater(variables('ascsvmcount') , 1)]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"], "sku": {"name": "standard"}, "properties": {"frontendipconfigurations": "[variables('lbfrontendconfigxscs')[parameters('stacktype')]]", "backendaddresspools": "[variables('lbbackendpoolxscs')[parameters('stacktype')]]", "loadbalancingrules": "[variables('lbrulexscs')[parameters('stacktype')]]", "probes": "[variables('lbprobexscs')[parameters('stacktype')]]"}}{"type": "microsoft.network/networkinterfaces", "name": "[concat(variables('nicnameascs'), "-", copyindex())]", "apiversion": "2020-05-01", "copy": {"name": "nicascsloop", "count": "[variables('ascsvmcount')]"}, "dependson": ["piploop", "[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]", "[resourceid('microsoft.network/loadbalancers", variables('loadbalancernameascs'))]", "[resourceid('microsoft.network/loadbalancers", variables('loadbalancernamepubascs'))]"], "location": "[parameters('location')]", "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": "[if(equals(length(parameters(\"subnetid\')), 0), json(concat(\"{"id": "\", resourceid(\"microsoft.network/publicipaddresses\", concat(variables(\"publicipnameascs\'), \"-\", copyindex())) ,\""}\')), json(\"null\'))]", "subnet": {"id": "[variables('selectedsubnetid')]"}, "loadbalancerbackendaddresspools": "[if(greater(variables('ascsvmcount'), 1), variables('nicbackaddresspoolxscs')[parameters('stacktype')], json('null'))]"}}]}}{"type": "microsoft.network/publicipaddresses", "name": "[variables('publicipnamelbdb')]", "apiversion": "2020-05-01", "sku": {"name": "standard"}, "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "static"}}{"type": "microsoft.network/loadbalancers", "name": "[variables('loadbalancernamepubdb')]", "apiversion": "2020-05-01", "location": "[parameters('location')]", "condition": "[greater(variables('ascsvmcount') , 1)]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('publicipnamelbdb'))]"], "sku": {"name": "standard"}, "properties": {"frontendipconfigurations": [{"name": "[variables('frontendpubdb')]", "properties": {"publicipaddress": {"id": "[variables('pipiddb')]"}}}], "outboundrules": [{"name": "test", "properties": {"frontendipconfigurations": [{"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('loadbalancernamepubdb'), variables('frontendpubdb'))]"}], "allocatedoutboundports": 1000, "idletimeoutinminutes": 4, "enabletcpreset": true, "protocol": "all", "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('loadbalancernamepubdb'), variables('backendpoolpubdb'))]"}}}], "backendaddresspools": [{"name": "[variables('backendpoolpubdb')]"}]}}{"type": "microsoft.network/loadbalancers", "name": "[variables('loadbalancernamedb')]", "apiversion": "2020-05-01", "location": "[parameters('location')]", "condition": "[greater(variables('dbvmcount') , 1)]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"], "sku": {"name": "standard"}, "properties": {"frontendipconfigurations": "[variables('lbfrontendconfigsdb')[parameters('dbtype')][variables('internalostype')]]", "backendaddresspools": "[variables('lbbackendpoolsdb')[parameters('dbtype')][variables('internalostype')]]", "loadbalancingrules": "[variables('lbrulesdb')[parameters('dbtype')][variables('internalostype')]]", "probes": "[variables('lbprobesdb')[parameters('dbtype')][variables('internalostype')]]"}}{"type": "microsoft.network/networkinterfaces", "name": "[concat(variables('nicnamedb'), "-", copyindex())]", "apiversion": "2020-05-01", "copy": {"name": "nicdbloop", "count": "[variables('dbvmcount')]"}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]", "[resourceid('microsoft.network/loadbalancers", variables('loadbalancernamedb'))]", "[resourceid('microsoft.network/loadbalancers", variables('loadbalancernamepubdb'))]"], "location": "[parameters('location')]", "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('selectedsubnetid')]"}, "loadbalancerbackendaddresspools": "[if(greater(variables('dbvmcount'), 1), variables('nicbackaddresspoolsdb')[parameters('dbtype')][variables('internalostype')], json('null'))]"}}]}}{"type": "microsoft.network/networkinterfaces", "name": "[concat(variables('nicnamedi'), "-", copyindex())]", "apiversion": "2020-05-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"], "copy": {"name": "nicdiloop", "count": "[variables('divmcount')]"}, "location": "[parameters('location')]", "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('selectedsubnetid')]"}}}]}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"apiversion": "2020-06-01", "name": "deploy-virus-attack-oms-resource", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('omstemplateuri')]"}, "parameters": {"omsworkspacename": {"value": "[variables('omsworkspacename')]"}, "omssolutionsname": {"value": "[variables('omssolutions')]"}, "sku": {"value": "[parameters('omssku')]"}, "location": {"value": "[parameters('location')]"}, "tags": {"value": "[variables('tags')]"}}}}{"apiversion": "2020-06-01", "name": "[concat(parameters('vnetname'),"-","-resource')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('vnettemplateuri')]"}, "parameters": {"vnetname": {"value": "[parameters('vnetname')]"}, "addressprefix": {"value": "[parameters('vnetaddressspace')]"}, "subnets": {"value": "[variables('subnets')]"}, "location": {"value": "[parameters('location')]"}, "tags": {"value": "[variables('tags')]"}}}}{"apiversion": "2020-06-01", "name": "[concat(variables('nsgname'),"-","-resource')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('nsgtemplateuri')]"}, "parameters": {"nsgname": {"value": "[variables('nsgname')]"}, "securityrules": {"value": "[variables('nsgsecurityrules')]"}, "location": {"value": "[parameters('location')]"}, "tags": {"value": "[variables('tags')]"}}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "apiversion": "2017-06-01", "name": "[variables('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}, "kind": "storage", "properties": {}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2017-10-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[concat(parameters('tigdnsprefix'),uniquestring(resourcegroup().id))]"}}}{"comments": "default network security group for template", "type": "microsoft.network/networksecuritygroups", "apiversion": "2019-08-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "default-allow-22", "properties": {"priority": 1000, "access": "allow", "direction": "inbound", "destinationportrange": "22", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}, {"name": "default-allow-3000", "properties": {"priority": 1001, "access": "allow", "direction": "inbound", "destinationportrange": "3000", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}, {"name": "default-allow-8083", "properties": {"priority": 1002, "access": "allow", "direction": "inbound", "destinationportrange": "8083", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}, {"name": "default-allow-8086", "properties": {"priority": 1003, "access": "allow", "direction": "inbound", "destinationportrange": "8086", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}, {"name": "default-allow-8090", "properties": {"priority": 1004, "access": "allow", "direction": "inbound", "destinationportrange": "8090", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}]}}
This template takes a minimum amount of parameters and deploys a trusted launch capable Windows virtual machine, using the latest patched version.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "identity": {"type": "systemassigned"}, "dependson": ["[resourceid('microsoft.network/networkinterfaces", parameters('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": "[variables('imagereference')[parameters('sku')]]", "osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", parameters('nicname'))]"}]}, "securityprofile": {"uefisettings": {"securebootenabled": "[parameters('secureboot')]", "vtpmenabled": "[parameters('vtpm')]"}, "securitytype": "trustedlaunch"}}}{"condition": "[and(equals(parameters('vtpm'), "true'), equals(parameters('secureboot'), "true'))]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('vmname'), "/", variables('extensionname'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines", parameters('vmname'))]"], "apiversion": "2020-06-01", "properties": {"publisher": "[variables('extensionpublisher')]", "type": "[variables('extensionname')]", "typehandlerversion": "[variables('extensionversion')]", "autoupgrademinorversion": true, "settings": {"attestationendpointcfg": {"maaendpoint": "[parameters('maaendpoint')]", "maatenantname": "[variables('maatenantname')]", "ascreportingendpoint": "[variables('ascreportingendpoint')]", "usealternatetoken": "[variables('usealternatetoken')]", "disablealerts": "[variables('disablealerts')]"}}}}
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]"}}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "name": "[variables('toolstorageaccountname')]", "apiversion": "2021-02-01", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}, "kind": "storage", "properties": {}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[concat('zookprvm", copyindex())]", "location": "[parameters('location')]", "copy": {"name": "virtualzookeepermachineloop", "count": "[variables('numberofzookeeperinstances')]"}, "dependson": ["[resourceid('microsoft.resources/deployments/", "shared-resources')]", "[concat('microsoft.network/networkinterfaces/", "niczoo", copyindex())]"], "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets", "kafkacluseras')]"}, "hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[concat(variables('computernameprefix'), copyindex())]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "linuxconfiguration": {"disablepasswordauthentication": false}}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat('zookprvm", copyindex(),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat('niczoo", copyindex()))]"}]}}}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/publicipprefixes", "apiversion": "2021-03-01", "name": "[parameters('publicipprefixname')]", "location": "[parameters('location')]", "sku": {"name": "standard", "tier": "regional"}, "properties": {"prefixlength": "[parameters('publicipprefixlength')]", "publicipaddressversion": "ipv4"}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[variables('supportlogstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storage", "tags": {"resourcetype": "service fabric", "clustername": "[parameters('clustername')]"}, "properties": {}}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-04-01", "name": "[parameters('virtualnetwork_name')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('virtualnetwork_cidr')]"]}}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-04-01", "name": "[concat(parameters('virtualnetwork_name'),"/", parameters('subnet1_name'))]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetwork_name'))]"], "properties": {"addressprefix": "[parameters('subnet1_cidr')]", "privateendpointnetworkpolicies": "disabled"}}{"type": "microsoft.network/privateendpoints", "apiversion": "2019-04-01", "name": "[parameters('privateendpoint_name')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/sites", parameters('site_name'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetwork_name'), parameters('subnet1_name'))]"], "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetwork_name'), parameters('subnet1_name'))]"}, "privatelinkserviceconnections": [{"name": "[parameters('privatelinkconnection_name')]", "properties": {"privatelinkserviceid": "[resourceid('microsoft.web/sites", parameters('site_name'))]", "groupids": ["sites"]}}]}}{"type": "microsoft.network/privatednszones", "apiversion": "2018-09-01", "name": "[parameters('privatednszone_name')]", "location": "global", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetwork_name'))]"]}{"type": "microsoft.network/privatednszones/virtualnetworklinks", "apiversion": "2018-09-01", "name": "[concat(parameters('privatednszone_name'), "/", parameters('privatednszone_name'), "-link')]", "location": "global", "dependson": ["[resourceid('microsoft.network/privatednszones", parameters('privatednszone_name'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetwork_name'))]"], "properties": {"registrationenabled": false, "virtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetwork_name'))]"}}}{"type": "microsoft.network/privateendpoints/privatednszonegroups", "apiversion": "2020-03-01", "name": "[concat(parameters('privateendpoint_name'),"/dnsgroupname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/privatednszones", parameters('privatednszone_name'))]", "[resourceid('microsoft.network/privateendpoints" , parameters('privateendpoint_name'))]"], "properties": {"privatednszoneconfigs": [{"name": "config1", "properties": {"privatednszoneid": "[resourceid('microsoft.network/privatednszones", parameters('privatednszone_name'))]"}}]}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "name": "[parameters('newstorageaccountname')]", "apiversion": "2021-04-01", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}, "kind": "storagev2"}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/availabilitysets", "name": "[variables('webavailsetname')]", "apiversion": "2017-12-01", "location": "[parameters('location')]", "comments": "this is the availability set for all web vms", "tags": {"displayname": "web avail set", "quickstartname": "[variables('quickstarttags').name]", "provider": "[variables('barracudanetworkstags').provider]"}, "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"type": "microsoft.compute/availabilitysets", "name": "[variables('bwafavailsetname')]", "apiversion": "2017-12-01", "location": "[parameters('location')]", "comments": "this is the availability set for bwaf vm", "tags": {"displayname": "bwaf avail set", "quickstartname": "[variables('quickstarttags').name]", "provider": "[variables('barracudanetworkstags').provider]"}, "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"type": "microsoft.compute/virtualmachines", "name": "[concat(variables('webvmname'), copyindex(1))]", "apiversion": "2017-03-30", "location": "[parameters('location')]", "comments": " web server vms", "tags": {"displayname": "web vms", "quickstartname": "[variables('quickstarttags').name]", "provider": "[variables('barracudanetworkstags').provider]"}, "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('webstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", concat(variables('webvmnicname'), copyindex(1)))]", "[resourceid('microsoft.compute/availabilitysets/", variables('webavailsetname'))]"], "copy": {"name": "websrvmachineloop", "count": "[parameters('webvmcount')]"}, "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets",variables('webavailsetname'))]"}, "hardwareprofile": {"vmsize": "[parameters('webvmsize')]"}, "osprofile": {"computername": "[concat('webserver",copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('webvmpublisher')]", "offer": "[variables('webvmoffer')]", "sku": "[variables('webvmsku')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('webvmname'), copyindex(1),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(variables('webvmnicname'), copyindex(1)))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('diagstorageaccountname'))).primaryendpoints.blob]"}}}, "resources": [{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('webvmname'), copyindex(1),"/",concat(variables('webvmname'), copyindex(1),"-web-dsc'))]", "apiversion": "2015-06-15", "location": "[parameters('location')]", "comments": "this vm extension loops to setup iis in each web vms using dsc", "tags": {"displayname": "web vm extensions", "quickstartname": "[variables('quickstarttags').name]", "provider": "[variables('barracudanetworkstags').provider]"}, "dependson": ["[resourceid('microsoft.compute/virtualmachines/", concat(variables('webvmname'), copyindex(1)))]"], "properties": {"publisher": "microsoft.powershell", "type": "dsc", "typehandlerversion": "2.19", "autoupgrademinorversion": true, "settings": {"modulesurl": "[uri(parameters('_artifactslocation'),concat('scripts/webserverconfig.zip",parameters('_artifactslocationsastoken')))]", "configurationfunction": "[variables('webvmextensionfunction')]", "wmfversion": "4.0", "properties": {}}}}]}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2020-07-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('apppublicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[parameters('dnslabelprefix')]"}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[parameters('virtualmachinename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces/", variables('networkinterfacename'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('virtualmachinesize')]"}, "storageprofile": {"osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "premium_lrs"}}, "imagereference": {"publisher": "microsoftsqlserver", "offer": "[parameters('imageoffer')]", "sku": "[parameters('sqlsku')]", "version": "latest"}, "copy": [{"name": "datadisks", "count": "[add(parameters('sqldatadiskscount'), parameters('sqllogdiskscount'))]", "input": {"lun": "[copyindex('datadisks')]", "createoption": "[variables('datadisks').createoption]", "caching": "[if(greaterorequals(copyindex('datadisks'), parameters('sqldatadiskscount')) ,"none", variables('datadisks').caching )]", "writeacceleratorenabled": "[variables('datadisks').writeacceleratorenabled]", "disksizegb": "[variables('datadisks').disksizegb]", "manageddisk": {"storageaccounttype": "[variables('datadisks').storageaccounttype]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]"}]}, "osprofile": {"computername": "[parameters('virtualmachinename')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2020-05-01", "type": "microsoft.network/networkinterfaces", "name": "[concat('nic", copyindex())]", "location": "[parameters('location')]", "copy": {"name": "nicloop", "count": "[variables('numberofmasterinstances')]"}, "dependson": ["[resourceid('microsoft.resources/deployments/", "shared-resources')]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "static", "privateipaddress": "[concat(parameters('sparknodeipaddressprefix'), copyindex())]", "subnet": {"id": "[variables('subnetref')]"}}}]}}
This module creates a key resource in an existing KeyVault with apiVersion 2019-09-01.
{"type": "microsoft.keyvault/vaults", "apiversion": "2019-09-01", "name": "[parameters('stackname')]", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.web/sites",parameters('stackname'))]"], "properties": {"enablerbacauthorization": false, "enablesoftdelete": false, "enabledfordeployment": false, "enabledfordiskencryption": false, "enabledfortemplatedeployment": false, "tenantid": "[subscription().tenantid]", "accesspolicies": [{"tenantid": "[subscription().tenantid]", "objectid": "[parameters('aaduserobjectid')]", "permissions": {"secrets": ["list", "get", "set"]}}, {"tenantid": "[reference(resourceid('microsoft.web/sites", parameters('stackname')), "2018-02-01", "full').identity.tenantid]", "objectid": "[reference(resourceid('microsoft.web/sites", parameters('stackname')), "2018-02-01", "full').identity.principalid]", "permissions": {"secrets": ["list", "get", "set"]}}], "sku": {"name": "standard", "family": "a"}, "networkacls": {"defaultaction": "allow", "bypass": "azureservices"}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"type": "microsoft.resources/deployments", "apiversion": "2020-10-01", "name": "network", "properties": {"expressionevaluationoptions": {"scope": "inner"}, "mode": "incremental", "parameters": {"location": {"value": "[parameters('location')]"}, "vnetipprefix": {"value": "[parameters('vnetipprefix')]"}, "containerinstancessubnetipprefix": {"value": "[parameters('containerinstancessubnetipprefix')]"}, "applicationgatewaysubnetipprefix": {"value": "[parameters('applicationgatewaysubnetipprefix')]"}}, "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.1272.37030", "templatehash": "2097233642399514556"}}, "parameters": {"location": {"type": "string", "metadata": {"description": "the location into which the virtual network resources should be deployed."}}, "vnetipprefix": {"type": "string", "metadata": {"description": "the ip address prefix (cidr range) to use when deploying the virtual network."}}, "containerinstancessubnetipprefix": {"type": "string", "metadata": {"description": "the ip address prefix (cidr range) to use when deploying the container group subnet within the virtual network."}}, "applicationgatewaysubnetipprefix": {"type": "string", "metadata": {"description": "the ip address prefix (cidr range) to use when deploying the application gateway subnet within the virtual network."}}}, "variables": {"vnetname": "vnet", "containergroupsubnetname": "containers", "applicationgatewaysubnetname": "applicationgateway", "nsgname": "mynsg"}, "resources": [{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('vnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetipprefix')]"]}, "subnets": [{"name": "[variables('containergroupsubnetname')]", "properties": {"addressprefix": "[parameters('containerinstancessubnetipprefix')]", "delegations": [{"name": "delegationservice", "properties": {"servicename": "microsoft.containerinstance/containergroups"}}]}}, {"name": "[variables('applicationgatewaysubnetname')]", "properties": {"addressprefix": "[parameters('applicationgatewaysubnetipprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"}}}]}, "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"]}, {"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-05-01", "name": "[variables('nsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allow_front_door_to_send_http_traffic", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportranges": ["80", "443"], "sourceaddressprefix": "azurefrontdoor.backend", "destinationaddressprefix": "virtualnetwork", "access": "allow", "priority": 120, "direction": "inbound"}}, {"name": "allow_gwm", "properties": {"protocol": "*", "sourceportrange": "*", "destinationportrange": "65200-65535", "sourceaddressprefix": "gatewaymanager", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}, {"name": "allow_azureloadbalancer", "properties": {"protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "azureloadbalancer", "destinationaddressprefix": "*", "access": "allow", "priority": 110, "direction": "inbound"}}]}}], "outputs": {"vnetname": {"type": "string", "value": "[variables('vnetname')]"}, "vnetresourceid": {"type": "string", "value": "[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"}, "applicationgatewaysubnetresourceid": {"type": "string", "value": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('applicationgatewaysubnetname'))]"}, "containergroupsubnetresourceid": {"type": "string", "value": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('containergroupsubnetname'))]"}}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2019-12-01", "type": "microsoft.compute/proximityplacementgroups", "name": "[variables('ppg_name')]", "location": "[parameters('location')]"}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "kind": "storagev2", "sku": {"name": "standard_lrs"}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforpublicip')]"}}}{"comments": "default network security group for template", "type": "microsoft.network/networksecuritygroups", "apiversion": "2020-05-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "default-allow-22", "properties": {"priority": 1000, "access": "allow", "direction": "inbound", "destinationportrange": "22", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}, {"name": "default-allow-80", "properties": {"priority": 1001, "access": "allow", "direction": "inbound", "destinationportrange": "80", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"], "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/networksecuritygroups", "name": "[variables('bwafnsgname')]", "apiversion": "2016-03-30", "location": "[parameters('location')]", "comments": " nsg for bwaf subnet", "tags": {"displayname": "bwaf nsg", "quickstartname": "[variables('quickstarttags').name]", "provider": "[variables('barracudanetworkstags').provider]"}, "properties": {"securityrules": [{"name": "http-allow", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "80", "sourceaddressprefix": "[parameters('remoteallowedcidr')]", "destinationaddressprefix": "10.0.0.0/24", "access": "allow", "priority": 110, "direction": "inbound"}}, {"name": "https-allow", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "443", "sourceaddressprefix": "[parameters('remoteallowedcidr')]", "destinationaddressprefix": "10.0.0.0/24", "access": "allow", "priority": 120, "direction": "inbound"}}, {"name": "adminportal-allow", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "8000", "sourceaddressprefix": "[parameters('remoteallowedcidr')]", "destinationaddressprefix": "10.0.0.0/24", "access": "allow", "priority": 130, "direction": "inbound"}}]}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"name": "[parameters('vmname')]", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces/", variables('networkinterfacename'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('osdisktype')]"}}, "imagereference": {"publisher": "microsoftvisualstudio", "offer": "visualstudio2019latest", "sku": "vs-2019-comm-latest-ws2019", "version": "latest"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]"}]}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"enableautomaticupdates": true, "provisionvmagent": true}}}}
Creates a Key Vault with a list of secrets
{"type": "microsoft.keyvault/vaults", "apiversion": "2021-04-01-preview", "name": "[parameters('keyvaultname')]", "location": "[parameters('location')]", "properties": {"enabledfordeployment": "[parameters('enabledfordeployment')]", "enabledfortemplatedeployment": "[parameters('enabledfortemplatedeployment')]", "enabledfordiskencryption": "[parameters('enabledfordiskencryption')]", "tenantid": "[parameters('tenantid')]", "accesspolicies": [{"objectid": "[parameters('objectid')]", "tenantid": "[parameters('tenantid')]", "permissions": {"keys": "[parameters('keyspermissions')]", "secrets": "[parameters('secretspermissions')]"}}], "sku": {"name": "[parameters('skuname')]", "family": "a"}, "networkacls": {"defaultaction": "allow", "bypass": "azureservices"}}}{"copy": {"name": "secrets", "count": "[length(parameters('secretsobject').secrets)]"}, "type": "microsoft.keyvault/vaults/secrets", "apiversion": "2021-04-01-preview", "name": "[format('{0}/{1}", parameters('keyvaultname'), parameters('secretsobject').secrets[copyindex()].secretname)]", "properties": {"value": "[parameters('secretsobject').secrets[copyindex()].secretvalue]"}, "dependson": ["[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]"]}
Deploy a Web App with diagnostics logging to Storage Account Blob Container enabled.
{"apiversion": "2020-12-01", "type": "microsoft.web/serverfarms", "name": "[parameters('appserviceplanname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('appserviceplanskuname')]"}}{"apiversion": "2020-12-01", "type": "microsoft.web/sites", "name": "[parameters('webappname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms", parameters('appserviceplanname'))]", "[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"], "properties": {"name": "[parameters('webappname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms/", parameters('appserviceplanname'))]"}, "resources": [{"apiversion": "2020-12-01", "type": "config", "name": "logs", "dependson": ["[resourceid('microsoft.web/sites", parameters('webappname'))]"], "properties": {"applicationlogs": {"azureblobstorage": {"level": "[parameters('diagnosticslogslevel')]", "sasurl": "[concat(reference(resourceid('microsoft.storage/storageaccounts/", parameters('storageaccountname'))).primaryendpoints.blob, variables('blobcontainername'), "?", listaccountsas(parameters('storageaccountname'), "2018-02-01", variables('listaccountsasrequestcontent')).accountsastoken)]", "retentionindays": "[parameters('diagnosticslogsretentionindays')]"}}}}]}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-06-01", "name": "[variables('diagnosticstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storagev2", "tags": {"displayname": "[format('key vault {0} diagnostics storage account", parameters('keyvaultname'))]"}}
This template takes deploys a VM by retrieving the password securely from a Key Vault
{"apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[variables('storageaccountname')]", "[variables('nicname')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[parameters('windowsosversion')]", "version": "latest"}, "osdisk": {"createoption": "fromimage"}, "datadisks": [{"disksizegb": 1023, "lun": 0, "createoption": "empty"}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('storageaccountname')).primaryendpoints.blob]"}}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "name": "[variables('defaultstorageaccount').name]", "location": "[parameters('location')]", "apiversion": "2021-08-01", "sku": {"name": "[variables('defaultstorageaccount').type]"}, "kind": "storage", "properties": {}}
Creates an HDInsight cluster in an existing virtual network with a new SQL DB for Ambari+Hive Metastore. You must have an existing SQL Sever, storage account, and VNET.
{"name": "[parameters('clustername')]", "type": "microsoft.hdinsight/clusters", "location": "[parameters('location')]", "apiversion": "2018-06-01-preview", "dependson": ["sqldbdeployment"], "properties": {"clusterversion": "[parameters('clusterversion')]", "ostype": "linux", "clusterdefinition": {"kind": "hadoop", "configurations": {"gateway": {"restauthcredential.isenabled": true, "restauthcredential.username": "[parameters('clusterloginusername')]", "restauthcredential.password": "[parameters('clusterloginpassword')]"}, "hive-site": {"javax.jdo.option.connectiondrivername": "com.microsoft.sqlserver.jdbc.sqlserverdriver", "javax.jdo.option.connectionurl": "[concat('jdbc:sqlserver://", reference(resourceid(parameters('existingsqlserverresourcegroup'), "microsoft.sql/servers", parameters('existingsqlservername')), "2020-02-02-preview').fullyqualifieddomainname, ";database=",parameters('newmetastoredbname'),";encrypt=true;trustservercertificate=true;create=false;logintimeout=300')]", "javax.jdo.option.connectionusername": "[parameters('existingsqlserverusername')]", "javax.jdo.option.connectionpassword": "[parameters('existingsqlserverpassword')]"}, "hive-env": {"hive_database": "existing mssql server database with sql authentication", "hive_database_name": "[parameters('newmetastoredbname')]", "hive_database_type": "mssql", "hive_existing_mssql_server_database": "[parameters('newmetastoredbname')]", "hive_existing_mssql_server_host": "[reference(resourceid(parameters('existingsqlserverresourcegroup'),"microsoft.sql/servers",parameters('existingsqlservername')), "2020-02-02-preview').fullyqualifieddomainname]", "hive_hostname": "[reference(resourceid(parameters('existingsqlserverresourcegroup'),"microsoft.sql/servers",parameters('existingsqlservername')), "2020-02-02-preview').fullyqualifieddomainname]"}, "ambari-conf": {"database-server": "[reference(resourceid(parameters('existingsqlserverresourcegroup'),"microsoft.sql/servers",parameters('existingsqlservername')), "2020-02-02-preview').fullyqualifieddomainname]", "database-name": "[parameters('newmetastoredbname')]", "database-user-name": "[parameters('existingsqlserverusername')]", "database-user-password": "[parameters('existingsqlserverpassword')]"}}}, "storageprofile": {"storageaccounts": [{"name": "[replace(replace(reference(resourceid(parameters('existingclusterstorageresourcegroup'), "microsoft.storage/storageaccounts/", parameters('existingclusterstorageaccountname')), "2021-04-01').primaryendpoints.blob,"https:","'),"/","')]", "isdefault": true, "container": "[parameters('neworexistingclusterstoragecontainername')]", "key": "[listkeys(resourceid(parameters('existingclusterstorageresourcegroup'), "microsoft.storage/storageaccounts", parameters('existingclusterstorageaccountname')), "2021-04-01').keys[0].value]"}]}, "computeprofile": {"roles": [{"name": "headnode", "targetinstancecount": 2, "hardwareprofile": {"vmsize": "[parameters('headnodevirtualmachinesize')]"}, "osprofile": {"linuxoperatingsystemprofile": {"username": "[parameters('sshusername')]", "password": "[parameters('sshpassword')]"}}, "virtualnetworkprofile": {"id": "[resourceid(parameters('existingvirtualnetworkresourcegroup'), "microsoft.network/virtualnetworks", parameters('existingvirtualnetworkname'))]", "subnet": "[resourceid(parameters('existingvirtualnetworkresourcegroup'), "microsoft.network/virtualnetworks/subnets", parameters('existingvirtualnetworkname'), parameters('existingvirtualnetworksubnetname'))]"}}, {"name": "workernode", "targetinstancecount": "[parameters('workernodecount')]", "hardwareprofile": {"vmsize": "[parameters('workernodevirtualmachinesize')]"}, "osprofile": {"linuxoperatingsystemprofile": {"username": "[parameters('sshusername')]", "password": "[parameters('sshpassword')]"}}, "virtualnetworkprofile": {"id": "[resourceid(parameters('existingvirtualnetworkresourcegroup'), "microsoft.network/virtualnetworks", parameters('existingvirtualnetworkname'))]", "subnet": "[resourceid(parameters('existingvirtualnetworkresourcegroup'), "microsoft.network/virtualnetworks/subnets", parameters('existingvirtualnetworkname'), parameters('existingvirtualnetworksubnetname'))]"}}]}}}
This template configures WAF client IP restriction for Azure Front Door endpoint
{"apiversion": "2019-03-01", "type": "microsoft.network/frontdoorwebapplicationfirewallpolicies", "name": "[parameters('wafpolicyname')]", "location": "[variables('waflocation')]", "properties": {"policysettings": {"mode": "[parameters('wafmode')]", "enabledstate": "enabled"}, "customrules": {"rules": [{"name": "rule1", "priority": 1, "enabledstate": "enabled", "ruletype": "matchrule", "matchconditions": [{"matchvariable": "remoteaddr", "operator": "ipmatch", "matchvalue": ["[parameters('ipmatch')]"]}], "action": "[parameters('ipfilteringaction')]"}]}}}
Establish connection to a VNET via an ExpressRoute circuit
{"condition": "[equals(parameters('vnetneworexisting'), "new')]", "apiversion": "2020-06-01", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["10.0.0.0/16"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "10.0.0.0/24"}}]}}{"apiversion": "2020-06-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "tags": {"displayname": "publicipaddress"}, "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforpublicip')]"}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmnamers')]", "location": "[parameters('location')]", "tags": {"displayname": "rsmachine"}, "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('vhdstoragenamers'))]", "[resourceid('microsoft.storage/storageaccounts/", variables('diagnosticsstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/",concat(variables('nicname')))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsizers')]"}, "osprofile": {"computername": "[variables('vmnamers')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('sqlimagepublisher')]", "offer": "[variables('vmimageofferrs')]", "sku": "[variables('sqlimagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmnamers'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}, "datadisks": [{"lun": 0, "name": "[concat(variables('vmnamers'),"_datadisk1')]", "createoption": "empty", "caching": "readonly", "disksizegb": "1023"}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('nicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('diagnosticsstorageaccountname'))).primaryendpoints.blob]"}}}, "resources": [{"name": "microsoft.insights.vmdiagnosticssettings", "type": "extensions", "location": "[parameters('location')]", "apiversion": "2021-07-01", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmnamers'))]"], "tags": {"displayname": "diagnostics"}, "properties": {"publisher": "microsoft.azure.diagnostics", "type": "iaasdiagnostics", "typehandlerversion": "1.5", "autoupgrademinorversion": true, "settings": {"xmlcfg": "[base64(concat(variables('wadcfgxstart'), variables('wadmetricsresourceid'), variables('vmnamers'), variables('wadcfgxend')))]", "storageaccount": "[variables('diagnosticsstorageaccountname')]"}, "protectedsettings": {"storageaccountname": "[variables('diagnosticsstorageaccountname')]", "storageaccountkey": "[listkeys(variables('accountid'), "2015-06-15').key1]", "storageaccountendpoint": "[environment().suffixes.storage]"}}}, {"name": "ssrsconfiguration", "type": "extensions", "location": "[parameters('location')]", "apiversion": "2021-07-01", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmnamers'))]", "[resourceid('microsoft.compute/virtualmachines/extensions", variables('vmnamecatalog'), "sqlconfigurationmixedauth')]"], "tags": {"displayname": "ssrsconfiguration"}, "properties": {"publisher": "microsoft.powershell", "type": "dsc", "typehandlerversion": "2.19", "autoupgrademinorversion": true, "settings": {"modulesurl": "[variables('sqlmoduleurl')]", "configurationfunction": "[variables('rsconfigurationconfigurationfunction')]", "properties": {"sqlsaadminauthcreds": {"username": "[parameters('dbsausername')]", "password": "privatesettingsref:sapassword"}, "catalogmachine": "[reference(variables('catalogpublicipid'),"2015-06-15').dnssettings.fqdn]"}}, "protectedsettings": {"items": {"sapassword": "[parameters('dbsauserpassword')]"}}}}]}
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 unbounded Logic Apps timer jobs
{"name": "[parameters('createtimerjoblogicappname')]", "type": "microsoft.logic/workflows", "location": "[parameters('location')]", "tags": {"displayname": "logicapp"}, "apiversion": "2019-05-01", "dependson": ["[resourceid('microsoft.logic/workflows", parameters('timerjoblogicappname'))]"], "properties": {"state": "enabled", "definition": {"$schema": "https://schema.management.azure.com/providers/microsoft.logic/schemas/2016-06-01/workflowdefinition.json#", "contentversion": "1.0.0.0", "triggers": {"manual": {"correlation": {"clienttrackingid": "@triggerbody()["timerjobid"]"}, "type": "request", "kind": "http", "inputs": {"schema": {"properties": {"jobrecurrence": {"properties": {"count": {"minimum": -1, "title": "count (jobrecurrence)", "type": "integer"}, "endtime": {"title": "endtime (jobrecurrence)", "type": "string"}, "frequency": {"enum": ["second", "minute", "hour", "day", "week", "month"], "title": "frequency (jobrecurrence)", "type": "string"}, "interval": {"title": "interval (jobrecurrence)", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, "jobstatus": {"properties": {"executioncount": {"title": "executioncount (jobstatus)", "type": "integer"}, "faultedcount": {"title": "faultedcount (jobstatus)", "type": "integer"}, "lastexecutiontime": {"title": "lastexecutiontime (jobstatus)", "type": "string"}, "nextexecutiontime": {"title": "nextexecutiontime (jobstatus)", "type": "string"}}, "type": "object"}, "starttime": {"type": "string"}, "timerjobid": {"type": "string"}}, "required": ["jobrecurrence", "timerjobid"], "type": "object"}}}}, "actions": {"if_not_past_endtime_or_exceeds_count": {"actions": {"catch_timerjob_error": {"actions": {"terminate_failed_to_create_job": {"runafter": {"timer_job_failed_response": ["succeeded"]}, "type": "terminate", "inputs": {"runerror": {"message": "failed to create timer job"}, "runstatus": "failed"}}, "timer_job_failed_response": {"type": "response", "kind": "http", "inputs": {"body": "failed to create timer job", "statuscode": 400}}}, "runafter": {"timerjob": ["failed", "timedout"]}, "type": "scope"}, "created_response": {"runafter": {"timerjob": ["succeeded"]}, "type": "response", "kind": "http", "inputs": {"body": "next execution time will be at @{variables('nexttime')}", "statuscode": 201}}, "timerjob": {"type": "workflow", "inputs": {"body": {"jobrecurrence": {"count": "@triggerbody()?["jobrecurrence"]?["count"]", "endtime": "@triggerbody()?["jobrecurrence"]?["endtime"]", "frequency": "@triggerbody()?["jobrecurrence"]?["frequency"]", "interval": "@triggerbody()?["jobrecurrence"]?["interval"]"}, "jobstatus": {"executioncount": "@triggerbody()?["jobstatus"]?["executioncount"]", "faultedcount": "@triggerbody()?["jobstatus"]?["faultedcount"]", "lastexecutiontime": "@triggerbody()?["jobstatus"]?["lastexecutiontime"]", "nextexecutiontime": "@variables('nexttime')"}, "starttime": "@triggerbody()?["starttime"]", "timerjobid": "@triggerbody()["timerjobid"]"}, "host": {"triggername": "manual", "workflow": {"id": "[resourceid('microsoft.logic/workflows",parameters('timerjoblogicappname'))]"}}}}}, "runafter": {"initialize_nexttime": ["succeeded"]}, "else": {"actions": {"cancelled": {"runafter": {"exceeded_criteria_response": ["succeeded"]}, "type": "terminate", "inputs": {"runstatus": "cancelled"}}, "exceeded_criteria_response": {"type": "response", "kind": "http", "inputs": {"body": "job completion criteria met.\ndetails: \neither\nendtime(@{triggerbody()?["jobrecurrence"]?["endtime"]}) < next execution time(@{variables('nexttime')})\nor\ncount(@{triggerbody()?["jobrecurrence"]?["count"]}) > execution count (@{triggerbody()?["jobstatus"]?["executioncount"]})", "statuscode": 409}}}}, "expression": {"and": [{"or": [{"equals": ["@coalesce(triggerbody()?["jobrecurrence"]?["endtime"],-1)", -1]}, {"less": ["@variables('nexttime')", "@{triggerbody()?["jobrecurrence"]?["endtime"]}"]}]}, {"or": [{"equals": ["@coalesce(triggerbody()?["jobrecurrence"]?["count"],-1)", -1]}, {"greater": ["@coalesce(triggerbody()?["jobrecurrence"]?["count"],1)", "@coalesce(triggerbody()?["jobstatus"]?["executioncount"],0)"]}]}]}, "type": "if"}, "initialize_nexttime": {"runafter": {"initialize_starttime": ["succeeded"]}, "type": "initializevariable", "inputs": {"variables": [{"name": "nexttime", "type": "string", "value": "@{addtotime(coalesce(triggerbody()?["jobstatus"]?["lastexecutiontime"],variables('starttime')),triggerbody()["jobrecurrence"]["interval"],triggerbody()["jobrecurrence"]["frequency"])}"}]}}, "initialize_starttime": {"type": "initializevariable", "inputs": {"variables": [{"name": "starttime", "type": "string", "value": "@{if(less(coalesce(triggerbody()?["starttime"],utcnow()),utcnow()),utcnow(),coalesce(triggerbody()?["starttime"],utcnow()))}"}]}}}}}}{"name": "[parameters('timerjoblogicappname')]", "type": "microsoft.logic/workflows", "location": "[parameters('location')]", "tags": {"displayname": "logicapp"}, "apiversion": "2019-05-01", "properties": {"state": "enabled", "definition": {"$schema": "https://schema.management.azure.com/providers/microsoft.logic/schemas/2016-06-01/workflowdefinition.json#", "contentversion": "1.0.0.0", "triggers": {"manual": {"correlation": {"clienttrackingid": "@triggerbody()["timerjobid"]"}, "type": "request", "kind": "http", "inputs": {"schema": {"properties": {"jobrecurrence": {"properties": {"count": {"minimum": -1, "title": "count (jobrecurrence)", "type": "integer"}, "endtime": {"title": "endtime (jobrecurrence)", "type": "string"}, "frequency": {"enum": ["second", "minute", "hour", "day", "week", "month"], "title": "frequency (jobrecurrence)", "type": "string"}, "interval": {"title": "interval (jobrecurrence)", "type": "integer"}}, "required": ["frequency", "interval"], "type": "object"}, "jobstatus": {"properties": {"executioncount": {"title": "executioncount (jobstatus)", "type": "integer"}, "faultedcount": {"title": "faultedcount (jobstatus)", "type": "integer"}, "lastexecutiontime": {"title": "lastexecutiontime (jobstatus)", "type": "string"}, "nextexecutiontime": {"title": "nextexecutiontime (jobstatus)", "type": "string"}}, "required": ["nextexecutiontime"], "type": "object"}, "starttime": {"type": "string"}, "timerjobid": {"type": "string"}}, "required": ["timerjobid", "jobrecurrence", "jobstatus"], "type": "object"}}}}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/availabilitysets", "name": "[variables('availabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 5}}{"apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines", "name": "[concat(variables('vmname'),copyindex())]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/",variables('newstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", concat(variables('nicname'), copyindex()))]", "[resourceid('microsoft.compute/availabilitysets/",variables('availabilitysetname'))]", "[resourceid('microsoft.compute/virtualmachines/extensions", concat(variables('vmname'),"db'),"newuserscript')]"], "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets",variables('availabilitysetname'))]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[concat(variables('vmname'),copyindex())]", "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('ubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmname'),copyindex(),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat(variables('nicname'),copyindex()))]"}]}}, "copy": {"name": "virtualmachinescopy", "count": "[parameters('webvmcount')]"}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'),copyindex(),"/newuserscript')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", concat(variables('vmname'), copyindex()))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('installfrontendscripturi')]"]}, "protectedsettings": {"commandtoexecute": "[concat(variables('installfrontendcommand'), " ",listkeys(resourceid('microsoft.storage/storageaccounts", variables('newstorageaccountname')), "2016-01-01').keys[0].value, " ",reference(resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname')),"2015-06-15').dnssettings.fqdn, " ",reference(resourceid('microsoft.network/publicipaddresses",variables('publicdbipaddressname')),"2015-06-15').dnssettings.fqdn, " ",parameters('fullnameofsite'), " ",parameters('shortnameofsite'), " ",parameters('iomadadminusername'), " ",parameters('iomadadminpassword'), " ",parameters('iomadadminemail'))]"}}, "copy": {"name": "extensionscopy", "count": "[parameters('webvmcount')]"}}{"type": "microsoft.compute/availabilitysets", "name": "[concat(variables('availabilitysetname'),"db')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 5}}{"apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines", "name": "[concat(variables('vmname'),"db')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('newstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", concat(variables('nicname'),"db'))]", "[resourceid('microsoft.compute/availabilitysets/", concat(variables('availabilitysetname'),"db'))]"], "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets",concat(variables('availabilitysetname'),"db'))]"}, "hardwareprofile": {"vmsize": "[parameters('vmsizedb')]"}, "osprofile": {"computername": "[concat(variables('vmname'),"db')]", "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('ubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmname'),"db","_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat(variables('nicname'),"db'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'),"db","/newuserscript')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", concat(variables('vmname'),"db'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('installbackendscripturi')]"]}, "protectedsettings": {"commandtoexecute": "[concat(variables('installbackendcommand'), " ",listkeys(resourceid('microsoft.storage/storageaccounts", variables('newstorageaccountname')), "2016-01-01').keys[0].value)]"}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "name": "[concat(variables('storageaccountname'), copyindex())]", "apiversion": "2021-02-01", "location": "[parameters('location')]", "copy": {"name": "storageloop", "count": "[parameters('agentvmcount')]"}, "sku": {"name": "standard_lrs"}, "kind": "storage", "properties": {}}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["10.0.0.0/16"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "10.0.2.0/24"}}]}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[concat(variables('networkinterfacename'), copyindex())]", "location": "[parameters('location')]", "copy": {"name": "nicloop", "count": "[variables('numberofinstances')]"}, "dependson": ["[variables('virtualnetworkname')]", "[variables('loadbalancername')]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('subnetref')]"}, "loadbalancerbackendaddresspools": [{"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('loadbalancername'), "backendpool1')]"}]}}]}}{"type": "microsoft.network/loadbalancers", "apiversion": "2020-06-01", "name": "[variables('loadbalancername')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "dependson": ["[variables('virtualnetworkname')]"], "properties": {"frontendipconfigurations": [{"properties": {"subnet": {"id": "[variables('subnetref')]"}, "privateipaddress": "10.0.2.6", "privateipallocationmethod": "static"}, "name": "loadbalancerfrontend"}], "backendaddresspools": [{"name": "backendpool1"}], "loadbalancingrules": [{"properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('loadbalancername'), "loadbalancerfrontend')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('loadbalancername'), "backendpool1')]"}, "probe": {"id": "[resourceid('microsoft.network/loadbalancers/probes", variables('loadbalancername'), "lbprobe')]"}, "protocol": "tcp", "frontendport": 80, "backendport": 80, "idletimeoutinminutes": 15}, "name": "lbrule"}], "probes": [{"properties": {"protocol": "tcp", "port": 80, "intervalinseconds": 15, "numberofprobes": 2}, "name": "lbprobe"}]}}
This template adds and secures a custom domain to your Front Door with a customer-managed certificate.
{"type": "microsoft.network/frontdoors", "apiversion": "2020-01-01", "name": "[parameters('frontdoorname')]", "location": "global", "properties": {"enabledstate": "enabled", "frontendendpoints": [{"name": "[variables('frontendendpointdefaultname')]", "properties": {"hostname": "[variables('frontendendpointdefaulthostname')]", "sessionaffinityenabledstate": "disabled"}}, {"name": "[variables('frontendendpointcustomname')]", "properties": {"hostname": "[parameters('customdomainname')]", "sessionaffinityenabledstate": "disabled"}}], "loadbalancingsettings": [{"name": "[variables('loadbalancingsettingsname')]", "properties": {"samplesize": 4, "successfulsamplesrequired": 2}}], "healthprobesettings": [{"name": "[variables('healthprobesettingsname')]", "properties": {"path": "/", "protocol": "http", "intervalinseconds": 120}}], "backendpools": [{"name": "[variables('backendpoolname')]", "properties": {"backends": [{"address": "[parameters('backendaddress')]", "backendhostheader": "[parameters('backendaddress')]", "httpport": 80, "httpsport": 443, "weight": 50, "priority": 1, "enabledstate": "enabled"}], "loadbalancingsettings": {"id": "[resourceid('microsoft.network/frontdoors/loadbalancingsettings", parameters('frontdoorname'), variables('loadbalancingsettingsname'))]"}, "healthprobesettings": {"id": "[resourceid('microsoft.network/frontdoors/healthprobesettings", parameters('frontdoorname'), variables('healthprobesettingsname'))]"}}}], "routingrules": [{"name": "[variables('routingrulename')]", "properties": {"frontendendpoints": [{"id": "[resourceid('microsoft.network/frontdoors/frontendendpoints", parameters('frontdoorname'), variables('frontendendpointdefaultname'))]"}, {"id": "[resourceid('microsoft.network/frontdoors/frontendendpoints", parameters('frontdoorname'), variables('frontendendpointcustomname'))]"}], "acceptedprotocols": ["http", "https"], "patternstomatch": ["/*"], "routeconfiguration": {"@odata.type": "#microsoft.azure.frontdoor.models.frontdoorforwardingconfiguration", "forwardingprotocol": "matchrequest", "backendpool": {"id": "[resourceid('microsoft.network/frontdoors/backendpools", parameters('frontdoorname'), variables('backendpoolname'))]"}}, "enabledstate": "enabled"}}]}}{"type": "microsoft.network/frontdoors/frontendendpoints/customhttpsconfiguration", "apiversion": "2020-07-01", "name": "[format('{0}/{1}/{2}", parameters('frontdoorname'), variables('frontendendpointcustomname'), "default')]", "properties": {"protocoltype": "servernameindication", "certificatesource": "azurekeyvault", "keyvaultcertificatesourceparameters": {"vault": {"id": "[parameters('certificatekeyvaultresourceid')]"}, "secretname": "[parameters('certificatekeyvaultsecretname')]", "secretversion": "[if(equals(parameters('certificatekeyvaultsecretversion'), "'), null(), parameters('certificatekeyvaultsecretversion'))]"}, "minimumtlsversion": "1.2"}, "dependson": ["[resourceid('microsoft.network/frontdoors", parameters('frontdoorname'))]"]}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2019-12-01", "type": "microsoft.compute/availabilitysets", "name": "[variables('availabilitysetname')]", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": "[variables('platformfaultdomaincount')]", "platformupdatedomaincount": "[variables('platformupdatedomaincount')]"}}{"apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines", "name": "[concat(parameters('dnslabelforvmip'), copyindex())]", "location": "[parameters('location')]", "copy": {"name": "virtualmachineloop", "count": "[variables('numberofinstances')]"}, "dependson": ["[concat('microsoft.network/networkinterfaces/", concat(parameters('vmandloadbalancerexposure'),variables('nicname'), copyindex()))]", "[concat('microsoft.compute/availabilitysets/", variables('availabilitysetname'))]"], "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets", variables('availabilitysetname'))]"}, "hardwareprofile": {"vmsize": "[if(equals(copyindex(), variables('monitornodeindex')), parameters('monitornodevmsize'), parameters('messageroutingnodevmsize'))]"}, "osprofile": {"computername": "[concat(parameters('dnslabelforvmip'), copyindex())]", "adminusername": "[parameters('vmadminusername')]", "adminpassword": "[parameters('vmadminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[parameters('centosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnslabelforvmip'), copyindex(), "_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}, "datadisks": "[variables('datadiskschoices')[if(or(equals(parameters('datadisksize'), "0'), equals(copyindex(), variables('monitornodeindex'))), "2", string(copyindex()))]]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(parameters('vmandloadbalancerexposure'),variables('nicname'), copyindex()))]"}]}}}{"apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnslabelforvmip'), copyindex(), "/dockerextension')]", "location": "[parameters('location')]", "copy": {"name": "dockerloop", "count": "[variables('numberofinstances')]"}, "dependson": ["[concat('microsoft.compute/virtualmachines/", parameters('dnslabelforvmip'), copyindex())]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "dockerextension", "typehandlerversion": "1.0", "autoupgrademinorversion": true, "settings": {}}}{"condition": "[not(empty(parameters('workspacename')))]", "apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnslabelforvmip'), copyindex(), "/omsagentextension')]", "location": "[parameters('location')]", "copy": {"name": "omsagentloop", "count": "[variables('numberofinstances')]"}, "dependson": ["[concat('microsoft.compute/virtualmachines/", parameters('dnslabelforvmip'), copyindex(), "/extensions/dockerextension')]", "[concat('microsoft.resources/deployments/", variables('solaceworkspacename'))]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.4", "settings": {"workspaceid": "[if(empty(parameters('workspacename')), "", reference(variables('solaceworkspacename')).outputs.workspaceid.value)]"}, "protectedsettings": {"workspacekey": "[if(empty(parameters('workspacename')), "", reference(variables('solaceworkspacename')).outputs.workspacekey.value)]"}}}{"apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnslabelforvmip'), copyindex(), "/configuresolacecontainer')]", "location": "[parameters('location')]", "copy": {"name": "solaceloop", "count": "[variables('numberofinstances')]"}, "dependson": ["[if(empty(parameters('workspacename')), concat('microsoft.compute/virtualmachines/", parameters('dnslabelforvmip'), copyindex(), "/extensions/dockerextension'), concat('microsoft.compute/virtualmachines/", parameters('dnslabelforvmip'), copyindex(), "/extensions/omsagentextension'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('solaceinstallscriptfileuri')]", "[variables('sempqueryscriptfileuri')]"]}, "protectedsettings": {"commandtoexecute": "[concat('mkdir -p -m 770 ", variables('adminpassworddir'), "; echo ", parameters('solaceadminpassword'), " > ", variables('adminpasswordfile'), "; bash ", variables('solaceinstallscriptname'), " -c ", copyindex(), " -d ", parameters('dnslabelforvmip'), " -i ", variables('numberofinstances'), " -p ", variables('adminpasswordfile'), " -n ", parameters('maxnumberofclientconnections'), " -q ", parameters('maxnumberofqueuemessages'), " -s ", if(equals(copyindex(), variables('monitornodeindex')), "0", parameters('datadisksize')), if(empty(parameters('workspacename')), "", concat(' -w ", reference(variables('solaceworkspacename')).outputs.workspaceid.value)), " -u ", parameters('brokerdockerimagereference'))]"}}}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "default-allow-3389", "properties": {"priority": 1000, "access": "allow", "direction": "inbound", "destinationportrange": "3389", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}]}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2015-05-01-preview", "type": "microsoft.network/networkinterfaces", "name": "[concat('niczoo", copyindex())]", "location": "[parameters('location')]", "copy": {"name": "nicloop", "count": "[variables('numberofzookeeperinstances')]"}, "dependson": ["[resourceid('microsoft.resources/deployments/", "shared-resources')]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "static", "privateipaddress": "[concat(parameters('kafkazoonodeipaddressprefix'), copyindex())]", "subnet": {"id": "[variables('subnetref')]"}}}]}}{"apiversion": "2015-05-01-preview", "type": "microsoft.network/networkinterfaces", "name": "[concat('nic", copyindex())]", "location": "[parameters('location')]", "copy": {"name": "nicloop", "count": "[variables('numberofkafkainstances')]"}, "dependson": ["[resourceid('microsoft.resources/deployments/", "shared-resources')]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "static", "privateipaddress": "[concat(parameters('kafkanodeipaddressprefix'), copyindex())]", "subnet": {"id": "[variables('subnetref')]"}}}]}}
This template disables encryption on a running Windows VM Scale Set
{"type": "microsoft.compute/virtualmachinescalesets/extensions", "name": "[concat(parameters('vmssname'),"/", "azurediskencryption')]", "location": "[parameters('location')]", "apiversion": "2020-12-01", "properties": {"publisher": "microsoft.azure.security", "type": "azurediskencryption", "typehandlerversion": "2.2", "autoupgrademinorversion": true, "forceupdatetag": "[parameters('forceupdatetag')]", "settings": {"encryptionoperation": "disableencryption", "volumetype": "[parameters('volumetype')]"}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2015-06-15", "type": "microsoft.compute/availabilitysets", "name": "[variables('ossavailabilitysetsettings').name]", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": "[variables('ossavailabilitysetsettings').faultdomaincount]", "platformupdatedomaincount": "[variables('ossavailabilitysetsettings').updatedomaincount]"}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "name": "[variables('diagstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('storageaccounttype')]"}, "kind": "storagev2"}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "mysql", "type": "microsoft.resources/deployments", "apiversion": "2020-10-01", "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat('nested/mysql-replication.json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"location": {"value": "[parameters('location')]"}, "dnsname": {"value": "[parameters('dnsname')]"}, "vmusername": {"value": "[parameters('vmusername')]"}, "mysqlrootpassword": {"value": "[parameters('mysqlrootpassword')]"}, "mysqlreplicationpassword": {"value": "[parameters('mysqlreplicationpassword')]"}, "mysqlprobepassword": {"value": "[parameters('mysqlprobepassword')]"}, "vmsize": {"value": "[parameters('vmsize')]"}, "virtualnetworkname": {"value": "[parameters('virtualnetworkname')]"}, "vnetneworexisting": {"value": "[parameters('vnetneworexisting')]"}, "dbsubnetname": {"value": "[parameters('dbsubnetname')]"}, "vnetaddressprefix": {"value": "[parameters('vnetaddressprefix')]"}, "dbsubnetaddressprefix": {"value": "[parameters('dbsubnetaddressprefix')]"}, "dbsubnetstartaddress": {"value": "[parameters('dbsubnetstartaddress')]"}, "imagepublisher": {"value": "[parameters('imagepublisher')]"}, "imageoffer": {"value": "[parameters('imageoffer')]"}, "imagesku": {"value": "[parameters('imagesku')]"}, "mysqlfrontendport0": {"value": "[parameters('mysqlfrontendport0')]"}, "mysqlfrontendport1": {"value": "[parameters('mysqlfrontendport1')]"}, "sshnatrulefrontendport0": {"value": "[parameters('sshnatrulefrontendport0')]"}, "sshnatrulefrontendport1": {"value": "[parameters('sshnatrulefrontendport1')]"}, "mysqlprobeport0": {"value": "[parameters('mysqlprobeport0')]"}, "mysqlprobeport1": {"value": "[parameters('mysqlprobeport1')]"}, "publicipname": {"value": "[parameters('publicipname')]"}, "authenticationtype": {"value": "[parameters('authenticationtype')]"}, "adminpasswordorkey": {"value": "[parameters('adminpasswordorkey')]"}, "_artifactslocation": {"value": "[parameters('_artifactslocation')]"}, "_artifactslocationsastoken": {"value": "[parameters('_artifactslocationsastoken')]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces/", variables('networkinterfacename'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "[variables('osdisktype')]"}}, "imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "18.04-lts", "version": "latest"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]"}]}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminkey')]", "linuxconfiguration": {"disablepasswordauthentication": true, "ssh": {"publickeys": [{"path": "[concat('/home/", parameters('adminusername'), "/.ssh/authorized_keys')]", "keydata": "[parameters('adminkey')]"}]}}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2020-12-01", "type": "microsoft.compute/virtualmachines", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('newstorageaccountname'))]", "[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": "[parameters('ubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2020-11-01", "type": "microsoft.network/networksecuritygroups", "name": "[variables('vmnsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "ssh", "properties": {"description": "allows ssh traffic", "protocol": "tcp", "sourceportrange": "22", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}}{"apiversion": "2020-11-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('vmpipname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "static"}}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/virtualnetworks", "apiversion": "2021-02-01", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]"}}]}}{"type": "microsoft.network/publicipprefixes", "apiversion": "2021-02-01", "name": "[variables('publicipprefixname')]", "location": "[parameters('location')]", "sku": {"name": "standard", "tier": "regional"}, "properties": {"prefixlength": "[parameters('publicipprefixlength')]", "publicipaddressversion": "ipv4"}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2021-02-01", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "sku": {"name": "standard", "tier": "regional"}, "properties": {"publicipallocationmethod": "static", "dnssettings": {"domainnamelabel": "[parameters('dnsname')]"}}}{"type": "microsoft.network/loadbalancers", "apiversion": "2020-05-01", "name": "[variables('loadbalancername')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"frontendipconfigurations": [{"name": "loadbalancerfrontend", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"}}}], "backendaddresspools": [{"name": "[variables('bepoolname')]"}], "inboundnatpools": [{"name": "[variables('natpoolname')]", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('loadbalancername'), "loadbalancerfrontend')]"}, "protocol": "tcp", "frontendportrangestart": "[variables('natstartport')]", "frontendportrangeend": "[variables('natendport')]", "backendport": "[variables('natbackendport')]"}}]}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"]}
Enable Azure Sentinel
{"name": "[variables('omssolutions').customsolution.solutionname]", "type": "microsoft.operationsmanagement/solutions", "apiversion": "2015-11-01-preview", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.operationalinsights/workspaces/", parameters('omsworkspacename'))]", "[resourceid('microsoft.operationalinsights/workspaces/views", parameters('omsworkspacename'), variables('omssolutions').customsolution.name)]", "[resourceid('microsoft.automation/automationaccounts/schedules", parameters('omsautomationaccountname'), variables('assets').runbooks.schedulerunbook.ingestschedulename)]"], "plan": {"name": "[variables('omssolutions').customsolution.solutionname]", "product": "[variables('omssolutions').customsolution.name]", "publisher": "[variables('omssolutions').customsolution.publisher]", "promotioncode": ""}, "properties": {"workspaceresourceid": "[resourceid('microsoft.operationalinsights/workspaces/", parameters('omsworkspacename'))]", "referencedresources": ["[resourceid('microsoft.automation/automationaccounts/variables/", parameters('omsautomationaccountname'), variables('assets').aavariables.azuresubscriptionid.name)]", "[resourceid('microsoft.automation/automationaccounts/variables/", parameters('omsautomationaccountname'), variables('assets').aavariables.omsworkspaceid.name)]", "[resourceid('microsoft.automation/automationaccounts/variables/", parameters('omsautomationaccountname'), variables('assets').aavariables.omsworkspacekey.name)]"], "containedresources": ["[resourceid('microsoft.operationalinsights/workspaces/views/", parameters('omsworkspacename'), variables('omssolutions').customsolution.name)]"]}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2015-06-15", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforpublicip')]"}}}{"comments": "simple network security group for subnet [variables('subnetname')]", "type": "microsoft.network/networksecuritygroups", "apiversion": "2019-08-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "default-allow-22", "properties": {"priority": 1000, "access": "allow", "direction": "inbound", "destinationportrange": "22", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}]}}{"apiversion": "2020-07-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"], "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}{"apiversion": "2020-07-01", "type": "microsoft.network/networkinterfaces", "name": "[variables('nicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]", "[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname'))]"}, "subnet": {"id": "[variables('subnetref')]"}}}]}}
This template creates an Azure storage account and multiple file shares.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "kind": "storagev2", "sku": {"name": "standard_lrs"}, "properties": {"accesstier": "hot"}}{"copy": {"name": "fileshares", "count": "[length(range(0, parameters('sharecopy')))]"}, "type": "microsoft.storage/storageaccounts/fileservices/shares", "apiversion": "2021-04-01", "name": "[format('{0}/default/{1}{2}", parameters('storageaccountname'), parameters('shareprefix'), range(0, parameters('sharecopy'))[copyindex()])]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"]}
This template deploys a Service Bus namespace, a topic, and a subscription.
{"apiversion": "2018-01-01-preview", "name": "[parameters('service_busnamespace_name')]", "type": "microsoft.servicebus/namespaces", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('servicebustopicname')]", "type": "topics", "dependson": ["[resourceid('microsoft.servicebus/namespaces/", parameters('service_busnamespace_name'))]"], "properties": {"defaultmessagetimetolive": "p10675199dt2h48m5.4775807s", "maxsizeinmegabytes": 1024, "requiresduplicatedetection": false, "duplicatedetectionhistorytimewindow": "pt10m", "enablebatchedoperations": false, "supportordering": false, "autodeleteonidle": "p10675199dt2h48m5.4775807s", "enablepartitioning": false, "enableexpress": false}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('servicebussubscriptionname')]", "type": "subscriptions", "dependson": ["[parameters('servicebustopicname')]"], "properties": {"lockduration": "pt1m", "requiressession": false, "defaultmessagetimetolive": "p10675199dt2h48m5.4775807s", "deadletteringonmessageexpiration": false, "maxdeliverycount": 10, "enablebatchedoperations": false, "autodeleteonidle": "p10675199dt2h48m5.4775807s"}}]}]}
Provision a Mobile App with a SQL Database
{"type": "microsoft.web/serverfarms", "apiversion": "2019-08-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('hostingplansettings').skuname]", "tier": "[parameters('hostingplansettings').tier]", "capacity": "[parameters('hostingplansettings').capacity]"}, "properties": {"numberofworkers": 1}}{"apiversion": "2019-08-01", "type": "microsoft.web/sites", "name": "[variables('uniqueappname')]", "location": "[parameters('location')]", "kind": "mobileapp", "properties": {"name": "[variables('uniqueappname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "dependson": ["[variables('hostingplanname')]"], "resources": [{"apiversion": "2019-08-01", "name": "appsettings", "type": "config", "dependson": ["[variables('uniqueappname')]"], "properties": {"ms_mobileservicename": "[variables('uniqueappname')]", "ms_notificationhubname": "[variables('notificationhubname')]"}}, {"apiversion": "2019-08-01", "name": "connectionstrings", "type": "config", "dependson": ["[variables('uniqueappname')]", "[variables('notificationhubname')]", "[variables('databasename')]"], "properties": {"ms_tableconnectionstring": {"value": "[concat('data source=tcp:", reference(resourceid('microsoft.sql/servers", variables('databaseservername'))).fullyqualifieddomainname, ",1433;initial catalog=", variables('databasename'), ";user id=", parameters('sqlserveradminlogin'), "@", variables('databaseservername'), ";password=", parameters('sqlserveradminpassword'), ";')]", "type": "sqlserver"}, "ms_notificationhubconnectionstring": {"value": "[listkeys(resourceid('microsoft.notificationhubs/namespaces/notificationhubs/authorizationrules", variables('notificationhubnamespace'), variables('notificationhubname'), "defaultfullsharedaccesssignature'), "2017-04-01').primaryconnectionstring]", "type": "custom"}}}, {"apiversion": "2019-08-01", "type": "providers/links", "name": "microsoft.resources/sitetohub", "dependson": ["[variables('uniqueappname')]", "[variables('notificationhubname')]"], "properties": {"targetid": "[resourceid('microsoft.notificationhubs/namespaces/notificationhubs", variables('notificationhubnamespace'), variables('notificationhubname'))]"}}]}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('vnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetaddressprefix')]", "delegations": [{"name": "delegation", "properties": {"servicename": "microsoft.web/serverfarms"}}]}}]}}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('networksettings').virtualnetworkaddressprefix]"]}, "subnets": [{"name": "default", "properties": {"addressprefix": "[variables('networksettings').subnetaddressprefix]"}}]}}
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": "2014-06-01", "name": "[variables('appserviceplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "properties": {"name": "[variables('appserviceplanname')]", "appservicetier": "[parameters('appservicetier')]", "workersize": "[parameters('appserviceworkersize')]", "numberofworkers": 1}}{"apiversion": "2015-02-01", "name": "[parameters('appname')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "tags": {"[concat('hidden-related:", "/subscriptions/", subscription().subscriptionid,"/resourcegroups/", resourcegroup().name, "/providers/microsoft.web/serverfarms/", variables('appserviceplanname'))]": "empty"}, "dependson": ["[resourceid('microsoft.web/serverfarms/", variables('appserviceplanname'))]"], "properties": {"name": "[parameters('appname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms/", variables('appserviceplanname'))]"}, "resources": [{"apiversion": "2014-06-01", "name": "msdeploy", "type": "extensions", "dependson": ["[resourceid('microsoft.web/sites/", parameters('appname'))]", "[resourceid('microsoft.web/sites/config", parameters('appname'), "web')]", "[resourceid('microsoft.sql/servers/databases", parameters('dbservername'), parameters('dbname'))]", "[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]"], "properties": {"packageuri": "[parameters('packageuri')]", "dbtype": "sql", "connectionstring": "[concat('data source=tcp:", reference(resourceid('microsoft.sql/servers/", parameters('dbservername'))).fullyqualifieddomainname, ",1433;initial catalog=", parameters('dbname'), ";user id=", parameters('dbadministratorlogin'), "@", parameters('dbservername'), ";password=", parameters('dbadministratorloginpassword'), ";')]", "setparameters": {"application path": "[parameters('appname')]", "database server": "[reference(resourceid('microsoft.sql/servers/", parameters('dbservername'))).fullyqualifieddomainname]", "database name": "[parameters('dbname')]", "database username": "[parameters('nonadmindatabaseusername')]", "database password": "[parameters('nonadmindatabasepassword')]", "database administrator": "[parameters('dbadministratorlogin')]", "database administrator password": "[parameters('dbadministratorloginpassword')]", "azurestoragerooturl": "[format('https://{0}.blob.{1}",variables('storageaccountname'), environment().suffixes.storage)]", "azurestoragecontainername": "media", "azurestorageconnectionstring": "[concat('defaultendpointsprotocol=https;accountname=",variables('storageaccountname'),";accountkey=",concat(listkeys(variables('storageaccountname'),"2021-04-01').keys[0].value))]", "rediscachehost": "[concat(parameters('rediscachename'), ".redis.cache.windows.net')]", "rediscacheport": "6379", "rediscacheaccesskey": "[listkeys(resourceid('microsoft.cache/redis", parameters('rediscachename')), "2020-06-01').primarykey]", "azurestoragecachecontrol": "*|public, max-age=31536000;js|no-cache"}}}, {"apiversion": "2020-12-01", "name": "connectionstrings", "type": "config", "dependson": ["[resourceid('microsoft.web/sites", parameters('appname'))]", "[resourceid('microsoft.sql/servers/databases", parameters('dbservername'), parameters('dbname'))]", "[resourceid('microsoft.web/sites/extensions", parameters('appname'), "msdeploy')]"], "properties": {"defaultconnection": {"value": "[concat('data source=tcp:", reference(resourceid('microsoft.sql/servers/", parameters('dbservername'))).fullyqualifieddomainname, ",1433;initial catalog=", parameters('dbname'), ";user id=", parameters('dbadministratorlogin'), "@", parameters('dbservername'), ";password=", parameters('dbadministratorloginpassword'), ";')]", "type": "sqlazure"}}}, {"apiversion": "2020-12-01", "name": "web", "type": "config", "dependson": ["[resourceid('microsoft.web/sites/", parameters('appname'))]"], "properties": {"phpversion": "off", "netframeworkversion": "v4.5", "use32bitworkerprocess": "true", "websocketsenabled": true, "alwayson": "true", "httploggingenabled": true, "logsdirectorysizelimit": 40}}]}{"apiversion": "2015-02-01", "name": "[variables('umbracoadminwebappname')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "tags": {"[concat('hidden-related:", "/subscriptions/", subscription().subscriptionid,"/resourcegroups/", resourcegroup().name, "/providers/microsoft.web/serverfarms/", variables('appserviceplanname'))]": "empty"}, "dependson": ["[resourceid('microsoft.web/serverfarms/", variables('appserviceplanname'))]"], "properties": {"name": "[variables('umbracoadminwebappname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms/", variables('appserviceplanname'))]"}, "resources": [{"apiversion": "2014-06-01", "name": "msdeploy", "type": "extensions", "dependson": ["[resourceid('microsoft.web/sites/", variables('umbracoadminwebappname'))]", "[resourceid('microsoft.web/sites/config",variables('umbracoadminwebappname'), "web')]", "[resourceid('microsoft.sql/servers/databases", parameters('dbservername'), parameters('dbname'))]", "[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]"], "properties": {"packageuri": "[parameters('packageuri')]", "dbtype": "sql", "connectionstring": "[concat('data source=tcp:", reference(resourceid('microsoft.sql/servers/", parameters('dbservername'))).fullyqualifieddomainname, ",1433;initial catalog=", parameters('dbname'), ";user id=", parameters('dbadministratorlogin'), "@", parameters('dbservername'), ";password=", parameters('dbadministratorloginpassword'), ";')]", "setparameters": {"application path": "[variables('umbracoadminwebappname')]", "database server": "[reference(resourceid('microsoft.sql/servers/", parameters('dbservername'))).fullyqualifieddomainname]", "database name": "[parameters('dbname')]", "database username": "[concat(parameters('nonadmindatabaseusername'),"admin')]", "database password": "[parameters('nonadmindatabasepassword')]", "database administrator": "[parameters('dbadministratorlogin')]", "database administrator password": "[parameters('dbadministratorloginpassword')]", "azurestoragerooturl": "[format('https://{0}.blob.{1}",variables('storageaccountname'), environment().suffixes.storage)]", "azurestoragecontainername": "media", "azurestorageconnectionstring": "[concat('defaultendpointsprotocol=https;accountname=",variables('storageaccountname'),";accountkey=",concat(listkeys(variables('storageaccountname'),"2021-04-01').keys[0].value))]", "rediscachehost": "[concat(parameters('rediscachename'), ".redis.cache.windows.net')]", "rediscacheport": "6379", "rediscacheaccesskey": "[listkeys(resourceid('microsoft.cache/redis", parameters('rediscachename')), "2020-06-01').primarykey]", "azurestoragecachecontrol": "*|public, max-age=31536000;js|no-cache"}}}, {"apiversion": "2020-12-01", "name": "connectionstrings", "type": "config", "dependson": ["[resourceid('microsoft.web/sites", variables('umbracoadminwebappname'))]", "[resourceid('microsoft.sql/servers/databases", parameters('dbservername'), parameters('dbname'))]", "[resourceid('microsoft.web/sites/extensions", variables('umbracoadminwebappname'), "msdeploy')]"], "properties": {"defaultconnection": {"value": "[concat('data source=tcp:", reference(resourceid('microsoft.sql/servers/", parameters('dbservername'))).fullyqualifieddomainname, ",1433;initial catalog=", parameters('dbname'), ";user id=", parameters('dbadministratorlogin'), "@", parameters('dbservername'), ";password=", parameters('dbadministratorloginpassword'), ";')]", "type": "sqlazure"}}}, {"apiversion": "2020-12-01", "name": "web", "type": "config", "dependson": ["[resourceid('microsoft.web/sites/", variables('umbracoadminwebappname'))]"], "properties": {"phpversion": "off", "netframeworkversion": "v4.5", "use32bitworkerprocess": "true", "websocketsenabled": true, "alwayson": "true", "httploggingenabled": true, "logsdirectorysizelimit": 40}}]}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"sku": {"name": "standard_lrs"}, "type": "microsoft.storage/storageaccounts", "location": "[parameters('location')]", "apiversion": "2021-04-01", "name": "[variables('storageaccountname')]"}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/networksecuritygroups", "apiversion": "2019-07-01", "name": "[parameters('networksecuritygroup_name')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "rdp", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 300, "direction": "inbound"}}]}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2019-07-01", "name": "[concat(parameters('virtualnetwork_name'), "/default')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetwork_name'))]"], "properties": {"addressprefix": "10.0.4.0/24", "privateendpointnetworkpolicies": "enabled", "privatelinkservicenetworkpolicies": "enabled"}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachinescalesets", "apiversion": "2020-06-01", "name": "[parameters('vmssname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('diagnosticsstorageaccountname'))]", "[resourceid('microsoft.network/loadbalancers", variables('loadbalancername'))]", "mysql"], "sku": {"name": "[parameters('drupalvmsku')]", "tier": "standard", "capacity": "[parameters('instancecount')]"}, "properties": {"overprovision": true, "upgradepolicy": {"mode": "manual"}, "virtualmachineprofile": {"storageprofile": {"osdisk": {"caching": "readonly", "createoption": "fromimage", "manageddisk": {"storageaccounttype": "[parameters('drupalvmdisksku')]"}}, "imagereference": "[variables('imagereference')]"}, "osprofile": {"computernameprefix": "[parameters('vmssname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaceconfigurations": [{"name": "[variables('nicname')]", "properties": {"primary": true, "ipconfigurations": [{"name": "[variables('ipconfigname')]", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]"}, "loadbalancerbackendaddresspools": [{"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('loadbalancername'), variables('bepoolname'))]"}], "loadbalancerinboundnatpools": [{"id": "[resourceid('microsoft.network/loadbalancers/inboundnatpools", variables('loadbalancername'), variables('natpoolname'))]"}]}}]}}]}, "extensionprofile": {"extensions": [{"name": "drupalextension", "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('scripts/mount-azure-fileshare.sh", parameters('_artifactslocationsastoken')))]", "[uri(parameters('_artifactslocation'), concat('scripts/install_drupal.sh", parameters('_artifactslocationsastoken')))]"]}, "protectedsettings": {"commandtoexecute": "[format('bash mount-azure-fileshare.sh {0} ""{1}"" ""{2}"" ""{3}"" {4} {5};sudo bash install_drupal.sh -d ""{6}"" -u {7} -p ""{8}"" -s ""{9}"" -n {10} -p ""{11}"" -k {12} -z {13} -s {14}", parameters('storageaccountname'), listkeys(parameters('storageaccountname'), "2019-06-01').keys[0].value, parameters('filesharename'), "/mnt/azurefiles-drupal", parameters('adminusername'), environment().suffixes.storage, parameters('drupalversion'), parameters('drupaladminuser'), parameters('drupaladminpassword'), parameters('existingmysqlfqdn'), parameters('mysqluser'), parameters('mysqluserpassword'), parameters('drupalinstallationdatabasename'), parameters('createnewmysqlserver'), reference('mysql').outputs.fqdn.value)]"}}}, {"name": "linuxdiagnostic", "properties": {"publisher": "microsoft.ostcextensions", "type": "linuxdiagnostic", "typehandlerversion": "2.3", "autoupgrademinorversion": true, "settings": {"xmlcfg": "[base64(concat(variables('wadcfgxstart'),variables('wadmetricsresourceid'),variables('wadcfgxend')))]", "storageaccount": "[variables('diagnosticsstorageaccountname')]"}, "protectedsettings": {"storageaccountname": "[variables('diagnosticsstorageaccountname')]", "storageaccountkey": "[listkeys(variables('accountid'), "2019-06-01').keys[0].value]", "storageaccountendpoint": "[concat('http://", environment().suffixes.storage)]"}}}]}}}}
Establish connection to a VNET via an ExpressRoute circuit
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-07-01", "name": "[variables('vnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressprefix')]"]}, "subnets": [{"name": "[variables('subnet1name')]", "properties": {"addressprefix": "[variables('subnet1prefix')]", "privateendpointnetworkpolicies": "disabled"}}, {"name": "[variables('subnetappservicename')]", "properties": {"addressprefix": "[variables('subnetappserviceprefix')]", "delegations": [{"name": "delegation", "properties": {"servicename": "microsoft.web/serverfarms"}}]}}]}}{"type": "microsoft.network/privateendpoints", "apiversion": "2020-07-01", "name": "[variables('privateendpointname')]", "location": "[parameters('location')]", "dependson": ["[variables('vnetname')]", "[variables('sqlservername')]"], "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('subnet1name'))]"}, "privatelinkserviceconnections": [{"name": "[variables('privateendpointname')]", "properties": {"privatelinkserviceid": "[resourceid('microsoft.sql/servers",variables('sqlservername'))]", "groupids": ["sqlserver"]}}]}}
Establish connection to a VNET via an ExpressRoute circuit
{"name": "[variables('clustervnetname')]", "type": "microsoft.network/virtualnetworks", "location": "[parameters('location')]", "apiversion": "2020-07-01", "properties": {"addressspace": {"addressprefixes": ["[parameters('clustervnetaddressspace')]"]}, "subnets": [{"name": "[parameters('clustervnetsubnetname')]", "properties": {"addressprefix": "[parameters('clustervnetsubnetaddressrange')]"}}]}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "shared-resources", "type": "microsoft.resources/deployments", "apiversion": "2016-09-01", "comments": "azure resources that are shared within the infrastructure environment", "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(parameters('_artifactslocation'),"/nested/", variables('sharedresourcestemplatefilename'),parameters('_artifactslocationsastoken'))]", "contentversion": "1.0.0.0"}, "parameters": {"webnsgname": {"value": "[variables('webnsgname')]"}, "datansgname": {"value": "[variables('datansgname')]"}, "virtualnetworkname": {"value": "[variables('virtualnetworkname')]"}, "datasubnetname": {"value": "[variables('datasubnetname')]"}, "websubnetname": {"value": "[variables('websubnetname')]"}, "addressprefix": {"value": "[variables('addressprefix')]"}, "websubnetprefix": {"value": "[variables('websubnetprefix')]"}, "datasubnetprefix": {"value": "[variables('datasubnetprefix')]"}, "remoteallowedcidr": {"value": "[parameters('remoteallowedcidr')]"}, "netapptags": {"value": "[variables('netapptags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "jump-vm", "type": "microsoft.resources/deployments", "apiversion": "2016-09-01", "comments": "jump server deployment", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(parameters('_artifactslocation'),"/nested/", variables('jumpvmtemplatefilename'),parameters('_artifactslocationsastoken'))]", "contentversion": "1.0.0.0"}, "parameters": {"adminusername": {"value": "[parameters('adminusername')]"}, "adminpassword": {"value": "[parameters('adminpassword')]"}, "vnetid": {"value": "[variables('vnetid')]"}, "websubnetname": {"value": "[variables('websubnetname')]"}, "jumpvmname": {"value": "[variables('jumpvmname')]"}, "jumpvmsize": {"value": "[variables('jumpvmsize')]"}, "jumpvmnicname": {"value": "[variables('jumpvmnicname')]"}, "jumpvmpublicipaddressname": {"value": "[variables('jumpvmpublicipaddressname')]"}, "jumpvmdnsname": {"value": "[variables('jumpvmdnsname')]"}, "netapptags": {"value": "[variables('netapptags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "sql-vm", "type": "microsoft.resources/deployments", "apiversion": "2016-09-01", "comments": "sql server deployment", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(parameters('_artifactslocation'),"/nested/", variables('sqlvmtemplatefilename'),parameters('_artifactslocationsastoken'))]", "contentversion": "1.0.0.0"}, "parameters": {"adminusername": {"value": "[parameters('adminusername')]"}, "adminpassword": {"value": "[parameters('adminpassword')]"}, "vnetid": {"value": "[variables('vnetid')]"}, "datasubnetname": {"value": "[variables('datasubnetname')]"}, "sqlvmname": {"value": "[variables('sqlvmname')]"}, "sqlvmnicname": {"value": "[variables('sqlvmnicname')]"}, "sqlvmsize": {"value": "[variables('sqlvmsize')]"}, "_artifactslocation": {"value": "[parameters('_artifactslocation')]"}, "_artifactslocationsastoken": {"value": "[parameters('_artifactslocationsastoken')]"}, "netapptags": {"value": "[variables('netapptags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}
Deploy Azure Sql Database Managed Instance (SQL MI) and JumpBox with SSMS inside new Virtual Network
{"type": "microsoft.sql/managedinstances", "apiversion": "2019-06-01-preview", "dependson": ["[parameters('virtualnetworkname')]"], "identity": {"type": "systemassigned"}, "location": "[parameters('location')]", "name": "[parameters('managedinstancename')]", "sku": {"name": "[parameters('skuname')]"}, "properties": {"administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]", "subnetid": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]", "storagesizeingb": "[parameters('storagesizeingb')]", "vcores": "[parameters('vcores')]", "licensetype": "[parameters('licensetype')]"}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "shared", "type": "microsoft.resources/deployments", "apiversion": "2019-05-10", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('sharedtemplateurl')]", "contentversion": "1.0.0.0"}, "parameters": {"networksettings": {"value": "[variables('networksettings')]"}, "location": {"value": "[parameters('location')]"}}}}{"name": "lamplapnode", "type": "microsoft.resources/deployments", "apiversion": "2019-05-10", "dependson": ["shared"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('lamplaptemplateurl')]", "contentversion": "1.0.0.0"}, "parameters": {"adminusername": {"value": "[parameters('adminusername')]"}, "namespace": {"value": "[variables('namespace')]"}, "vmbasename": {"value": "lap"}, "subnet": {"value": "[variables('networksettings').subnet.dse]"}, "dnsname": {"value": "[parameters('dnsnameprefix')]"}, "staticip": {"value": "[variables('networksettings').statics.lapip]"}, "vmsize": {"value": "[parameters('lapvmsize')]"}, "ossettings": {"value": "[variables('lapossettings')]"}, "authenticationtype": {"value": "[parameters('authenticationtype')]"}, "adminpasswordorkey": {"value": "[parameters('adminpasswordorkey')]"}, "location": {"value": "[parameters('location')]"}}}}{"name": "[concat('lampmysqlnode", copyindex())]", "type": "microsoft.resources/deployments", "apiversion": "2019-05-10", "dependson": ["shared", "lamplapnode"], "copy": {"name": "vmloop", "count": "[parameters('mysqlnodes')]"}, "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('lampmysqltemplateurl')]", "contentversion": "1.0.0.0"}, "parameters": {"adminusername": {"value": "[parameters('adminusername')]"}, "namespace": {"value": "[variables('namespace')]"}, "vmbasename": {"value": "[concat('mysql", copyindex())]"}, "lapnode": {"value": "[variables('networksettings').statics.lapip]"}, "mysqlstaticip": {"value": "[variables('networksettings').statics.mysqlip]"}, "subnet": {"value": "[variables('networksettings').subnet.dse]"}, "vmsize": {"value": "[parameters('mysqlvmsize')]"}, "ossettings": {"value": "[variables('mysqlossettings')]"}, "authenticationtype": {"value": "[parameters('authenticationtype')]"}, "adminpasswordorkey": {"value": "[parameters('adminpasswordorkey')]"}, "location": {"value": "[parameters('location')]"}}}}
This template creates an Application Insights availability test along with a metric alert rule that monitors it.
{"name": "[variables('pingtestname')]", "type": "microsoft.insights/webtests", "apiversion": "2015-05-01", "location": "[parameters('location')]", "tags": {"[concat('hidden-link:", parameters('appinsightsresource'))]": "resource"}, "properties": {"name": "[variables('pingtestname')]", "description": "basic ping test", "enabled": true, "frequency": 300, "timeout": 120, "kind": "ping", "retryenabled": true, "locations": [{"id": "[parameters('webtestlocations')]"}], "configuration": {"webtest": "[concat(\"<webtest name="\", variables(\"pingtestname\'), \"" enabled="true" cssprojectstructure="" cssiteration="" timeout="120" workitemids="" xmlns="http://microsoft.com/schemas/visualstudio/teamtest/2010" description="" credentialusername="" credentialpassword="" preauthenticate="true" proxy="default" stoponerror="false" recordedresultfile="" resultslocale=""> <items> <request method="get" version="1.1" url="\", parameters(\"pingurl\'), \"" thinktime="0" timeout="300" parsedependentrequests="true" followredirects="true" recordresult="true" cache="false" responsetimegoal="0" encoding="utf-8" expectedhttpstatuscode="200" expectedresponseurl="" reportingname="" ignorehttpstatuscode="false" /> </items> <validationrules> <validationrule classname="microsoft.visualstudio.testtools.webtesting.rules.validationrulefindtext, microsoft.visualstudio.qualitytools.webtestframework, version=10.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a" displayname="find text" description="verifies the existence of the specified text in the response." level="high" executionorder="beforedependents"> <ruleparameters> <ruleparameter name="findtext" value="\", parameters(\"pingtext\'), \"" /> <ruleparameter name="ignorecase" value="false" /> <ruleparameter name="useregularexpression" value="false" /> <ruleparameter name="passiftextfound" value="true" /> </ruleparameters> </validationrule> </validationrules> </webtest>\')]"}, "syntheticmonitorid": "[variables('pingtestname')]"}}{"name": "[variables('pingalertrulename')]", "type": "microsoft.insights/metricalerts", "apiversion": "2018-03-01", "location": "global", "dependson": ["[resourceid('microsoft.insights/webtests", variables('pingtestname'))]"], "tags": {"[concat('hidden-link:", parameters('appinsightsresource'))]": "resource", "[concat('hidden-link:", resourceid('microsoft.insights/webtests", variables('pingtestname')))]": "resource"}, "properties": {"description": "alert for web test", "severity": 1, "enabled": true, "scopes": ["[resourceid('microsoft.insights/webtests",variables('pingtestname'))]", "[parameters('appinsightsresource')]"], "evaluationfrequency": "pt1m", "windowsize": "pt5m", "criteria": {"odata.type": "microsoft.azure.monitor.webtestlocationavailabilitycriteria", "webtestid": "[resourceid('microsoft.insights/webtests", variables('pingtestname'))]", "componentid": "[parameters('appinsightsresource')]", "failedlocationcount": 2}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"apiversion": "2019-06-01", "type": "microsoft.storage/storageaccounts", "name": "[variables('newstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}, "kind": "storagev2"}
This template creates a new Azure App Configuration store with one feature flag.
{"type": "microsoft.appconfiguration/configurationstores", "apiversion": "2020-07-01-preview", "name": "[parameters('configstorename')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "resources": [{"type": "keyvalues", "apiversion": "2020-07-01-preview", "name": "[concat('.appconfig.featureflag~2f", parameters('featureflagkey'), "$", parameters('featureflaglabel'))]", "dependson": ["[parameters('configstorename')]"], "properties": {"value": "[string(variables('featureflagvalue'))]", "contenttype": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8"}}]}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", parameters('newstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('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('ubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}
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('appsvcplanname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('svcplansize')]", "tier": "[parameters('svcplansku')]", "capacity": 1}}{"type": "microsoft.web/sites", "apiversion": "2020-12-01", "name": "[parameters('webappname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms/", parameters('appsvcplanname'))]"], "properties": {"name": "[parameters('webappname')]", "serverfarmid": "[parameters('appsvcplanname')]"}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/availabilitysets", "comments": "availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[variables('asetname')]", "apiversion": "2019-12-01", "location": "[variables('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}
Establish connection to a VNET via an ExpressRoute circuit
{"name": "sqvnet", "type": "microsoft.network/virtualnetworks", "location": "[parameters('location')]", "apiversion": "2020-05-01", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", "sqnsgapp')]"], "tags": {"displayname": "sqvnet"}, "properties": {"addressspace": {"addressprefixes": ["[variables('sqvnetprefix')]"]}, "subnets": [{"name": "[variables('sqvnetexternalsubnetname')]", "properties": {"addressprefix": "[variables('sqvnetexternalsubnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", "sqnsgapp')]"}}}]}}{"name": "[variables('sqvmappnicname')]", "type": "microsoft.network/networkinterfaces", "location": "[parameters('location')]", "apiversion": "2020-05-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", "sqvnet')]", "[resourceid('microsoft.network/publicipaddresses", variables('sqpublicipname'))]"], "tags": {"displayname": "sqvmappnic"}, "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('sqvmappsubnetref')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('sqpublicipname'))]"}}}]}}{"name": "[variables('sqpublicipname')]", "type": "microsoft.network/publicipaddresses", "location": "[parameters('location')]", "apiversion": "2020-05-01", "tags": {"displayname": "sqpublicip"}, "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[parameters('sq_publicip_dnsprefix')]"}}}{"name": "sqnsgapp", "type": "microsoft.network/networksecuritygroups", "location": "[parameters('location')]", "apiversion": "2020-05-01", "tags": {"displayname": "sqnsgapp"}, "properties": {"securityrules": [{"name": "allow_rdp_in", "properties": {"description": "allow rdp in", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}, {"name": "allow_https_in", "properties": {"description": "allow https in", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "443", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 101, "direction": "inbound"}}, {"name": "allow_rdp_out", "properties": {"description": "allow rdp out", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "[variables('sqvnetexternalsubnetprefix')]", "destinationaddressprefix": "[variables('sqvnetinternalsubnetprefix')]", "access": "allow", "priority": 100, "direction": "outbound"}}, {"name": "allow_sonarqube_in", "properties": {"description": "allow sonarqube in", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "9000", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 102, "direction": "inbound"}}, {"name": "block_all_in", "properties": {"description": "block everything else", "protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "deny", "priority": 200, "direction": "inbound"}}]}}