MihaiIonascu/Azure_IaC_test huggingface dataset:
Establish connection to a VNET via an ExpressRoute circuit

{"type": "microsoft.network/publicipaddresses", "apiversion": "2021-02-01", "name": "[parameters('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[parameters('dnslabelprefix')]"}}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2021-02-01", "name": "[variables('nicname')]", "location": "[parameters('location')]", "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", parameters('publicipaddressname'))]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('existingvnetname'), parameters('existingsubnetname'))]"}}}]}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", parameters('publicipaddressname'))]"]}
This template creates a data collection rule defining the data source (Syslog) and the destination workspace.

{"type": "microsoft.insights/autoscalesettings", "name": "[variables('settingname')]", "dependson": ["[resourceid('microsoft.compute/virtualmachinescalesets", variables('naminginfix'))]"], "apiversion": "2015-04-01", "location": "[parameters('location')]", "properties": {"profiles": [{"name": "defaultautoscaleprofile", "capacity": {"minimum": "[parameters('minimumcapacity')]", "maximum": "[parameters('maximumcapacity')]", "default": "[parameters('defaultcapacity')]"}, "rules": [{"metrictrigger": {"metricname": "[parameters('metricname')]", "metricresourceuri": "[resourceid('microsoft.compute/virtualmachinescalesets", variables('naminginfix'))]", "timegrain": "pt5m", "statistic": "average", "timewindow": "pt10m", "timeaggregation": "average", "operator": "greaterthan", "threshold": "[parameters('metricthresholdtoscaleout')]"}, "scaleaction": {"direction": "increase", "type": "percentchangecount", "value": "[parameters('changepercentscaleout')]", "cooldown": "pt10m"}}, {"metrictrigger": {"metricname": "[parameters('metricname')]", "metricresourceuri": "[resourceid('microsoft.compute/virtualmachinescalesets", variables('naminginfix'))]", "timegrain": "pt5m", "statistic": "average", "timewindow": "pt10m", "timeaggregation": "average", "operator": "lessthan", "threshold": "[parameters('metricthresholdtoscalein')]"}, "scaleaction": {"direction": "decrease", "type": "percentchangecount", "value": "[parameters('changepercentscalein')]", "cooldown": "pt10m"}}]}], "enabled": "[parameters('autoscaleenabled')]", "targetresourceuri": "[resourceid('microsoft.compute/virtualmachinescalesets", variables('naminginfix'))]"}}
This template allows you to deploy an AKS cluster can be easily integrated with entreprise-grade devops process and fullfil the condition to be attached with Azure ML as compute target resources

{"type": "microsoft.containerinstance/containergroups", "apiversion": "2021-03-01", "name": "[variables('containergroupname')]", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[variables('containername')]", "properties": {"image": "[variables('containerimageuri')]", "ports": [{"port": 80}], "resources": {"requests": {"cpu": 1, "memoryingb": 4}}}}], "restartpolicy": "onfailure", "ostype": "linux", "networkprofile": {"id": "[resourceid('microsoft.network/networkprofiles", variables('containergroupnetworkprofilename'))]"}}, "dependson": ["[resourceid('microsoft.network/networkprofiles", variables('containergroupnetworkprofilename'))]"]}
Establish connection to a VNET via an ExpressRoute circuit

{"comments": "simple network security group for subnet [variables('subnetname')]", "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": "*"}}]}}{"type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "apiversion": "2020-05-01", "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'))]"}}}]}}{"type": "microsoft.network/networkinterfaces", "name": "[variables('jumpboxnicname')]", "location": "[parameters('location')]", "apiversion": "2020-05-01", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]", "[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"name": "[variables('jumpboxipconfigname')]", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname'))]"}, "subnet": {"id": "[variables('subnetref')]"}}}]}}
This module creates a key resource in an existing KeyVault with apiVersion 2019-09-01.

{"type": "microsoft.keyvault/vaults", "apiversion": "2021-06-01-preview", "name": "[parameters('keyvaultname')]", "location": "[parameters('location')]", "properties": {"sku": {"name": "standard", "family": "a"}, "tenantid": "[reference(resourceid('microsoft.managedidentity/userassignedidentities", variables('identityname'))).tenantid]", "enablerbacauthorization": true, "enablesoftdelete": true}, "dependson": ["[resourceid('microsoft.managedidentity/userassignedidentities", variables('identityname'))]"]}{"type": "microsoft.keyvault/vaults/secrets", "apiversion": "2019-09-01", "name": "[format('{0}/sslcert", parameters('keyvaultname'))]", "properties": {"value": "[parameters('sslcertvalue')]", "contenttype": "application/x-pkcs12", "attributes": {"enabled": true}}, "dependson": ["[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]"]}
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.network/networkinterfaces/", concat(variables('vmname'), "-nic'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('osimagepublisher')]", "offer": "[variables('osimageoffer')]", "sku": "[variables('osimagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmname'),"-osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat(variables('vmname'), "-nic'))]"}]}}}{"apiversion": "2015-06-15", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'), "/installscript')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmname'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('scriptdownloaduri')]"], "commandtoexecute": "[variables('installcommand')]"}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy

{"apiversion": "2021-01-01", "type": "microsoft.storage/storageaccounts", "name": "[parameters('adlsstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_ragrs"}, "kind": "storagev2", "properties": {"networkacls": {"defaultaction": "[parameters('adlsstorageaccountnetworkaclsdefaultaction')]", "bypass": "azureservices"}, "allowblobpublicaccess": "[parameters('adlsstorageaccountallowblobpublicaccess')]"}}{"apiversion": "2021-01-01", "type": "microsoft.storage/storageaccounts", "name": "[parameters('blobstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storagev2", "properties": {"networkacls": {"defaultaction": "[parameters('blobstorageaccountnetworkaclsdefaultaction')]", "bypass": "azureservices"}, "allowblobpublicaccess": "[parameters('blobstorageaccountallowblobpublicaccess')]"}}
Create a VM from a Windows Image with 4 Empty Data Disks

{"apiversion": "2020-12-01", "type": "microsoft.compute/virtualmachines", "name": "[concat(variables('region-tm-test-vm'),copyindex())]", "location": "[variables('region')[copyindex()]]", "tags": {"displayname": "regions-test-vms"}, "comments": "test vms to test traffic manager scenario from each region!", "dependson": ["region-tm-vm-pips-loop", "region-tm-vm-nics-loop"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "storageprofile": {"imagereference": {"publisher": "microsoftwindowsserver", "offer": "windowsserver", "sku": "2012-r2-datacenter", "version": "latest"}, "osdisk": {"createoption": "fromimage", "caching": "readwrite"}}, "osprofile": {"computername": "[replace(replace(concat(variables('region-tm-test-vm'),copyindex()),"_","'),"-","')]", "adminusername": "[parameters('adminuser')]", "windowsconfiguration": {"provisionvmagent": true, "enableautomaticupdates": true}, "adminpassword": "[parameters('adminuserpassword')]"}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(variables('region-tm-vm-nic'), copyindex()))]"}]}}, "copy": {"name": "test-vms-loop", "count": 2}}
This template enables encryption on a running linux vm using AAD client secret.

{"type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2020-12-01", "location": "[parameters('location')]", "name": "[concat(parameters('vmname'),"/diskencryption')]", "properties": {"publisher": "microsoft.azure.security", "type": "[variables('extensionname')]", "typehandlerversion": "[variables('extensionversion')]", "autoupgrademinorversion": true, "forceupdatetag": "[parameters('forceupdatetag')]", "settings": {"encryptionoperation": "[variables('encryptionoperation')]", "keyvaulturl": "[variables('keyvaulturl')]", "keyvaultresourceid": "[variables('keyvaultresourceid')]", "keyencryptionkeyurl": "[parameters('keyencryptionkeyurl')]", "kekvaultresourceid": "[if(empty(parameters('keyencryptionkeyurl')),"",variables('keyvaultresourceid'))]", "keyencryptionalgorithm": "[parameters('keyencryptionalgorithm')]", "volumetype": "[parameters('volumetype')]"}}}
This template deploys a VM Scale Set of Ubuntu VMs with incoming web connections balanced by the Azure Application Gateway

{"type": "microsoft.compute/virtualmachinescalesets", "name": "[variables('naminginfix')]", "location": "[parameters('location')]", "apiversion": "2017-03-30", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/applicationgateways/", variables('appgwname'))]"], "sku": {"name": "[parameters('vmsku')]", "tier": "standard", "capacity": "[parameters('instancecount')]"}, "properties": {"overprovision": "true", "singleplacementgroup": "false", "upgradepolicy": {"mode": "automatic"}, "virtualmachineprofile": {"storageprofile": {"osdisk": {"caching": "readwrite", "createoption": "fromimage"}, "imagereference": "[variables('imagereference')]"}, "osprofile": {"computernameprefix": "[variables('naminginfix')]", "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/", variables('virtualnetworkname'), variables('subnetname'))]"}, "applicationgatewaybackendaddresspools": [{"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools/", variables('appgwname'), variables('appgwbepoolname'))]"}]}}]}}]}}}}
This template deploys 3 Nodetype Service Fabric Cluster. it also allows you to allows you to control the inbound and outbound network traffic using Network Security Groups

{"apiversion": "2018-02-01", "type": "microsoft.servicefabric/clusters", "name": "[parameters('clustername')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('supportlogstorageaccountname'))]"], "properties": {"certificate": {"thumbprint": "[parameters('certificatethumbprint')]", "x509storename": "[parameters('certificatestorevalue')]"}, "clusterstate": "default", "diagnosticsstorageaccountconfig": {"blobendpoint": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('supportlogstorageaccountname')), "2021-04-01').primaryendpoints.blob]", "protectedaccountkeyname": "storageaccountkey1", "queueendpoint": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('supportlogstorageaccountname')), "2021-04-01').primaryendpoints.queue]", "storageaccountname": "[variables('supportlogstorageaccountname')]", "tableendpoint": "[reference(resourceid('microsoft.storage/storageaccounts/", variables('supportlogstorageaccountname')), "2021-04-01').primaryendpoints.table]"}, "fabricsettings": [{"parameters": [{"name": "clusterprotectionlevel", "value": "[parameters('clusterprotectionlevel')]"}], "name": "security"}], "managementendpoint": "[concat('https://", reference(variables('lbipnameurl')).dnssettings.fqdn,":",variables('nodesettings')[0].fabrichttpgatewayport)]", "copy": [{"name": "nodetypes", "count": "[length(variables('nodesettings'))]", "input": {"name": "[variables('nodesettings')[copyindex('nodetypes')].vmnodetypename]", "applicationports": {"endport": "[variables('nodesettings')[copyindex('nodetypes')].applicationendport]", "startport": "[variables('nodesettings')[copyindex('nodetypes')].applicationstartport]"}, "clientconnectionendpointport": "[variables('nodesettings')[copyindex('nodetypes')].fabrictcpgatewayport]", "durabilitylevel": "bronze", "ephemeralports": {"endport": "[variables('nodesettings')[copyindex('nodetypes')].ephemeralendport]", "startport": "[variables('nodesettings')[copyindex('nodetypes')].ephemeralstartport]"}, "httpgatewayendpointport": "[variables('nodesettings')[copyindex('nodetypes')].fabrichttpgatewayport]", "isprimary": true, "vminstancecount": "[variables('nodesettings')[0].instancecount]"}}], "provisioningstate": "default", "reliabilitylevel": "silver", "upgrademode": "automatic", "vmimage": "windows"}, "tags": {"resourcetype": "service fabric", "clustername": "[parameters('clustername')]"}}
Application Gateway routing Internet traffic to a virtual network (internal mode) API Management instance which services a web API hosted in an Azure Web App.

{"apiversion": "2019-08-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "tags": {"displayname": "hostingplan"}, "sku": {"name": "s1", "capacity": "1"}, "properties": {"name": "[variables('hostingplanname')]"}}
This module creates a storageAccount resource with apiVersion 2021-01-01.

{"apiversion": "2021-02-01", "type": "microsoft.storage/storageaccounts", "name": "[variables('supportlogstorageaccountname')]", "location": "[variables('computelocation')]", "properties": {}, "kind": "storage", "sku": {"name": "[parameters('supportlogstorageaccounttype')]"}, "tags": {"resourcetype": "service fabric", "clustername": "[parameters('clustername')]"}}{"apiversion": "2021-02-01", "type": "microsoft.storage/storageaccounts", "name": "[variables('applicationdiagnosticsstorageaccountname')]", "location": "[variables('computelocation')]", "properties": {}, "kind": "storage", "sku": {"name": "[parameters('applicationdiagnosticsstorageaccounttype')]"}, "tags": {"resourcetype": "service fabric", "clustername": "[parameters('clustername')]"}}
Create a VM from a Windows Image with 4 Empty Data Disks

{"apiversion": "2020-12-01", "type": "microsoft.compute/availabilitysets", "name": "[variables('availabilitysetname')]", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 5}}{"apiversion": "2020-12-01", "type": "microsoft.compute/virtualmachines", "name": "[concat(variables('appvmname'),copyindex())]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", concat(variables('appvmname'), copyindex(), "-nic'))]", "[resourceid('microsoft.compute/availabilitysets/", variables('availabilitysetname'))]"], "properties": {"availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets",variables('availabilitysetname'))]"}, "hardwareprofile": {"vmsize": "[parameters('appvmsize')]"}, "osprofile": {"computername": "[concat(variables('appvmname'),copyindex())]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('osimagepublisher')]", "offer": "[variables('osimageoffer')]", "sku": "[variables('osimagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('appvmname'),copyindex(),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat(variables('appvmname'), copyindex(), "-nic'))]"}]}}, "copy": {"name": "appvmcopy", "count": "[parameters('appvmcount')]"}}