MihaiIonascu/Azure_IaC_test huggingface dataset:
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.

{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "[variables('vns3controllername')]", "location": "[parameters('location')]", "plan": {"name": "cohesive-vns3-4_11_x-free", "product": "vns3_4x_network_security", "publisher": "cohesive"}, "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]", "[resourceid('microsoft.storage/storageaccounts", variables('storageaccount'))]"], "tags": {"name": "vns3 controller"}, "properties": {"hardwareprofile": {"vmsize": "[parameters('instancesize')]"}, "storageprofile": {"imagereference": {"publisher": "cohesive", "offer": "vns3_4x_network_security", "sku": "cohesive-vns3-4_11_x-free", "version": "latest"}, "osdisk": {"ostype": "linux", "name": "[concat(variables('vns3controllername'), "-disc')]", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}, "disksizegb": 30}}, "osprofile": {"computername": "[variables('vns3controllername')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "linuxconfiguration": {"disablepasswordauthentication": false, "provisionvmagent": true}, "allowextensionoperations": true}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('storageaccount'),"2021-01-01').primaryendpoints["blob"]]"}}}}{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-12-01", "name": "[concat('ubuntuvm", copyindex())]", "location": "[parameters('location')]", "copy": {"name": "virtualmachineloop", "count": "[parameters('numberofinstances')]"}, "dependson": ["nicloop"], "properties": {"hardwareprofile": {"vmsize": "[parameters('instancesize')]"}, "osprofile": {"computername": "[concat('ubuntuvm", copyindex())]", "adminusername": "[parameters('adminusernameubuntu')]", "adminpassword": "[parameters('adminpasswordubuntu')]"}, "storageprofile": {"imagereference": "[variables('ubuntu')]", "osdisk": {"createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat('nic-ubuntuvm", copyindex()))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-12-01", "name": "[concat('ubuntuvm", copyindex(), "/", variables('customscriptforlinux'))]", "location": "[parameters('location')]", "copy": {"name": "customscriploop", "count": "[parameters('numberofinstances')]"}, "dependson": ["virtualmachineloop"], "properties": {"publisher": "microsoft.azure.extensions", "type": "[variables('customscriptforlinux')]", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('scriptfileuri')]"], "commandtoexecute": "[variables('customscriptcommandtoexecute')]"}}}
Create a VM from a Windows Image with 4 Empty Data Disks

{"type": "microsoft.compute/virtualmachines", "apiversion": "2020-06-01", "name": "[concat(variables('virtualmachines_myvm_name'), copyindex(1))]", "location": "[parameters('location')]", "copy": {"name": "vm-loop", "count": 2}, "dependson": ["[resourceid('microsoft.network/networkinterfaces", concat(variables('net_interface'), copyindex(1)))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2016-datacenter", "version": "latest"}, "osdisk": {"ostype": "windows", "createoption": "fromimage", "caching": "readwrite", "manageddisk": {"storageaccounttype": "standardssd_lrs"}, "disksizegb": 127}}, "osprofile": {"computername": "[concat(variables('virtualmachines_myvm_name'), copyindex(1))]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]", "windowsconfiguration": {"provisionvmagent": true, "enableautomaticupdates": true}, "allowextensionoperations": true}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(variables('net_interface'), copyindex(1)))]"}]}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy

{"type": "microsoft.storage/storageaccounts", "name": "[variables('newstorageaccount')]", "apiversion": "2021-02-01", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}}
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/", variables('storageaccountname'))]", "[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('imagesku')]", "version": "[variables('imageversion')]"}, "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": "2015-06-15", "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('configure-eth-cpp.sh", parameters('_artifactslocationsastoken')))]"], "commandtoexecute": "[concat('sh configure-eth-cpp.sh ", parameters('adminusername'))]"}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.

{"apiversion": "2019-10-01", "type": "microsoft.resources/deployments", "name": "[variables('solacesecuritytemplatename')]", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('securitysharedtemplateuri')]", "contentversion": "1.0.0.0"}, "parameters": {"securitygroupname": {"value": "[parameters('securitygroupname')]"}, "subnetprefix": {"value": "[parameters('subnetprefix')]"}, "location": {"value": "[parameters('location')]"}}}}
This template creates a Service Bus namespace and 2 queues and sets auto forwarding.

{"apiversion": "2017-04-01", "name": "[parameters('servicebusnamespacename')]", "type": "microsoft.servicebus/namespaces", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('servicebusqueuename1')]", "type": "queues", "dependson": ["[resourceid('microsoft.servicebus/namespaces", parameters('servicebusnamespacename'))]"], "properties": {"lockduration": "pt5m", "maxsizeinmegabytes": "1024", "requiresduplicatedetection": "false", "requiressession": "false", "defaultmessagetimetolive": "p10675199dt2h48m5.4775807s", "deadletteringonmessageexpiration": "false", "duplicatedetectionhistorytimewindow": "pt10m", "maxdeliverycount": "10", "autodeleteonidle": "p10675199dt2h48m5.4775807s", "enablepartitioning": "false", "enableexpress": "false"}}, {"apiversion": "2017-04-01", "name": "[parameters('servicebusqueuename2')]", "type": "queues", "dependson": ["[resourceid('microsoft.servicebus/namespaces", parameters('servicebusnamespacename'))]", "[resourceid('microsoft.servicebus/namespaces/queues/", parameters('servicebusnamespacename'),parameters('servicebusqueuename1'))]"], "properties": {"lockduration": "pt5m", "maxsizeinmegabytes": "1024", "requiresduplicatedetection": "false", "requiressession": "false", "defaultmessagetimetolive": "p10675199dt2h48m5.4775807s", "deadletteringonmessageexpiration": "false", "duplicatedetectionhistorytimewindow": "pt10m", "maxdeliverycount": "10", "autodeleteonidle": "p10675199dt2h48m5.4775807s", "enablepartitioning": "false", "enableexpress": "false", "forwardto": "[parameters('servicebusqueuename1')]", "forwarddeadletteredmessagesto": "[parameters('servicebusqueuename1')]"}}]}
This module creates a storageAccount resource with apiVersion 2021-01-01.

{"apiversion": "2021-04-01", "type": "microsoft.storage/storageaccounts", "name": "[variables('newstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}}
Establish connection to a VNET via an ExpressRoute circuit

{"apiversion": "2020-05-01", "name": "[variables('lbname')]", "type": "microsoft.network/loadbalancers", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]"], "properties": {"frontendipconfigurations": [{"name": "loadbalancerfrontend", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"}}}], "backendaddresspools": [{"name": "backendpool1"}], "inboundnatrules": [{"name": "rdp-vm0", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('lbname'), "loadbalancerfrontend')]"}, "protocol": "tcp", "frontendport": 50001, "backendport": 3389, "enablefloatingip": false}}]}}
This template creates a data collection rule defining the data source (Syslog) and the destination workspace.

{"type": "microsoft.insights/components", "apiversion": "2020-02-02", "name": "[variables('applicationinsightsname')]", "location": "[if(or(equals(parameters('location'),"eastus2'), equals(parameters('location'),"westcentralus')),"southcentralus",parameters('location'))]", "kind": "web", "properties": {"application_type": "web"}}
which shows how we can correlate messages over Logic Apps using Azure Service Bus

{"type": "microsoft.logic/workflows", "apiversion": "2019-05-01", "name": "[parameters('logicappname')]", "dependson": ["[resourceid('microsoft.web/connections", parameters('slackconnectionname'))]"], "location": "[parameters('location')]", "properties": {"definition": {"$schema": "https://schema.management.azure.com/providers/microsoft.logic/schemas/2016-06-01/workflowdefinition.json#", "contentversion": "1.0.0.0", "parameters": {"$connections": {"defaultvalue": {}, "type": "object"}}, "triggers": {"manual": {"type": "request", "kind": "http", "inputs": {"schema": {"$schema": "http://json-schema.org/draft-04/schema#", "properties": {"context": {"properties": {"name": {"type": "string"}, "portallink": {"type": "string"}, "resourcename": {"type": "string"}}, "required": ["name", "portallink", "resourcename"], "type": "object"}, "status": {"type": "string"}}, "required": ["status", "context"], "type": "object"}}}}, "actions": {"http": {"type": "http", "inputs": {"body": {"longurl": "@{triggerbody()["context"]["portallink"]}"}, "headers": {"content-type": "application/json"}, "method": "post", "uri": "https://www.googleapis.com/urlshortener/v1/url?key=aizasybkt1brba-uulhz8hmuai0ywjtpnlxhshi"}}, "post_message": {"type": "apiconnection", "inputs": {"host": {"connection": {"name": "@parameters('$connections')["slack"]["connectionid"]"}}, "method": "post", "path": "/chat.postmessage", "queries": {"channel": "[parameters('slackchannel')]", "text": "azure alert - "@{triggerbody()["context"]["name"]}" @{triggerbody()["status"]} on "@{triggerbody()["context"]["resourcename"]}".  details: @{body('http')["id"]}"}}, "runafter": {"http": ["succeeded"]}}}, "outputs": {}}, "parameters": {"$connections": {"value": {"slack": {"id": "[subscriptionresourceid('microsoft.web/locations/managedapis", parameters('location'), "slack')]", "connectionid": "[resourceid('microsoft.web/connections", parameters('slackconnectionname'))]"}}}}}}
Create and assign a standard App Service Certificate

{"type": "microsoft.web/sites/domainownershipidentifiers", "name": "[concat(parameters('existingappname'), concat('/", parameters('certificateordername')))]", "apiversion": "2016-08-01", "location": "[parameters('existingapplocation')]", "dependson": ["[resourceid('microsoft.certificateregistration/certificateorders", parameters('certificateordername'))]"], "properties": {"id": "[reference(resourceid('microsoft.certificateregistration/certificateorders", parameters('certificateordername'))).domainverificationtoken]"}}{"type": "microsoft.web/certificates", "name": "[parameters('certificateordername')]", "apiversion": "2015-08-01", "location": "[parameters('existingapplocation')]", "dependson": ["[resourceid('microsoft.certificateregistration/certificateorders/certificates", parameters('certificateordername'), parameters('certificateordername'))]"], "properties": {"keyvaultid": "[parameters('existingkeyvaultid')]", "keyvaultsecretname": "[parameters('certificateordername')]"}}{"type": "microsoft.web/sites", "name": "[parameters('existingappname')]", "apiversion": "2015-08-01", "location": "[parameters('existingapplocation')]", "dependson": ["[resourceid('microsoft.web/certificates", parameters('certificateordername'))]"], "properties": {"name": "[parameters('existingappname')]", "hostnamesslstates": [{"name": "[parameters('roothostname')]", "sslstate": 1, "thumbprint": "[reference(resourceid('microsoft.certificateregistration/certificateorders", parameters('certificateordername'))).signedcertificate.thumbprint]", "toupdate": true}, {"name": "[variables('wwwhostname')]", "sslstate": 1, "thumbprint": "[reference(resourceid('microsoft.certificateregistration/certificateorders", parameters('certificateordername'))).signedcertificate.thumbprint]", "toupdate": true}]}}
Storage Account with Storage Service Encryption and a blob deletion retention policy

{"name": "[variables('blobstorageaccountname')]", "type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "tags": {"displayname": "[variables('blobstorageaccountname')]"}, "location": "[parameters('location')]", "kind": "storagev2", "sku": {"name": "standard_lrs", "tier": "standard"}, "properties": {"networkacls": {"bypass": "azureservices", "defaultaction": "deny"}}, "resources": [{"type": "blobservices/containers", "apiversion": "2019-06-01", "name": "default/defaultcontainer", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('blobstorageaccountname'))]"]}]}
This template creates a data collection rule defining the data source (Syslog) and the destination workspace.

{"type": "microsoft.insights/actiongroups", "apiversion": "2019-06-01", "name": "[parameters('actiongroupname')]", "location": "global", "properties": {"groupshortname": "[parameters('actiongroupshortname')]", "enabled": true, "emailreceivers": [{"name": "emailreceiver", "emailaddress": "[parameters('emailaddress')]"}]}}
This template creates a Service Bus namespace and a queue.

{"type": "microsoft.servicebus/namespaces", "apiversion": "2017-04-01", "name": "[parameters('servicebusnamespacename')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {}}{"type": "microsoft.servicebus/namespaces/queues", "apiversion": "2017-04-01", "name": "[format('{0}/{1}", parameters('servicebusnamespacename'), parameters('servicebusqueuename'))]", "properties": {"lockduration": "pt5m", "maxsizeinmegabytes": 1024, "requiresduplicatedetection": false, "requiressession": false, "defaultmessagetimetolive": "p10675199dt2h48m5.4775807s", "deadletteringonmessageexpiration": false, "duplicatedetectionhistorytimewindow": "pt10m", "maxdeliverycount": 10, "autodeleteonidle": "p10675199dt2h48m5.4775807s", "enablepartitioning": false, "enableexpress": false}, "dependson": ["[resourceid('microsoft.servicebus/namespaces", parameters('servicebusnamespacename'))]"]}
Establish connection to a VNET via an ExpressRoute circuit

{"apiversion": "2015-05-01-preview", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[variables('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[variables('uniquednsnameforpublicip')]"}}}{"apiversion": "2015-05-01-preview", "type": "microsoft.network/networksecuritygroups", "name": "[variables('nsgname')]", "location": "[variables('location')]", "properties": {"securityrules": [{"name": "nsgsrule", "properties": {"protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 101, "direction": "inbound"}}]}}{"apiversion": "2015-05-01-preview", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[variables('location')]", "dependson": ["[concat('microsoft.network/networksecuritygroups/", variables('nsgname'))]"], "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]", "networksecuritygroup": {"id": "[variables('nsgid')]"}}}]}}
Create a VM from a Windows Image with 4 Empty Data Disks

{"apiversion": "2019-12-01", "type": "microsoft.compute/availabilitysets", "name": "[variables('availabilitysetnodes')]", "location": "[parameters('location')]", "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 5}, "sku": {"name": "aligned"}}
Establish connection to a VNET via an ExpressRoute circuit

{"apiversion": "2021-03-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnslabelprefix')]"}}}{"apiversion": "2021-03-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[variables('nsgid')]"], "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]", "networksecuritygroup": {"id": "[variables('nsgid')]"}}}]}}{"apiversion": "2021-03-01", "type": "microsoft.network/networksecuritygroups", "name": "[variables('nsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "ssh", "properties": {"description": "ssh", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 200, "direction": "inbound"}}, {"name": "lms", "properties": {"description": "http for open edx lms", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "80", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 201, "direction": "inbound"}}, {"name": "cms", "properties": {"description": "http for open edx cms", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "18010", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 203, "direction": "inbound"}}, {"name": "port_8080", "properties": {"description": "https", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "443", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 213, "direction": "inbound"}}]}}{"apiversion": "2021-03-01", "type": "microsoft.network/networkinterfaces", "name": "[concat(variables('vmname'), "-nic')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]", "[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfignodenam2", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"}, "subnet": {"id": "[variables('subnetref')]"}}}]}}
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-06-01", "name": "[parameters('hostingplanlivesite')]", "location": "[parameters('location')]", "tags": {"displayname": "hostingplan"}, "sku": {"name": "[parameters('pricingtierlivesite')]", "capacity": 1}, "properties": {"name": "[parameters('hostingplanlivesite')]"}}{"type": "microsoft.web/sites", "apiversion": "2020-06-01", "name": "[parameters('livesitename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms", parameters('hostingplanlivesite'))]", "[resourceid('microsoft.insights/components", parameters('livesitename'))]"], "tags": {"[format('{0}:{1}", "hidden-related", resourceid('microsoft.web/serverfarms", parameters('hostingplanlivesite')))]": "empty", "displayname": "website"}, "properties": {"name": "[parameters('livesitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('hostingplanlivesite'))]", "mintlsversion": "1.2", "siteconfig": {"connectionstrings": [{"name": "cmsconnectionstring", "connectionstring": "[if(empty(parameters('connectionstringdatabasename')),"",concat('data source=tcp:", reference(resourceid('microsoft.sql/servers", parameters('sqlservername'))).fullyqualifieddomainname, ",1433;initial catalog=", parameters('connectionstringdatabasename'), ";user id=", parameters('sqladministratorlogin'), "@", parameters('sqlservername'), ";password=", parameters('sqladministratorpassword'), ";'))]", "type": "sqlserver"}], "appsettings": [{"name": "appinsights_instrumentationkey", "value": "[reference(variables('instrumentationkey')).instrumentationkey]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks

{"type": "microsoft.compute/virtualmachines", "name": "[variables('vm01name')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "tags": {"displayname": "iis01"}, "dependson": ["[resourceid('microsoft.network/networkinterfaces/", concat(variables('vm01name'), "_nic'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('vm01name')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('windowsosversion')]", "version": "latest"}, "osdisk": {"caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"properties": {"primary": true}, "id": "[resourceid('microsoft.network/networkinterfaces", concat(variables('vm01name'), "_nic'))]"}]}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.

{"apiversion": "2015-01-01", "name": "[variables('nesteddeploymentnamevnet')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('github'), parameters('neworexistingsubnet'), "vnet.json')]", "contentversion": "1.0.0.0"}, "parameters": {"vnetname": {"value": "[variables('vnetname')]"}, "addressprefix": {"value": "[variables('addressprefix')]"}, "subnetname": {"value": "[variables('subnetname')]"}, "subnetprefix": {"value": "[variables('subnetprefix')]"}}}}{"apiversion": "2015-01-01", "name": "[variables('nesteddeploymentnamenic')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('github'), "nic-config.json')]", "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": "2015-01-01", "name": "[variables('nesteddeploymentnameprof')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('github'), "os-disk-parts-md.json')]", "contentversion": "1.0.0.0"}, "parameters": {"imagesku": {"value": ""}, "imagepublisher": {"value": ""}, "imageoffer": {"value": ""}, "osdisktype": {"value": "[variables('osdisktype')]"}, "ostype": {"value": "[variables('internalostype')]"}, "sidlower": {"value": "[variables('sidlower')]"}, "vmname": {"value": "[variables('vmname')]"}, "storagetype": {"value": "[variables('internalstoragetype')]"}, "manageddiskid": {"value": "[parameters('userimageid')]"}}}}{"apiversion": "2015-01-01", "name": "[variables('nesteddeploymentnamepip')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('github'), parameters('neworexistingsubnet'), "pip.json')]", "contentversion": "1.0.0.0"}, "parameters": {"publicipname": {"value": "[variables('publicipname')]"}, "publicipaddresstype": {"value": "[variables('publicipaddresstype')]"}}}}{"apiversion": "2015-01-01", "name": "[variables('nesteddeploymentnamensg')]", "type": "microsoft.resources/deployments", "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('github'), parameters('neworexistingsubnet'), "nsg.json')]", "contentversion": "1.0.0.0"}, "parameters": {"nsgname": {"value": "[variables('nsgname')]"}, "ostype": {"value": "[variables('internalostype')]"}}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.

{"name": "shared-resources", "type": "microsoft.resources/deployments", "apiversion": "2020-08-01", "properties": {"mode": "incremental", "templatelink": {"uri": "[uri(parameters('_artifactslocation'), concat(variables('sharedtemplatename'), ".json", parameters('_artifactslocationsastoken')))]", "contentversion": "1.0.0.0"}, "parameters": {"location": {"value": "[parameters('location')]"}, "storageaccountname": {"value": "[parameters('storageaccountname')]"}, "virtualnetworkname": {"value": "[parameters('virtualnetworkname')]"}, "addressprefix": {"value": "[parameters('addressprefix')]"}, "subnetname": {"value": "[parameters('subnetname')]"}, "subnetprefix": {"value": "[parameters('subnetprefix')]"}}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.

{"type": "microsoft.storage/storageaccounts", "name": "[variables('clusterstorageaccountname')]", "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/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('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"osdisk": {"createoption": "fromimage", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}, "imagereference": "[variables('imagereference')[parameters('os')]]"}, "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')]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.

{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", parameters('newstorageaccountname'))]", "[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'))]"}]}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.

{"type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs", "tier": "standard"}, "kind": "storagev2", "properties": {"networkacls": {"bypass": "none", "virtualnetworkrules": [{"id": "[variables('containersubnetref')]", "action": "allow"}, {"id": "[variables('storagesubnetref')]", "action": "allow"}], "defaultaction": "deny"}, "supportshttpstrafficonly": true, "encryption": {"services": {"file": {"keytype": "account", "enabled": true}, "blob": {"keytype": "account", "enabled": true}}, "keysource": "microsoft.storage"}, "accesstier": "cool"}}{"type": "microsoft.storage/storageaccounts/blobservices", "apiversion": "2019-06-01", "name": "[concat(parameters('storageaccountname'), "/default')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"], "sku": {"name": "standard_lrs", "tier": "standard"}, "properties": {"deleteretentionpolicy": {"enabled": false}}}{"type": "microsoft.storage/storageaccounts/fileservices", "apiversion": "2019-06-01", "name": "[concat(parameters('storageaccountname'), "/default')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"], "sku": {"name": "standard_lrs", "tier": "standard"}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.

{"apiversion": "2019-12-01", "type": "microsoft.compute/virtualmachines", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces/", parameters('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": "[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'),"/installmongo')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", parameters('vmname'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('mongo-install-ubuntu.sh", parameters('_artifactslocationsastoken')))]"], "commandtoexecute": "sh mongo-install-ubuntu.sh"}}}
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": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnslabelprefix')]"}}}{"comments": "default network security group for template", "type": "microsoft.network/networksecuritygroups", "apiversion": "2020-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": "*"}}]}}
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": "allow_tds_inbound", "properties": {"description": "allow access to data", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "1433", "sourceaddressprefix": "virtualnetwork", "destinationaddressprefix": "*", "access": "allow", "priority": 1000, "direction": "inbound"}}, {"name": "allow_redirect_inbound", "properties": {"description": "allow inbound redirect traffic to managed instance inside the virtual network", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "11000-11999", "sourceaddressprefix": "virtualnetwork", "destinationaddressprefix": "*", "access": "allow", "priority": 1100, "direction": "inbound"}}, {"name": "deny_all_inbound", "properties": {"description": "deny all other inbound traffic", "protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "deny", "priority": 4096, "direction": "inbound"}}, {"name": "deny_all_outbound", "properties": {"description": "deny all other outbound traffic", "protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "deny", "priority": 4096, "direction": "outbound"}}]}}{"type": "microsoft.network/routetables", "apiversion": "2020-06-01", "name": "[variables('routetablename')]", "location": "[parameters('location')]", "properties": {"disablebgproutepropagation": false}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]", "routetable": {"id": "[resourceid('microsoft.network/routetables", variables('routetablename'))]"}, "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}, "delegations": [{"name": "managedinstancedelegation", "properties": {"servicename": "microsoft.sql/managedinstances"}}]}}]}, "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]", "[resourceid('microsoft.network/routetables", variables('routetablename'))]"]}
Create a Data Factory account, Provision SSIS runtime in Azure.

{"name": "[parameters('datafactoryname')]", "apiversion": "2018-06-01", "type": "microsoft.datafactory/factories", "location": "[parameters('location')]", "properties": {}, "resources": [{"name": "[concat(parameters('datafactoryname'), "/spazuressisir')]", "type": "microsoft.datafactory/factories/integrationruntimes", "dependson": ["[parameters('datafactoryname')]"], "apiversion": "2018-06-01", "properties": {"type": "managed", "typeproperties": {"computeproperties": {"location": "[parameters('location')]", "nodesize": "[parameters('nodesize')]", "numberofnodes": "[parameters('nodenumber')]", "maxparallelexecutionspernode": "[parameters('maximumparallelexecutionspernode')]", "vnetproperties": {"vnetid": "[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "subnet": "[parameters('subnetname')]"}}, "ssisproperties": {"cataloginfo": {"catalogserverendpoint": "[parameters('azuresqlservername')]", "catalogadminusername": "[parameters('databaseadminusername')]", "catalogadminpassword": {"type": "securestring", "value": "[parameters('databaseadminpassword')]"}, "catalogpricingtier": "[parameters('catalogpricingtier')]"}}}}}]}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.

{"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'))]"}]}}}
This template creates a Machine Learning Service ADLA Compute.

{"type": "microsoft.machinelearningservices/workspaces", "apiversion": "2020-08-01", "name": "[parameters('workspacename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.insights/components", parameters('applicationinsightsname'))]", "[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]", "[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"], "identity": {"type": "systemassigned"}, "properties": {"friendlyname": "[parameters('workspacename')]", "storageaccount": "[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]", "keyvault": "[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]", "applicationinsights": "[resourceid('microsoft.insights/components", parameters('applicationinsightsname'))]"}}
This template creates a lab in Azure DevTest Labs with a Windows Server 2019 Datacenter VM

{"type": "microsoft.devtestlab/labs", "apiversion": "2018-10-15-preview", "name": "[parameters('labname')]", "location": "[parameters('location')]", "resources": [{"type": "virtualnetworks", "apiversion": "2018-10-15-preview", "name": "[variables('labvirtualnetworkname')]", "dependson": ["[resourceid('microsoft.devtestlab/labs", parameters('labname'))]"]}, {"type": "virtualmachines", "apiversion": "2018-10-15-preview", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.devtestlab/labs", parameters('labname'))]", "[resourceid('microsoft.devtestlab/labs/virtualnetworks", parameters('labname'), variables('labvirtualnetworkname'))]"], "properties": {"username": "[parameters('username')]", "password": "[parameters('password')]", "labvirtualnetworkid": "[variables('labvirtualnetworkid')]", "labsubnetname": "[variables('labsubnetname')]", "size": "[parameters('vmsize')]", "allowclaim": "true", "galleryimagereference": {"offer": "windowsserver", "publisher": "microsoftwindowsserver", "sku": "2019-datacenter", "ostype": "windows", "version": "latest"}}}]}
Create a VM from a Windows Image with 4 Empty Data Disks

{"type": "microsoft.compute/disks", "apiversion": "2019-11-01", "name": "[concat(parameters('virtualmachinename'),"-datadisk-ultrassd-",copyindex())]", "location": "[parameters('location')]", "sku": {"name": "ultrassd_lrs"}, "zones": ["[parameters('zone')]"], "properties": {"creationdata": {"createoption": "empty"}, "disksizegb": "[parameters('sqllogultrassddisksizeingb')]", "diskiopsreadwrite": "[parameters('sqllogultrassddiskiopsreadwrite')]", "diskmbpsreadwrite": "[parameters('sqllogultrassddiskmbpsreadwrite')]"}, "copy": {"name": "ultrassdloop", "count": 1}}{"type": "microsoft.compute/disks", "apiversion": "2019-11-01", "name": "[concat(parameters('virtualmachinename'),"-datadisk-",copyindex())]", "location": "[parameters('location')]", "sku": {"name": "premium_lrs"}, "zones": ["[parameters('zone')]"], "properties": {"creationdata": {"createoption": "empty"}, "disksizegb": "[variables('datadisks').disksizegb]"}, "copy": {"name": "premiumssdloop", "count": "[parameters('sqldatadiskscount')]"}}
Deploy a new SQL Elastic Pool.

{"type": "microsoft.sql/servers", "apiversion": "2020-02-02-preview", "location": "[parameters('location')]", "name": "[parameters('servername')]", "properties": {"administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]", "version": "12.0"}}{"type": "microsoft.sql/servers/elasticpools", "apiversion": "2020-02-02-preview", "dependson": ["[resourceid('microsoft.sql/servers/", parameters('servername'))]"], "location": "[parameters('location')]", "name": "[concat(parameters('servername'), "/", parameters('elasticpoolname'))]", "sku": {"name": "[variables('skuname')]", "tier": "[variables('skutier')]", "capacity": "[parameters('capacity')]"}, "properties": {"perdatabasesettings": {"mincapacity": "[parameters('databasecapacitymin')]", "maxcapacity": "[parameters('databasecapacitymax')]"}}}{"type": "microsoft.sql/servers/databases", "name": "[concat(parameters('servername'), "/", parameters('databasesnames')[copyindex()])]", "location": "[parameters('location')]", "apiversion": "2020-02-02-preview", "dependson": ["[resourceid('microsoft.sql/servers/", parameters('servername'))]", "[resourceid('microsoft.sql/servers/elasticpools", parameters('servername'), parameters('elasticpoolname'))]"], "sku": {"name": "elasticpool", "tier": "[variables('skutier')]", "capacity": 0}, "properties": {"collation": "[parameters('databasecollation')]", "elasticpoolid": "[resourceid('microsoft.sql/servers/elasticpools", parameters('servername'), parameters('elasticpoolname'))]"}, "copy": {"name": "adddatabasesinelasticpool", "count": "[length(parameters('databasesnames'))]"}}{"apiversion": "2020-02-02-preview", "dependson": ["[resourceid('microsoft.sql/servers/", parameters('servername'))]"], "location": "[parameters('location')]", "name": "[concat(parameters('servername'), "/", "allowallwindowsazureips')]", "properties": {"endipaddress": "0.0.0.0", "startipaddress": "0.0.0.0"}, "type": "microsoft.sql/servers/firewallrules"}
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}}