Description
stringlengths
19
200
IaC
stringlengths
128
8.16k
Create a VM from a Windows Image with 4 Empty Data Disks
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/dependencyagent')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]", "[variables('dnsomsagentforlinuxid')]"], "properties": {"publisher": "microsoft.azure.monitoring.dependencyagent", "type": "dependencyagentlinux", "typehandlerversion": "9.10", "autoupgrademinorversion": true}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/dependencyagent')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]", "[variables('dnsomsagentforlinuxid')]"], "properties": {"publisher": "microsoft.azure.monitoring.dependencyagent", "type": "dependencyagentlinux", "typehandlerversion": "9.10", "autoupgrademinorversion": true}}{"apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines", "name": "[parameters('devvmname')]", "location": "[parameters('location')]", "identity": {"type": "systemassigned"}, "dependson": ["[variables('adlsstorageaccountadlsprivateendpointid')]", "[variables('adlsstorageaccountblobprivateendpointid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('devvmnicid')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('devvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('devvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('devvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('devvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/availabilitysets", "comments": "thi is the availability set for creating a ha cluster, run the template multiple times to get multiple dns servers", "name": "[parameters('dnsavailabilitysetname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "aligned"}, "properties": {"platformfaultdomaincount": 2, "platformupdatedomaincount": 2}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines", "name": "[parameters('dnsvmname')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsavailabilitysetid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('dnsvmnicid')]"], "properties": {"availabilityset": {"id": "[variables('dnsavailabilitysetid')]"}, "hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('dnsvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('dnsvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('dnsvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('dnsvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/customscript')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('dnsvmscriptfileuri')]"], "commandtoexecute": "[concat('./", variables('dnsvmscriptfilename'))]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}{"condition": "[parameters('deploycustomdnsforwarder')]", "apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('dnsvmname'),"/dependencyagent')]", "location": "[parameters('location')]", "dependson": ["[variables('dnsvmid')]", "[variables('workspaceid')]", "[variables('dnscustomscriptid')]", "[variables('dnsomsagentforlinuxid')]"], "properties": {"publisher": "microsoft.azure.monitoring.dependencyagent", "type": "dependencyagentlinux", "typehandlerversion": "9.10", "autoupgrademinorversion": true}}{"apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines", "name": "[parameters('devvmname')]", "location": "[parameters('location')]", "identity": {"type": "systemassigned"}, "dependson": ["[variables('adlsstorageaccountadlsprivateendpointid')]", "[variables('adlsstorageaccountblobprivateendpointid')]", "[variables('blobstorageaccountblobprivateendpointid')]", "[variables('devvmnicid')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('devvmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[parameters('imagepublisher')]", "offer": "[parameters('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('devvmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "disksizegb": "[parameters('osdisksize')]", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}, "copy": [{"name": "datadisks", "count": "[parameters('numdatadisks')]", "input": {"caching": "[parameters('datadiskcaching')]", "disksizegb": "[parameters('datadisksize')]", "lun": "[copyindex('datadisks')]", "name": "[concat(parameters('devvmname'),"-datadisk",copyindex('datadisks'))]", "createoption": "empty", "manageddisk": {"storageaccounttype": "[parameters('diskstorageaccountype')]"}}}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('devvmnicname'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(variables('blobstorageaccountid')).primaryendpoints["blob"]]"}}}}{"apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('devvmname'), "/customscript')]", "location": "[parameters('location')]", "dependson": ["[variables('devvmid')]", "[variables('devcontributorroleassignmentid')]", "[variables('devstorageblobdatacontributorroleassignmentid')]", "[variables('firewallpolicydefaultnetworkrulecollectiongroupid')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.1", "autoupgrademinorversion": true, "settings": {"skipdos2unix": false, "timestamp": 123456789, "fileuris": ["[variables('testvmscriptfileuri')]"]}, "protectedsettings": {"commandtoexecute": "[concat('bash ", variables('testvmscriptfilename'), " ", parameters('privatednszonename'), " ", parameters('devvmname'), " ", parameters('prodvmname'), " ", variables('adlsserviceprimaryendpoint'), " ", variables('blobserviceprimaryendpoint'))]"}}}{"apiversion": "2020-06-01", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('devvmname'),"/loganalytics')]", "location": "[parameters('location')]", "dependson": ["[variables('devvmid')]", "[variables('workspaceid')]", "[variables('devcustomscriptid')]"], "properties": {"publisher": "microsoft.enterprisecloud.monitoring", "type": "omsagentforlinux", "typehandlerversion": "1.12", "settings": {"workspaceid": "[reference(variables('workspaceid'), "2020-03-01-preview').customerid]", "stoponmultipleconnections": false}, "protectedsettings": {"workspacekey": "[listkeys(variables('workspaceid'),"2020-03-01-preview').primarysharedkey]"}}}
This template uses Azure Managed Identity to assign access to Azure Maps. See more at https://aka.ms/amauth
{"apiversion": "2020-04-01-preview", "type": "microsoft.authorization/roleassignments", "name": "[variables('devcontributorroleassignmentguid')]", "dependson": ["[variables('devvmid')]"], "properties": {"roledefinitionid": "[variables('contributorroleid')]", "principalid": "[reference(variables('devvmid'), "2020-06-01", "full').identity.principalid]", "scope": "[resourcegroup().id]"}}
This template uses Azure Managed Identity to assign access to Azure Maps. See more at https://aka.ms/amauth
{"apiversion": "2020-04-01-preview", "type": "microsoft.authorization/roleassignments", "name": "[variables('devcontributorroleassignmentguid')]", "dependson": ["[variables('devvmid')]"], "properties": {"roledefinitionid": "[variables('contributorroleid')]", "principalid": "[reference(variables('devvmid'), "2020-06-01", "full').identity.principalid]", "scope": "[resourcegroup().id]"}}{"apiversion": "2020-04-01-preview", "type": "microsoft.authorization/roleassignments", "name": "[variables('devstorageblobdatacontributorroleassignmentguid')]", "dependson": ["[variables('devvmid')]"], "properties": {"roledefinitionid": "[variables('storageblobdatacontributorroleid')]", "principalid": "[reference(variables('devvmid'), "2020-06-01", "full').identity.principalid]", "scope": "[resourcegroup().id]"}}
This template uses Azure Managed Identity to assign access to Azure Maps. See more at https://aka.ms/amauth
{"apiversion": "2020-04-01-preview", "type": "microsoft.authorization/roleassignments", "name": "[variables('devcontributorroleassignmentguid')]", "dependson": ["[variables('devvmid')]"], "properties": {"roledefinitionid": "[variables('contributorroleid')]", "principalid": "[reference(variables('devvmid'), "2020-06-01", "full').identity.principalid]", "scope": "[resourcegroup().id]"}}{"apiversion": "2020-04-01-preview", "type": "microsoft.authorization/roleassignments", "name": "[variables('devstorageblobdatacontributorroleassignmentguid')]", "dependson": ["[variables('devvmid')]"], "properties": {"roledefinitionid": "[variables('storageblobdatacontributorroleid')]", "principalid": "[reference(variables('devvmid'), "2020-06-01", "full').identity.principalid]", "scope": "[resourcegroup().id]"}}{"apiversion": "2020-04-01-preview", "type": "microsoft.authorization/roleassignments", "name": "[variables('prodcontributorroleassignmentguid')]", "dependson": ["[variables('prodvmid')]"], "properties": {"roledefinitionid": "[variables('contributorroleid')]", "principalid": "[reference(variables('prodvmid'), "2020-06-01", "full').identity.principalid]", "scope": "[resourcegroup().id]"}}
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')]"}}
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')]"}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"comments": "spin up the azure vm", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname') ]", "apiversion": "2021-07-01", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagereference').publisher]", "offer": "[variables('imagereference').offer]", "sku": "[variables('imagereference').sku]", "version": "[variables('imagereference').version]"}, "osdisk": {"name": "[concat(variables('vmname'),"-osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"properties": {"primary": true}, "id": "[resourceid('microsoft.network/networkinterfaces", variables('nicname') )]"}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"comments": "spin up the azure vm", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname') ]", "apiversion": "2021-07-01", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagereference').publisher]", "offer": "[variables('imagereference').offer]", "sku": "[variables('imagereference').sku]", "version": "[variables('imagereference').version]"}, "osdisk": {"name": "[concat(variables('vmname'),"-osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"properties": {"primary": true}, "id": "[resourceid('microsoft.network/networkinterfaces", variables('nicname') )]"}]}}}{"comments": "customer script extension to install and set up quagga", "type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2021-07-01", "name": "[concat(variables('vmname'), "/installquagga')]", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmname'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('customscriptfilepath')]"], "commandtoexecute": "sh quaggadeploy.sh"}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"comments": "spin up the azure vm", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname') ]", "apiversion": "2021-07-01", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagereference').publisher]", "offer": "[variables('imagereference').offer]", "sku": "[variables('imagereference').sku]", "version": "[variables('imagereference').version]"}, "osdisk": {"name": "[concat(variables('vmname'),"-osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"properties": {"primary": true}, "id": "[resourceid('microsoft.network/networkinterfaces", variables('nicname') )]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"comments": "spin up the azure vm", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname') ]", "apiversion": "2021-07-01", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagereference').publisher]", "offer": "[variables('imagereference').offer]", "sku": "[variables('imagereference').sku]", "version": "[variables('imagereference').version]"}, "osdisk": {"name": "[concat(variables('vmname'),"-osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"properties": {"primary": true}, "id": "[resourceid('microsoft.network/networkinterfaces", variables('nicname') )]"}]}}}{"comments": "customer script extension to install and set up quagga", "type": "microsoft.compute/virtualmachines/extensions", "apiversion": "2021-07-01", "name": "[concat(variables('vmname'), "/installquagga')]", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmname'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[variables('customscriptfilepath')]"], "commandtoexecute": "sh quaggadeploy.sh"}}}
This module creates a key resource in an existing KeyVault with apiVersion 2019-09-01.
{"type": "microsoft.keyvault/vaults", "apiversion": "2019-09-01", "name": "[parameters('keyvaultname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.managedidentity/userassignedidentities", parameters('identityname'))]"], "properties": {"sku": {"name": "standard", "family": "a"}, "tenantid": "[reference(variables('identityid')).tenantid]", "accesspolicies": [{"tenantid": "[reference(variables('identityid')).tenantid]", "objectid": "[reference(variables('identityid')).principalid]", "permissions": {"secrets": ["get"]}}], "enablesoftdelete": true}}
This module creates a key resource in an existing KeyVault with apiVersion 2019-09-01.
{"type": "microsoft.keyvault/vaults", "apiversion": "2019-09-01", "name": "[parameters('keyvaultname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.managedidentity/userassignedidentities", parameters('identityname'))]"], "properties": {"sku": {"name": "standard", "family": "a"}, "tenantid": "[reference(variables('identityid')).tenantid]", "accesspolicies": [{"tenantid": "[reference(variables('identityid')).tenantid]", "objectid": "[reference(variables('identityid')).principalid]", "permissions": {"secrets": ["get"]}}], "enablesoftdelete": true}}{"type": "microsoft.keyvault/vaults/secrets", "apiversion": "2019-09-01", "name": "[concat(parameters('keyvaultname'), "/", parameters('secrets')[copyindex()].name)]", "dependson": ["[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]"], "copy": {"name": "secretcopy", "count": "[length(parameters('secrets'))]"}, "properties": {"value": "[parameters('secrets')[copyindex()].value]", "recoverylevel": "purgeable"}}
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')]"}
Creates and optionally secures a Key Vault with logging linked to a storage account.
{"type": "microsoft.keyvault/vaults", "apiversion": "2019-09-01", "name": "[parameters('keyvaultname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.managedidentity/userassignedidentities", parameters('identityname'))]"], "properties": {"sku": {"name": "standard", "family": "a"}, "tenantid": "[reference(variables('identityid')).tenantid]", "accesspolicies": [{"tenantid": "[reference(variables('identityid')).tenantid]", "objectid": "[reference(variables('identityid')).principalid]", "permissions": {"secrets": ["get"]}}], "enablesoftdelete": true}}{"type": "microsoft.keyvault/vaults/secrets", "apiversion": "2019-09-01", "name": "[concat(parameters('keyvaultname'), "/", parameters('secrets')[copyindex()].name)]", "dependson": ["[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]"], "copy": {"name": "secretcopy", "count": "[length(parameters('secrets'))]"}, "properties": {"value": "[parameters('secrets')[copyindex()].value]", "recoverylevel": "purgeable"}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"type": "microsoft.compute/virtualmachines", "apiversion": "2019-12-01", "name": "[concat(variables('vmname'), copyindex())]", "zones": "[split(string(add(mod(copyindex(),3),1)), ",')]", "location": "[parameters('location')]", "copy": {"name": "vmloop", "count": "[parameters('numberofvms')]"}, "dependson": ["nicloop"], "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": "[variables('linuximage')]", "osdisk": {"createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(variables('nicname'), copyindex()))]"}]}}, "resources": [{"type": "extensions", "apiversion": "2019-12-01", "name": "[concat(variables('vmname'), copyindex(), "-installcustomscript')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", concat(variables('vmname'), copyindex()))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('install_apache.sh", parameters('_artifactslocationsastoken')))]"], "commandtoexecute": "sh install_apache.sh"}}}]}
Create a VM from a Windows Image with 4 Empty Data Disks
{"type": "microsoft.compute/virtualmachines", "apiversion": "2019-12-01", "name": "[concat(variables('vmname'), copyindex())]", "zones": "[split(string(add(mod(copyindex(),3),1)), ",')]", "location": "[parameters('location')]", "copy": {"name": "vmloop", "count": "[parameters('numberofvms')]"}, "dependson": ["nicloop"], "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": "[variables('linuximage')]", "osdisk": {"createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(variables('nicname'), copyindex()))]"}]}}, "resources": [{"type": "extensions", "apiversion": "2019-12-01", "name": "[concat(variables('vmname'), copyindex(), "-installcustomscript')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", concat(variables('vmname'), copyindex()))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('install_apache.sh", parameters('_artifactslocationsastoken')))]"], "commandtoexecute": "sh install_apache.sh"}}}]}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"name": "[parameters('vmname')]", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-07-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", concat(parameters('vmname'),"-nic-01'))]", "[resourceid('microsoft.storage/storageaccounts",tolower(parameters('storageaccountname')))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "16.04-lts", "version": "latest"}, "osdisk": {"name": "[concat(parameters('vmname'),"-os-01')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(parameters('vmname'),"-nic-01'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", tolower(parameters('storageaccountname')))).primaryendpoints.blob]"}}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"name": "[tolower(parameters('storageaccountname'))]", "type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storagev2"}
Create a VM from a Windows Image with 4 Empty Data Disks
{"name": "[parameters('vmname')]", "type": "microsoft.compute/virtualmachines", "apiversion": "2019-07-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces", concat(parameters('vmname'),"-nic-01'))]", "[resourceid('microsoft.storage/storageaccounts",tolower(parameters('storageaccountname')))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "16.04-lts", "version": "latest"}, "osdisk": {"name": "[concat(parameters('vmname'),"-os-01')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", concat(parameters('vmname'),"-nic-01'))]"}]}, "diagnosticsprofile": {"bootdiagnostics": {"enabled": true, "storageuri": "[reference(resourceid('microsoft.storage/storageaccounts/", tolower(parameters('storageaccountname')))).primaryendpoints.blob]"}}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"name": "[tolower(parameters('storageaccountname'))]", "type": "microsoft.storage/storageaccounts", "apiversion": "2019-06-01", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storagev2"}
Create an Azure Security Center Automation which will be triggered by specific Security Center Alert (including all severities)
{"scope": "[concat('microsoft.operationalinsights/workspaces/", parameters('existingworkspacename'))]", "type": "microsoft.securityinsights/alertrules", "apiversion": "2021-03-01-preview", "name": "[variables('ruleguid')]", "kind": "scheduled", "properties": {"displayname": "known iridium ip", "description": "iridium command and control ip. identifies a match across various data feeds for ip iocs related to the iridium activity group.", "severity": "high", "enabled": true, "query": "let iplist = dynamic(["154.223.45.38","185.141.207.140","185.234.73.19","216.245.210.106","51.91.48.210","46.255.230.229"]);\n(union isfuzzy=true\n(commonsecuritylog\n| where isnotempty(sourceip) or isnotempty(destinationip)\n| where sourceip in (iplist) or destinationip in (iplist) or message has_any (iplist)\n| extend ipmatch = case(sourceip in (iplist), "sourceip", destinationip in (iplist), "destinationip", "message") \n| summarize starttimeutc = min(timegenerated), endtimeutc = max(timegenerated) by sourceip, destinationip, deviceproduct, deviceaction, message, protocol, sourceport, destinationport, deviceaddress, devicename, ipmatch\n| extend timestamp = starttimeutc, ipcustomentity = case(ipmatch == "sourceip", sourceip, ipmatch == "destinationip", destinationip, "ip in message field") \n),\n(officeactivity\n|extend sourceipaddress = clientip, account = userid\n| where sourceipaddress in (iplist)\n| extend timestamp = timegenerated , ipcustomentity = sourceipaddress , accountcustomentity = account\n),\n(dnsevents \n| extend destinationipaddress = ipaddresses, host = computer\n| where destinationipaddress has_any (iplist) \n| extend timestamp = timegenerated, ipcustomentity = destinationipaddress, hostcustomentity = host\n),\n(imdns \n| extend destinationipaddress = dnsresponsename, host = dvc\n| where destinationipaddress has_any (iplist) \n| extend timestamp = timegenerated, ipcustomentity = srcipaddr, hostcustomentity = host\n),\n(vmconnection \n| where isnotempty(sourceip) or isnotempty(destinationip) \n| where sourceip in (iplist) or destinationip in (iplist) \n| extend ipmatch = case( sourceip in (iplist), "sourceip", destinationip in (iplist), "destinationip", "none") \n| extend timestamp = timegenerated , ipcustomentity = case(ipmatch == "sourceip", sourceip, ipmatch == "destinationip", destinationip, "none"), host = computer\n),\n(event\n| where source == "microsoft-windows-sysmon"\n| where eventid == 3\n| extend evdata = parse_xml(eventdata)\n| extend eventdetail = evdata.dataitem.eventdata.data\n| extend sourceip = eventdetail.[9].["#text"], destinationip = eventdetail.[14].["#text"]\n| where sourceip in (iplist) or destinationip in (iplist) \n| extend ipmatch = case( sourceip in (iplist), "sourceip", destinationip in (iplist), "destinationip", "none") \n| extend timestamp = timegenerated, accountcustomentity = username, hostcustomentity = computer , ipcustomentity = case(ipmatch == "sourceip", sourceip, ipmatch == "destinationip", destinationip, "none")\n),\n(signinlogs\n| where isnotempty(ipaddress)\n| where ipaddress in (iplist)\n| extend timestamp = timegenerated, accountcustomentity = userprincipalname, ipcustomentity = ipaddress\n),\n(aadnoninteractiveusersigninlogs\n| where isnotempty(ipaddress)\n| where ipaddress in (iplist)\n| extend timestamp = timegenerated, accountcustomentity = userprincipalname, ipcustomentity = ipaddress\n),\n(w3ciislog \n| where isnotempty(cip)\n| where cip in (iplist)\n| extend timestamp = timegenerated, ipcustomentity = cip, hostcustomentity = computer, accountcustomentity = csusername\n),\n(azureactivity \n| where isnotempty(calleripaddress)\n| where calleripaddress in (iplist)\n| extend timestamp = timegenerated, ipcustomentity = calleripaddress, accountcustomentity = caller\n),\n(\nawscloudtrail\n| where isnotempty(sourceipaddress)\n| where sourceipaddress in (iplist)\n| extend timestamp = timegenerated, ipcustomentity = sourceipaddress, accountcustomentity = useridentityusername\n),\n(\nazurediagnostics\n| where resourcetype == "azurefirewalls"\n| where category == "azurefirewallapplicationrule"\n| parse msg_s with protocol \"request from \" sourcehost \":\" sourceport \"to \" destinationhost \":\" destinationport \". action:\" action\n| where isnotempty(destinationhost)\n| where destinationhost has_any (iplist) \n| extend destinationip = destinationhost \n| extend ipcustomentity = sourcehost\n),\n(\nazurediagnostics\n| where resourcetype == "azurefirewalls"\n| where category == "azurefirewallnetworkrule"\n| parse msg_s with protocol \"request from \" sourcehost \":\" sourceport \"to \" destinationhost \":\" destinationport \". action:\" action\n| where isnotempty(destinationhost)\n| where destinationhost has_any (iplist) \n| extend destinationip = destinationhost \n| extend ipcustomentity = sourcehost\n)\n)", "queryfrequency": "p1d", "queryperiod": "p1d", "triggeroperator": "greaterthan", "triggerthreshold": 0, "suppressionduration": "pt5h", "suppressionenabled": false, "tactics": ["commandandcontrol"], "alertruletemplatename": "7ee72a9e-2e54-459c-bc8a-8c08a6532a63", "incidentconfiguration": {"createincident": true, "groupingconfiguration": {"enabled": false, "reopenclosedincident": false, "lookbackduration": "pt5h", "matchingmethod": "allentities", "groupbyentities": [], "groupbyalertdetails": [], "groupbycustomdetails": []}}, "eventgroupingsettings": {"aggregationkind": "singlealert"}, "alertdetailsoverride": {"alertdisplaynameformat": "known iridium ip: {{ipcustomentity}}", "alertdescriptionformat": "alert generated at {{timegenerated}}", "alerttacticscolumnname": none, "alertseveritycolumnname": "severity"}, "customdetails": {"group": "aadgroupid"}, "entitymappings": [{"entitytype": "account", "fieldmappings": [{"identifier": "fullname", "columnname": "accountcustomentity"}]}, {"entitytype": "host", "fieldmappings": [{"identifier": "fullname", "columnname": "hostcustomentity"}]}, {"entitytype": "ip", "fieldmappings": [{"identifier": "address", "columnname": "ipcustomentity"}]}]}}
Create an Azure Security Center Automation which will be triggered by specific Security Center Alert (including all severities)
{"type": "microsoft.securityinsights/automationrules", "name": "[variables('automationruleguid')]", "scope": "[concat('microsoft.operationalinsights/workspaces/", parameters('existingworkspacename'))]", "apiversion": "2019-01-01-preview", "properties": {"displayname": "[parameters('automationrulename')]", "order": 2, "triggeringlogic": {"isenabled": true, "expirationtimeutc": none, "triggerson": "incidents", "triggerswhen": "created", "conditions": [{"conditiontype": "property", "conditionproperties": {"propertyname": "incidentrelatedanalyticruleids", "operator": "contains", "propertyvalues": ["[resourceid('microsoft.operationalinsights/workspaces/providers/alertrules",parameters('existingworkspacename'),"microsoft.securityinsights",parameters('existingruleid'))]"]}}, {"conditiontype": "property", "conditionproperties": {"propertyname": "incidentseverity", "operator": "equals", "propertyvalues": ["high"]}}, {"conditiontype": "property", "conditionproperties": {"propertyname": "incidenttactics", "operator": "contains", "propertyvalues": ["initialaccess", "execution"]}}, {"conditiontype": "property", "conditionproperties": {"propertyname": "incidenttitle", "operator": "contains", "propertyvalues": ["urgent"]}}]}, "actions": [{"order": 2, "actiontype": "modifyproperties", "actionconfiguration": {"status": "closed", "classification": "undetermined", "classificationreason": none}}, {"order": 3, "actiontype": "modifyproperties", "actionconfiguration": {"labels": [{"labelname": "tag"}]}}]}}