Description
stringlengths 21
168
| IaC
stringlengths 158
8.06k
|
---|---|
This template will create N number of VM's with managed disks, public IPs and network interfaces. | {"type": "microsoft.compute/availabilitysets", "apiversion": "2020-06-01", "name": "[parameters('availabilitysetname')]", "location": "[parameters('location')]", "properties": {"platformfaultdomaincount": "[variables('availabilitysetplatformfaultdomaincount')]", "platformupdatedomaincount": "[variables('availabilitysetplatformupdatedomaincount')]"}, "sku": {"name": "aligned"}}{"copy": {"name": "virtualmachines", "count": "[length(range(0, parameters('virtualmachinecount')))]"}, "type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[format('{0}{1}", parameters('virtualmachinenameprefix'), add(range(0, parameters('virtualmachinecount'))[copyindex()], 1))]", "location": "[parameters('location')]", "properties": {"hardwareprofile": {"vmsize": "[parameters('virtualmachinesize')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('operatingsystemvalues')[parameters('operatingsystem')].publishervalue]", "offer": "[variables('operatingsystemvalues')[parameters('operatingsystem')].offervalue]", "sku": "[variables('operatingsystemvalues')[parameters('operatingsystem')].skuvalue]", "version": "latest"}, "osdisk": {"name": "[format('{0}{1}", parameters('virtualmachinenameprefix'), add(range(0, parameters('virtualmachinecount'))[copyindex()], 1))]", "createoption": "fromimage", "manageddisk": {"storageaccounttype": "standardssd_lrs"}, "caching": "readwrite"}}, "osprofile": {"computername": "[format('{0}{1}", parameters('virtualmachinenameprefix'), add(range(0, parameters('virtualmachinecount'))[copyindex()], 1))]", "adminusername": "[parameters('virtualmachineadminusername')]", "windowsconfiguration": {"provisionvmagent": true}, "adminpassword": "[parameters('virtualmachineadminpassword')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", format('{0}{1}-nic1", parameters('virtualmachinenameprefix'), add(range(0, parameters('virtualmachinecount'))[range(0, parameters('virtualmachinecount'))[copyindex()]], 1)))]"}]}, "availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets", parameters('availabilitysetname'))]"}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts", variables('diagnosticstorageaccountname'))).primaryendpoints.blob]"}}}, "dependson": ["[resourceid('microsoft.compute/availabilitysets", parameters('availabilitysetname'))]", "[resourceid('microsoft.network/networkinterfaces", format('{0}{1}-nic1", parameters('virtualmachinenameprefix'), add(range(0, parameters('virtualmachinecount'))[range(0, parameters('virtualmachinecount'))[copyindex()]], 1)))]", "[resourceid('microsoft.storage/storageaccounts", variables('diagnosticstorageaccountname'))]"]} |
Establish connection to a VNET via an ExpressRoute circuit | {"apiversion": "2020-04-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[concat(tolower(parameters('vmname')), uniquestring(resourcegroup().id))]"}}}{"apiversion": "2019-08-01", "type": "microsoft.network/networksecuritygroups", "name": "[variables('nsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allowsshinbound", "properties": {"priority": 100, "access": "allow", "direction": "inbound", "destinationportrange": "22", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}]}}{"apiversion": "2019-11-01", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[variables('nsgid')]"], "properties": {"addressspace": {"addressprefixes": ["[parameters('virtualnetworkaddressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetaddressprefix')]", "networksecuritygroup": {"id": "[variables('nsgid')]"}, "privateendpointnetworkpolicies": "disabled", "privatelinkservicenetworkpolicies": "enabled"}}]}}{"apiversion": "2020-04-01", "type": "microsoft.network/networkinterfaces", "name": "[variables('nicname')]", "location": "[parameters('location')]", "dependson": ["[variables('publicipid')]", "[variables('vnetid')]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname'))]"}, "subnet": {"id": "[variables('subnetid')]"}}}]}}{"type": "microsoft.network/privatednszones", "apiversion": "2018-09-01", "name": "[variables('servicebusnamespaceprivatednszonename')]", "location": "global", "properties": {"maxnumberofrecordsets": 25000, "maxnumberofvirtualnetworklinks": 1000, "maxnumberofvirtualnetworklinkswithregistration": 100}} |
Establish connection to a VNET via an ExpressRoute circuit | {"comments": "hub virtual network (vnet)", "type": "microsoft.network/virtualnetworks", "name": "[variables('hubvnetname')]", "apiversion": "2019-11-01", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('hubvnetprefix')]"]}, "enableddosprotection": false, "enablevmprotection": false}}{"comments": "management subnet", "type": "microsoft.network/virtualnetworks/subnets", "name": "[concat(variables('hubvnetname'), "/", variables('mgmtsubnetname'))]", "apiversion": "2019-11-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('hubvnetname'))]"], "properties": {"addressprefix": "[variables('mgmtsubnetprefix')]"}}{"comments": "shared subnet", "type": "microsoft.network/virtualnetworks/subnets", "name": "[concat(variables('hubvnetname'), "/", variables('sharedsubnetname'))]", "apiversion": "2019-11-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('hubvnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('mgmtsubnetname'))]"], "properties": {"addressprefix": "[variables('sharedsubnetprefix')]"}}{"comments": "dmz subnet", "type": "microsoft.network/virtualnetworks/subnets", "name": "[concat(variables('hubvnetname'), "/", variables('dmzsubnetname'))]", "apiversion": "2019-11-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('hubvnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('mgmtsubnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('sharedsubnetname'))]"], "properties": {"addressprefix": "[variables('dmzsubnetprefix')]"}}{"condition": "[equals(parameters('deployvpngateway'), "yes')]", "comments": "gateway subnet", "type": "microsoft.network/virtualnetworks/subnets", "name": "[concat(variables('hubvnetname'), "/", variables('gatewaysubnetname'))]", "apiversion": "2019-11-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('hubvnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('mgmtsubnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('sharedsubnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('dmzsubnetname'))]"], "properties": {"addressprefix": "[variables('gatewaysubnetprefix')]"}}{"comments": "development spoke virtual network (vnet)", "type": "microsoft.network/virtualnetworks", "name": "[variables('devspokevnetname')]", "apiversion": "2019-11-01", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('devspokevnetprefix')]"]}, "enableddosprotection": false, "enablevmprotection": false}}{"comments": "development workload subnet", "type": "microsoft.network/virtualnetworks/subnets", "name": "[concat(variables('devspokevnetname'), "/", variables('spokeworkloadsubnetname'))]", "apiversion": "2019-11-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('devspokevnetname'))]"], "properties": {"addressprefix": "[variables('devspokeworkloadsubnetprefix')]"}}{"comments": "production spoke virtual network (vnet)", "type": "microsoft.network/virtualnetworks", "name": "[variables('prodspokevnetname')]", "apiversion": "2019-11-01", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('prodspokevnetprefix')]"]}, "enableddosprotection": false, "enablevmprotection": false}}{"comments": "production workload subnet", "type": "microsoft.network/virtualnetworks/subnets", "name": "[concat(variables('prodspokevnetname'), "/", variables('spokeworkloadsubnetname'))]", "apiversion": "2019-11-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('prodspokevnetname'))]"], "properties": {"addressprefix": "[variables('prodspokeworkloadsubnetprefix')]"}}{"condition": "[equals(parameters('deployvpngateway'), "yes')]", "apiversion": "2019-11-01", "type": "microsoft.network/virtualnetworks/virtualnetworkpeerings", "name": "[concat(variables('hubvnetname'), "/gwpeering_", variables('hubvnetname'), "_", variables('devspokevnetname'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('hubvnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('mgmtsubnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('sharedsubnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('dmzsubnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('gatewaysubnetname'))]", "[resourceid('microsoft.network/virtualnetworks", variables('devspokevnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('devspokevnetname'), variables('spokeworkloadsubnetname'))]"], "properties": {"allowvirtualnetworkaccess": true, "allowforwardedtraffic": true, "allowgatewaytransit": true, "useremotegateways": false, "remotevirtualnetwork": {"id": "[variables('devspokeid')]"}}}{"condition": "[equals(parameters('deployvpngateway'), "no')]", "apiversion": "2019-11-01", "type": "microsoft.network/virtualnetworks/virtualnetworkpeerings", "name": "[concat(variables('hubvnetname'), "/peering_", variables('hubvnetname'), "_", variables('devspokevnetname'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('hubvnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('mgmtsubnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('sharedsubnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('hubvnetname'), variables('dmzsubnetname'))]", "[resourceid('microsoft.network/virtualnetworks", variables('devspokevnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('devspokevnetname'), variables('spokeworkloadsubnetname'))]"], "properties": {"allowvirtualnetworkaccess": true, "allowforwardedtraffic": true, "allowgatewaytransit": false, "useremotegateways": false, "remotevirtualnetwork": {"id": "[variables('devspokeid')]"}}} |
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01. | {"apiversion": "2020-12-01", "type": "microsoft.compute/virtualmachines", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", parameters('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",parameters('nicname'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('vmname'),"/", parameters('vmextensionname'))]", "apiversion": "2020-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", parameters('vmname'))]"], "properties": {"publisher": "symantec", "type": "symantecendpointprotection", "typehandlerversion": "12.1"}} |
Establish connection to a VNET via an ExpressRoute circuit | {"type": "microsoft.network/privateendpoints", "apiversion": "2020-07-01", "name": "[parameters('filestorageaccountprivateendpointname')]", "location": "[parameters('location')]", "dependson": ["[variables('filestorageaccountid')]", "[variables('fileshareid')]"], "properties": {"privatelinkserviceconnections": [{"name": "[parameters('filestorageaccountprivateendpointname')]", "properties": {"privatelinkserviceid": "[variables('filestorageaccountid')]", "groupids": ["[variables('filestorageaccountprivateendpointgroupname')]"]}}], "subnet": {"id": "[variables('subnetid')]"}}}{"type": "microsoft.network/privateendpoints/privatednszonegroups", "apiversion": "2020-06-01", "name": "[variables('fileprivatednszonegroup')]", "location": "[parameters('location')]", "dependson": ["[variables('fileprivatednszoneid')]", "[variables('filestorageaccountprivateendpointid')]"], "properties": {"privatednszoneconfigs": [{"name": "dnsconfig", "properties": {"privatednszoneid": "[variables('fileprivatednszoneid')]"}}]}}{"apiversion": "2020-07-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[concat(tolower(parameters('vmname')), uniquestring(resourcegroup().id))]"}}}{"apiversion": "2019-08-01", "type": "microsoft.network/networksecuritygroups", "name": "[variables('nsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allowsshinbound", "properties": {"priority": 100, "access": "allow", "direction": "inbound", "destinationportrange": "22", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}]}}{"apiversion": "2019-11-01", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[variables('nsgid')]"], "properties": {"addressspace": {"addressprefixes": ["[parameters('virtualnetworkaddressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetaddressprefix')]", "networksecuritygroup": {"id": "[variables('nsgid')]"}, "privateendpointnetworkpolicies": "disabled", "privatelinkservicenetworkpolicies": "enabled"}}]}}{"apiversion": "2020-07-01", "type": "microsoft.network/networkinterfaces", "name": "[variables('nicname')]", "location": "[parameters('location')]", "dependson": ["[variables('publicipid')]", "[variables('vnetid')]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname'))]"}, "subnet": {"id": "[variables('subnetid')]"}}}]}} |
This sample contains a script to easily migrate template gallery templates to templateSpec resources. | {"name": "updatevm", "type": "microsoft.resources/deployments", "apiversion": "2015-01-01", "dependson": ["[resourceid('microsoft.compute/virtualmachines/extensions", parameters('vmname'), variables('extensionname'))]"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('updatevmurl')]", "contentversion": "1.0.0.0"}, "parameters": {"vmname": {"value": "[parameters('vmname')]"}, "keyvaultresourceid": {"value": "[variables('keyvaultresourceid')]"}, "keyvaultsecreturl": {"value": "[reference(resourceid('microsoft.compute/virtualmachines/extensions", parameters('vmname'), variables('extensionname'))).instanceview.statuses[0].message]"}, "keyencryptionkeyurl": {"value": "[parameters('keyencryptionkeyurl')]"}}}} |
Establish connection to a VNET via an ExpressRoute circuit | {"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "[concat('publicip", copyindex())]", "location": "[parameters('location')]", "copy": {"name": "publiciploop", "count": "[variables('numberofinstances')]"}, "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[parameters('domainname')]"}}}{"apiversion": "2020-05-01", "type": "microsoft.network/networksecuritygroups", "name": "[variables('securitygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "ssh", "properties": {"description": "allows ssh traffic", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}} |
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01. | {"apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmsettings')[copyindex()].name]", "location": "[variables('vmsettings')[copyindex()].location]", "copy": {"name": "vmcopy", "count": 2}, "dependson": ["niccopy"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('vmsettings')[copyindex()].name]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": "[variables('vmsettings')[copyindex()].imagereference]", "osdisk": {"caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(variables('nicname'), copyindex(1)))]"}]}}} |
Establish connection to a VNET via an ExpressRoute circuit | {"apiversion": "2020-08-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}} |
Establish connection to a VNET via an ExpressRoute circuit | {"type": "microsoft.network/publicipaddresses", "apiversion": "2021-02-01", "name": "[parameters('hostpublicipaddressname')]", "location": "[parameters('location')]", "sku": {"name": "basic"}, "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[tolower(format('{0}-{1}", parameters('hostvirtualmachinename'), uniquestring(resourcegroup().id)))]"}}}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2021-02-01", "name": "[variables('natsubnetnsgname')]", "location": "[parameters('location')]", "properties": {}}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2021-02-01", "name": "[variables('hypervsubnetnsgname')]", "location": "[parameters('location')]", "properties": {}}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2021-02-01", "name": "[variables('ghostedsubnetnsgname')]", "location": "[parameters('location')]", "properties": {}} |
This template creates a VNet with multiple subnets and deploys a Ubuntu VM with multiple NICs | {"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nic1name'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nic2name'))]"], "location": "[parameters('location')]", "name": "[parameters('vmname')]", "properties": {"diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname')), "2019-06-01').primaryendpoints.blob]"}}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('nic1name'))]", "properties": {"primary": true}}, {"id": "[resourceid('microsoft.network/networkinterfaces", variables('nic2name'))]", "properties": {"primary": false}}]}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "linuxconfiguration": {"disablepasswordauthentication": true, "ssh": {"publickeys": [{"path": "[variables('sshkeypath')]", "keydata": "[parameters('sshkeydata')]"}]}}}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[parameters('ubuntuosversion')]", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}}} |
This sample shows how to add custom resources to Resource Manager Templates using custom providers and logic apps. | {"type": "microsoft.customproviders/resourceproviders", "apiversion": "2018-09-01-preview", "name": "[parameters('customresourceprovidername')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.logic/workflows", parameters('logicappname'))]"], "properties": {"resourcetypes": [{"name": "customresources", "mode": "secure", "routingtype": "webhook,cache", "endpoint": "[listcallbackurl(resourceid('microsoft.logic/workflows/triggers", parameters('logicappname'), "customproviderwebhook'), "2019-05-01').value]"}]}}{"type": "microsoft.customproviders/resourceproviders/customresources", "apiversion": "2018-09-01-preview", "name": "[concat(parameters('customresourceprovidername'), "/", parameters('customresourcename'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.customproviders/resourceproviders", parameters('customresourceprovidername'))]"], "properties": {"mycustominputproperty": "mycustominputvalue", "mycustominputobject": {"property1": "value1"}}} |
Storage Account with Storage Service Encryption and a blob deletion retention policy | {"type": "microsoft.storage/storageaccounts", "apiversion": "2021-02-01", "name": "[variables('bootstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}, "kind": "storage", "tags": {"quickstartname": "jboss eap on rhel (clustered, multi-vm)"}} |
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')]"]}}, "resources": [{"type": "subnets", "apiversion": "2020-06-01", "name": "[variables('subnet1name')]", "location": "[parameters('location')]", "dependson": ["[variables('vnetname')]"], "properties": {"addressprefix": "[variables('subnet1prefix')]", "privateendpointnetworkpolicies": "disabled"}}]}{"type": "microsoft.network/privateendpoints", "apiversion": "2020-06-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"]}}]}}{"type": "microsoft.network/privatednszones", "apiversion": "2020-01-01", "name": "[variables('privatednszonename')]", "location": "global", "dependson": ["[variables('vnetname')]"], "properties": ""}{"type": "microsoft.network/privatednszones/virtualnetworklinks", "apiversion": "2020-01-01", "name": "[concat(variables('privatednszonename'), "/", variables('privatednszonename'), "-link')]", "location": "global", "dependson": ["[resourceid('microsoft.network/privatednszones", variables('privatednszonename'))]", "[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"], "properties": {"registrationenabled": false, "virtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"}}} |
Establish connection to a VNET via an ExpressRoute circuit | {"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "[concat(variables('publicipname'), copyindex())]", "copy": {"name": "publiciploop", "count": "[variables('numberofinstances')]"}, "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "lbpublicip", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "lbpublicip-v6", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic", "publicipaddressversion": "ipv6"}}{"apiversion": "2020-05-01", "name": "loadbalancer", "type": "microsoft.network/loadbalancers", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses","lbpublicip')]", "[resourceid('microsoft.network/publicipaddresses","lbpublicip-v6')]"], "properties": {"frontendipconfigurations": [{"name": "lbfe", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", "lbpublicip')]"}}}, {"name": "lbfe-v6", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses","lbpublicip-v6')]"}}}], "backendaddresspools": [{"name": "lbbap"}, {"name": "lbbap-v6"}], "loadbalancingrules": [{"properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", "loadbalancer", "lbfe')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", "loadbalancer", "lbbap')]"}, "protocol": "tcp", "frontendport": 80, "backendport": 80, "idletimeoutinminutes": 15}, "name": "lbrule"}, {"properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", "loadbalancer", "lbfe-v6')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", "loadbalancer", "lbbap-v6')]"}, "protocol": "tcp", "frontendport": 80, "backendport": 80}, "name": "lbrule-v6"}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "vnet", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnetv4addressrange')]", "[variables('vnetv6addressrange')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefixes": ["[variables('subnetv4addressrange')]", "[variables('subnetv6addressrange')]"]}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/networksecuritygroups", "name": "dsnsg", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allow-http-in", "properties": {"description": "allow http", "protocol": "tcp", "sourceportrange": "80", "destinationportrange": "80", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1001, "direction": "inbound"}}, {"name": "allow-all-out", "properties": {"description": "allow out all", "protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1002, "direction": "outbound"}}, {"name": "allow-rdp-in", "properties": {"description": "allow rdp", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1003, "direction": "inbound"}}, {"name": "allow-myipv6app-out", "properties": {"description": "allow my ipv6 app", "protocol": "tcp", "sourceportrange": "33819-33829", "destinationportrange": "5000-6000", "sourceaddressprefix": "ace:cab:deca:deed::/64", "destinationaddressprefixes": ["cab:cab:aaaa:bbbb::/64", "cab:cab:1111:2222::/64"], "access": "allow", "priority": 1004, "direction": "outbound"}}]}} |
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01. | {"type": "microsoft.compute/virtualmachines", "apiversion": "2019-07-01", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces/", variables('networkinterfacename'))]", "[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')[parameters('cpu-gpu')]]"}, "storageprofile": {"osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}, "datadisks": [{"lun": 0, "name": "[concat('datadisk", parameters('vmname'))]", "createoption": "empty", "disksizegb": "[parameters('disksizegb')]"}], "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('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[concat(reference(variables('storageaccountname')).primaryendpoints.blob)]"}}}, "resources": [{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2019-07-01", "name": "[concat(variables('vmname'),"/installscript')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines", variables('vmname'))]"], "tags": {"displayname": "execute my custom script"}, "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "protectedsettings": {"commandtoexecute": "[concat('bash install.sh ", parameters('adminusername'))]", "fileuris": ["[uri(parameters('_artifactslocation'), concat('scripts/install.sh", parameters('_artifactslocationsastoken')))]"]}}}]} |
This module allows you to create a user-assigned managed identity and a role assignment scoped to the resource group. | {"type": "microsoft.managedidentity/userassignedidentities", "name": "[parameters('identityname')]", "apiversion": "2018-11-30", "location": "[parameters('location')]"} |
This template uses Azure Managed Identity to assign access to Azure Maps. See more at https://aka.ms/amauth | {"condition": "[parameters('protectwithlocks')]", "type": "microsoft.authorization/locks", "apiversion": "2017-04-01", "scope": "[format('microsoft.keyvault/vaults/{0}", parameters('keyvaultname'))]", "name": "keyvaultdonotdelete", "properties": {"level": "cannotdelete"}, "dependson": ["[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]"]} |
Storage Account with Storage Service Encryption and a blob deletion retention policy | {"type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs", "tier": "standard"}, "kind": "storagev2", "properties": {"accesstier": "hot"}} |
Create a SQL Server Virtual Machine with performance optimized storage settings, using UltraSSD for SQL Log files | {"type": "microsoft.sqlvirtualmachine/sqlvirtualmachines", "apiversion": "2017-03-01-preview", "name": "[parameters('virtualmachinename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"], "properties": {"virtualmachineresourceid": "[resourceid('microsoft.compute/virtualmachines", parameters('virtualmachinename'))]", "sqlmanagement": "full", "sqlserverlicensetype": "payg", "storageconfigurationsettings": {"diskconfigurationtype": "[variables('diskconfigurationtype')]", "storageworkloadtype": "[parameters('storageworkloadtype')]", "sqldatasettings": {"luns": "[variables('datadisksluns')]", "defaultfilepath": "[parameters('datapath')]"}, "sqllogsettings": {"luns": "[variables('logdisksluns')]", "defaultfilepath": "[parameters('logpath')]"}, "sqltempdbsettings": {"defaultfilepath": "[variables('tempdbpath')]"}}}} |
This module creates a storageAccount resource with apiVersion 2021-01-01. | {"apiversion": "2021-02-01", "type": "microsoft.storage/storageaccounts", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('storageaccountskuname')]"}, "kind": "[parameters('storageaccountkind')]", "resources": [{"name": "[concat('default/", variables('blobcontainername'))]", "type": "blobservices/containers", "apiversion": "2021-02-01", "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"], "properties": {"publicaccess": "blob"}}]} |
Create a VM from a Windows Image with 4 Empty Data Disks | {"type": "microsoft.compute/virtualmachines", "name": "[concat(variables('clustername'), "-dev')]", "apiversion": "2017-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", concat(variables('clustername'), "-dev", "-vmnic'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('infravmsize')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('ubuntuosversion')]", "version": "latest"}, "osdisk": {"createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "[variables('standardstorageaccounttype')]"}}}, "osprofile": {"computername": "[concat(variables('clustername'), "-dev')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(variables('clustername'), "-dev", "-vmnic'))]"}]}}}{"apiversion": "2017-12-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('clustername'), "-dev", "/setupdevbox')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines", concat(variables('clustername'), "-dev'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('scriptfileuri')]"]}, "protectedsettings": {"commandtoexecute": "[concat('bash setupdevbox.sh ", parameters('adminusername'), " --cluster_name ", variables('clustername'), " --cluster_location ", parameters('location'), " --worker_vm_size ", parameters('workervmsize'), " --infra_vm_size ", parameters('infravmsize'), " --worker_node_num ", parameters('numberofworkervm'), " --infra_node_num ", parameters('numberofinfravm'), " --password ", variables('adminpasswordq'), " --users ", variables('dlwsadminsq'), " --openid_name ", variables('openidproviderq'), " --openid_tenant ", variables('openidtenantq'), " --openid_clientid ", variables('openidclientidq'), " --openid_clientsecret ", variables('openidclientsecretq'))]"}}}{"type": "microsoft.compute/virtualmachines", "name": "[concat(variables('clustername'), "-infra0", copyindex(1))]", "apiversion": "2017-12-01", "location": "[parameters('location')]", "copy": {"name": "infravmloop", "count": "[parameters('numberofinfravm')]"}, "dependson": ["[resourceid('microsoft.network/networkinterfaces", concat(variables('clustername'), "-infra0", copyindex(1), "-vmnic'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('infravmsize')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('ubuntuosversion')]", "version": "latest"}, "osdisk": {"createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "[variables('standardstorageaccounttype')]"}}}, "osprofile": {"computername": "[concat(variables('clustername'), "-infra0", copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(variables('clustername'), "-infra0", copyindex(1), "-vmnic'))]"}]}}} |
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": "[variables('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"}, "datadisks": [{"name": "[concat(variables('vmname'),"_datadisk1')]", "disksizegb": "10", "lun": 0, "createoption": "empty"}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'), "/setupdatadisk')]", "apiversion": "2017-03-30", "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/setup_data_disk.sh", parameters('_artifactslocationsastoken')))]"], "commandtoexecute": "bash setup_data_disk.sh"}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'), "/neo4jdocker')]", "apiversion": "2017-03-30", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/extensions", variables('vmname'),"setupdatadisk')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "dockerextension", "typehandlerversion": "1.0", "autoupgrademinorversion": true, "settings": {"compose": {"neo4j": {"image": "tpires/neo4j", "ports": ["7474:7474", "7473:7473"], "volumes": ["/datadisk:/var/lib/neo4j/data"]}}}}} |
Establish connection to a VNET via an ExpressRoute circuit | {"name": "[variables('networkinterfacename')]", "type": "microsoft.network/networkinterfaces", "apiversion": "2020-07-01", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups/", variables('networksecuritygroupname'))]", "[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"subnet": {"id": "[variables('subnetref')]"}, "privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"}}}], "networksecuritygroup": {"id": "[variables('nsgid')]"}}} |
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('dnsnameprefix')]"}}} |
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": "standard_lrs"}, "kind": "storagev2", "properties": {}} |
This module creates a storageAccount resource with apiVersion 2021-01-01. | {"type": "microsoft.storage/storageaccounts", "name": "[variables('storageaccountname')]", "apiversion": "2021-01-01", "location": "[parameters('location')]", "sku": {"name": "[variables('internalstoragetype')]"}} |