Description
stringlengths
19
200
IaC
stringlengths
128
8.16k
This template creates a Recovery Services vault that will be used further for Backup and Site Recovery.
{"type": "microsoft.recoveryservices/vaults", "apiversion": "2020-02-02", "name": "[parameters('vaultname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('skuname')]", "tier": "[variables('skutier')]"}, "properties": {}}{"type": "microsoft.recoveryservices/vaults/backupstorageconfig", "apiversion": "2020-02-02", "name": "[format('{0}/{1}", parameters('vaultname'), "vaultstorageconfig')]", "properties": {"storagemodeltype": "[parameters('vaultstoragetype')]", "crossregionrestoreflag": "[parameters('enablecrr')]"}, "dependson": ["[resourceid('microsoft.recoveryservices/vaults", parameters('vaultname'))]"]}
This template creates a Recovery Services Vault without any advanced features or additional resources.
{"type": "microsoft.recoveryservices/vaults", "apiversion": "2020-10-01", "name": "[parameters('vaultname')]", "location": "[parameters('location')]", "properties": {}, "sku": {"name": "rs0", "tier": "standard"}}
This template creates a Backup Policy for Recovery Services Vault to protect Azure IaasVMs
{"type": "microsoft.recoveryservices/vaults", "apiversion": "2020-10-01", "name": "[parameters('vaultname')]", "location": "[parameters('location')]", "sku": {"name": "rs0", "tier": "standard"}, "properties": {}}{"apiversion": "2016-06-01", "name": "[format('{0}/{1}", parameters('vaultname'), parameters('policyname'))]", "type": "microsoft.recoveryservices/vaults/backuppolicies", "dependson": ["[resourceid('microsoft.recoveryservices/vaults", parameters('vaultname'))]"], "location": "[parameters('location')]", "properties": {"backupmanagementtype": "azureiaasvm", "instantrpretentionrangeindays": "[parameters('instantrpretentionrangeindays')]", "schedulepolicy": {"schedulerunfrequency": "daily", "scheduleruntimes": "[parameters('scheduleruntimes')]", "schedulepolicytype": "simpleschedulepolicy"}, "retentionpolicy": {"dailyschedule": {"retentiontimes": "[parameters('scheduleruntimes')]", "retentionduration": {"count": "[parameters('dailyretentiondurationcount')]", "durationtype": "days"}}, "weeklyschedule": {"daysoftheweek": "[parameters('daysoftheweek')]", "retentiontimes": "[parameters('scheduleruntimes')]", "retentionduration": {"count": "[parameters('weeklyretentiondurationcount')]", "durationtype": "weeks"}}, "monthlyschedule": {"retentionscheduleformattype": "daily", "retentionscheduledaily": {"daysofthemonth": [{"date": 1, "islast": false}]}, "retentiontimes": "[parameters('scheduleruntimes')]", "retentionduration": {"count": "[parameters('monthlyretentiondurationcount')]", "durationtype": "months"}}, "yearlyschedule": {"retentionscheduleformattype": "daily", "monthsofyear": "[parameters('monthsofyear')]", "retentionscheduledaily": {"daysofthemonth": [{"date": 1, "islast": false}]}, "retentiontimes": "[parameters('scheduleruntimes')]", "retentionduration": {"count": "[parameters('yearlyretentiondurationcount')]", "durationtype": "years"}}, "retentionpolicytype": "longtermretentionpolicy"}, "timezone": "[parameters('timezone')]"}}
This template configures protection for classic and ARM based Azure IaaSVMs.
{"name": "[concat(parameters('existingrecoveryservicesvaultname'), "/", variables('backupfabric'), "/", parameters('existingprotectioncontainers')[copyindex()], "/", parameters('existingprotectableitems')[copyindex()])]", "apiversion": "2016-06-01", "location": "[parameters('location')]", "type": "microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems", "copy": {"name": "protecteditemscopy", "count": "[length(parameters('existingprotectableitems'))]"}, "properties": {"protecteditemtype": "[variables('protecteditemtype')]", "policyid": "[resourceid('microsoft.recoveryservices/vaults/backuppolicies", parameters('existingrecoveryservicesvaultname'), parameters('existingbackuppolicyname'))]", "sourceresourceid": "[parameters('existingsourceresourceids')[copyindex()]]"}}
This template creates a Recovery Services Vault and a Workload specific Backup Policy. Registers VM with Backup service and Configures Protection
{"condition": "[parameters('isnewvault')]", "type": "microsoft.recoveryservices/vaults", "apiversion": "2018-01-10", "name": "[parameters('vaultname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('skuname')]", "tier": "[variables('skutier')]"}, "properties": {}}{"type": "microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers", "apiversion": "2018-01-10", "name": "[concat(parameters('vaultname'), "/", variables('backupfabric'), "/", variables('containertype'), ";compute;", parameters('vmresourcegroup'),";",parameters('vmname'))]", "dependson": ["[resourceid('microsoft.recoveryservices/vaults/", parameters('vaultname'))]"], "properties": {"containertype": "[variables('containertype')]", "backupmanagementtype": "[variables('backupmanagementtype')]", "workloadtype": "[parameters('workloadtype')]", "friendlyname": "[parameters('vmname')]", "sourceresourceid": "[resourceid(parameters('vmresourcegroup'),"microsoft.compute/virtualmachines", parameters('vmname'))]"}}{"condition": "[parameters('isnewpolicy')]", "type": "microsoft.recoveryservices/vaults/backuppolicies", "apiversion": "2018-01-10", "name": "[concat(parameters('vaultname'), "/", parameters('policyname'))]", "dependson": ["[resourceid('microsoft.recoveryservices/vaults/", parameters('vaultname'))]"], "properties": {"backupmanagementtype": "[variables('backupmanagementtype')]", "workloadtype": "[parameters('workloadtype')]", "settings": {"timezone": "utc", "issqlcompression": false, "iscompression": false}, "subprotectionpolicy": [{"policytype": "full", "schedulepolicy": {"schedulepolicytype": "simpleschedulepolicy", "schedulerunfrequency": "daily", "scheduleruntimes": ["2019-03-24t16:00:00z"], "scheduleweeklyfrequency": 0}, "retentionpolicy": {"retentionpolicytype": "longtermretentionpolicy", "dailyschedule": {"retentiontimes": ["2019-03-24t16:00:00z"], "retentionduration": {"count": 30, "durationtype": "days"}}}}, {"policytype": "log", "schedulepolicy": {"schedulepolicytype": "logschedulepolicy", "schedulefrequencyinmins": 60}, "retentionpolicy": {"retentionpolicytype": "simpleretentionpolicy", "retentionduration": {"count": 30, "durationtype": "days"}}}]}}{"type": "microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems", "apiversion": "2018-01-10", "name": "[concat(parameters('vaultname'), "/", variables('backupfabric'), "/", variables('containertype'), ";compute;", parameters('vmresourcegroup'),";",parameters('vmname'), "/", parameters('workloadtype'), ";", parameters('databaseinstancename'), ";", parameters('databasename'))]", "dependson": ["[resourceid('microsoft.recoveryservices/vaults", parameters('vaultname'))]", "[resourceid('microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers", parameters('vaultname'), variables('backupfabric'), concat(variables('containertype'), ";compute;", parameters('vmresourcegroup'),";",parameters('vmname')))]"], "properties": {"backupmanagementtype": "[variables('backupmanagementtype')]", "workloadtype": "[parameters('workloadtype')]", "protecteditemtype": "[parameters('protecteditemtype')]", "friendlyname": "[parameters('databasename')]", "policyid": "[resourceid('microsoft.recoveryservices/vaults/backuppolicies", parameters('vaultname'), parameters('policyname'))]"}}
This template configures backup of VMs from same Resource Group
{"name": "[concat(parameters('existingrecoveryservicesvault'), "/", variables('backupfabric'), "/", variables('v2vmcontainer'), concat(parameters('existingvirtualmachinesresourcegroup'),";",parameters('existingvirtualmachines')[copyindex()]), "/", variables('v2vm'), concat(parameters('existingvirtualmachinesresourcegroup'),";",parameters('existingvirtualmachines')[copyindex()]))]", "apiversion": "2016-06-01", "location": "[parameters('location')]", "type": "microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems", "copy": {"name": "v2vmscopy", "count": "[length(parameters('existingvirtualmachines'))]"}, "properties": {"protecteditemtype": "[variables('v2vmtype')]", "policyid": "[resourceid('microsoft.recoveryservices/vaults/backuppolicies",parameters('existingrecoveryservicesvault'),parameters('existingbackuppolicy') )]", "sourceresourceid": "[resourceid(subscription().subscriptionid,parameters('existingvirtualmachinesresourcegroup'),"microsoft.compute/virtualmachines",parameters('existingvirtualmachines')[copyindex()])]"}}
This template takes a minimum amount of parameters and deploys a Windows VM and configures backup protection.
{"type": "microsoft.recoveryservices/vaults", "apiversion": "2020-02-02", "name": "[variables('vaultname')]", "location": "[parameters('location')]", "sku": {"name": "rs0", "tier": "standard"}, "properties": {}}{"type": "microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems", "apiversion": "2020-02-02", "name": "[format('{0}/{1}/{2}/{3}", variables('vaultname'), variables('backupfabric'), variables('protectioncontainer'), variables('protecteditem'))]", "properties": {"protecteditemtype": "microsoft.compute/virtualmachines", "policyid": "[format('{0}/backuppolicies/{1}", resourceid('microsoft.recoveryservices/vaults", variables('vaultname')), variables('backuppolicyname'))]", "sourceresourceid": "[resourceid('microsoft.compute/virtualmachines", variables('vmname'))]"}, "dependson": ["[resourceid('microsoft.recoveryservices/vaults", variables('vaultname'))]", "[resourceid('microsoft.compute/virtualmachines", variables('vmname'))]"]}
This template creates a Recovery Services Vault with backup policies configured
{"type": "microsoft.recoveryservices/vaults", "apiversion": "2021-06-01", "name": "[parameters('vaultname')]", "location": "[parameters('location')]", "identity": {"type": "[if(parameters('enablesystemidentity'), "systemassigned", "none')]"}, "properties": {}, "sku": {"name": "[parameters('sku')]", "tier": "standard"}}{"copy": {"name": "backuppolicy", "count": "[length(parameters('backuppolicies'))]"}, "type": "microsoft.recoveryservices/vaults/backuppolicies", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", parameters('vaultname'), parameters('backuppolicies')[copyindex()].policyname)]", "location": "[parameters('location')]", "properties": "[parameters('backuppolicies')[copyindex()].properties]", "dependson": ["[resourceid('microsoft.recoveryservices/vaults", parameters('vaultname'))]"]}{"type": "microsoft.recoveryservices/vaults/backupstorageconfig", "apiversion": "2021-04-01", "name": "[format('{0}/vaultstorageconfig", parameters('vaultname'))]", "properties": {"crossregionrestoreflag": "[parameters('enablecrossregionrestore')]", "storagetype": "[parameters('storagetype')]"}, "dependson": ["[resourceid('microsoft.recoveryservices/vaults", parameters('vaultname'))]"]}
This template provides a way to deploy an Azure database for MariaDB with VNet integration.
{"type": "microsoft.dbformariadb/servers/virtualnetworkrules", "apiversion": "2018-06-01", "name": "[format('{0}/{1}", parameters('servername'), parameters('virtualnetworkrulename'))]", "properties": {"virtualnetworksubnetid": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]", "ignoremissingvnetserviceendpoint": true}, "dependson": ["[resourceid('microsoft.dbformariadb/servers", parameters('servername'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]"]}{"type": "microsoft.dbformariadb/servers", "apiversion": "2018-06-01", "name": "[parameters('servername')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('skuname')]", "tier": "[parameters('skutier')]", "capacity": "[parameters('skucapacity')]", "size": "[format('{0}", parameters('skusizemb'))]", "family": "[parameters('skufamily')]"}, "properties": {"createmode": "default", "version": "[parameters('mariadbversion')]", "administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]", "storageprofile": {"storagemb": "[parameters('skusizemb')]", "backupretentiondays": "[parameters('backupretentiondays')]", "georedundantbackup": "[parameters('georedundantbackup')]"}}}{"copy": {"name": "firewallrules", "count": "[length(variables('firewallrules'))]", "mode": "serial", "batchsize": 1}, "type": "microsoft.dbformariadb/servers/firewallrules", "apiversion": "2018-06-01", "name": "[format('{0}/{1}", parameters('servername'), variables('firewallrules')[copyindex()].name)]", "properties": {"startipaddress": "[variables('firewallrules')[copyindex()].startipaddress]", "endipaddress": "[variables('firewallrules')[copyindex()].endipaddress]"}, "dependson": ["[resourceid('microsoft.dbformariadb/servers", parameters('servername'))]"]}
This template uses Confidential Ledger to log to an immutable, tamper-proof ledger.
{"name": "[parameters('ledgername')]", "type": "microsoft.confidentialledger/ledgers", "apiversion": "2020-12-01-preview", "location": "[parameters('location')]", "properties": {"ledgertype": "public", "aadbasedsecurityprincipals": [{"principalid": "[parameters('principalid')]", "ledgerrolename": "administrator"}]}}
Enable Azure Sentinel
{"type": "microsoft.operationsmanagement/solutions", "apiversion": "2015-11-01-preview", "name": "[format('securityinsights({0})", parameters('workspacename'))]", "location": "[parameters('location')]", "properties": {"workspaceresourceid": "[resourceid('microsoft.operationalinsights/workspaces", parameters('workspacename'))]"}, "plan": {"name": "[format('securityinsights({0})", parameters('workspacename'))]", "product": "omsgallery/securityinsights", "publisher": "microsoft", "promotioncode": ""}, "dependson": ["[resourceid('microsoft.operationalinsights/workspaces", parameters('workspacename'))]"]}
Create a Media Services Account with its Storage account using a template.
{"type": "microsoft.media/mediaservices", "apiversion": "2020-05-01", "name": "[parameters('mediaservicename')]", "location": "[parameters('location')]", "properties": {"storageaccounts": [{"id": "[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "type": "primary"}]}, "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"]}
This template creates an Azure API for FHIR®.
{"type": "microsoft.healthcareapis/services", "apiversion": "2020-03-15", "name": "[parameters('servicename')]", "location": "[parameters('location')]", "kind": "fhir-r4", "properties": {"authenticationconfiguration": {"audience": "[concat('https://", parameters('servicename'), ".azurehealthcareapis.com')]", "authority": "[uri(environment().authentication.loginendpoint, subscription().tenantid)]"}}}
This template creates a Attestation provider that can be used for various attestation types like sgx, vsm enclaves.
{"type": "microsoft.attestation/attestationproviders", "apiversion": "2020-10-01", "name": "[parameters('attestationprovidername')]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", "properties": "[if(empty(parameters('policysigningcertificates')), json('{}'), variables('policysigningcertificates'))]"}
Create a SQL Server Virtual Machine with performance optimized storage settings, using UltraSSD for SQL Log files
{"type": "microsoft.sqlvirtualmachine/sqlvirtualmachines", "apiversion": "2017-03-01-preview", "name": "[parameters('virtualmachinename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"], "properties": {"virtualmachineresourceid": "[resourceid('microsoft.compute/virtualmachines", parameters('virtualmachinename'))]", "sqlmanagement": "full", "sqlserverlicensetype": "payg", "storageconfigurationsettings": {"diskconfigurationtype": "[variables('diskconfigurationtype')]", "storageworkloadtype": "[parameters('storageworkloadtype')]", "sqldatasettings": {"luns": "[variables('datadisksluns')]", "defaultfilepath": "[parameters('datapath')]"}, "sqllogsettings": {"luns": "[variables('logdisksluns')]", "defaultfilepath": "[parameters('logpath')]"}, "sqltempdbsettings": {"defaultfilepath": "[variables('tempdbpath')]"}}}}
Deploy SQL Always ON setup with existing SQL Virtual Machines.
{"type": "microsoft.sqlvirtualmachine/sqlvirtualmachines", "apiversion": "2017-03-01-preview", "name": "[trim(variables('existingvmlistarray')[copyindex()])]", "location": "[parameters('location')]", "copy": {"name": "sqlvirtualmachineloop", "count": "[length(variables('existingvmlistarray'))]"}, "properties": {"virtualmachineresourceid": "[resourceid(parameters('existingvmresourcegroup'), "microsoft.compute/virtualmachines", trim(variables('existingvmlistarray')[copyindex()]))]", "sqlserverlicensetype": "[parameters('sqlserverlicensetype')]"}}{"type": "microsoft.sqlvirtualmachine/sqlvirtualmachinegroups", "apiversion": "2017-03-01-preview", "name": "[parameters('failoverclustername')]", "location": "[parameters('location')]", "properties": {"sqlimageoffer": "[parameters('sqlserverimagetype')]", "sqlimagesku": "enterprise", "wsfcdomainprofile": {"domainfqdn": "[parameters('existingfullyqualifieddomainname')]", "oupath": "[parameters('existingoupath')]", "clusterbootstrapaccount": "[parameters('existingdomainaccount')]", "clusteroperatoraccount": "[parameters('existingdomainaccount')]", "sqlserviceaccount": "[parameters('existingsqlserviceaccount')]", "storageaccounturl": "[reference(resourceid('microsoft.storage/storageaccounts", parameters('cloudwitnessname')), "2018-07-01').primaryendpoints["blob"]]", "storageaccountprimarykey": "[listkeys(resourceid('microsoft.storage/storageaccounts", parameters('cloudwitnessname')), "2018-07-01').keys[0].value]"}}}
Create a SQL Server Virtual Machine with performance optimized storage settings on PremiumSSD
{"type": "microsoft.sqlvirtualmachine/sqlvirtualmachines", "apiversion": "2017-03-01-preview", "name": "[parameters('virtualmachinename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"], "properties": {"virtualmachineresourceid": "[resourceid('microsoft.compute/virtualmachines", parameters('virtualmachinename'))]", "sqlmanagement": "full", "sqlserverlicensetype": "payg", "storageconfigurationsettings": {"diskconfigurationtype": "[variables('diskconfigurationtype')]", "storageworkloadtype": "[parameters('storageworkloadtype')]", "sqldatasettings": {"luns": "[variables('datadisksluns')]", "defaultfilepath": "[parameters('datapath')]"}, "sqllogsettings": {"luns": "[variables('logdisksluns')]", "defaultfilepath": "[parameters('logpath')]"}, "sqltempdbsettings": {"defaultfilepath": "[variables('tempdbpath')]"}}}}
Create new Azure NetApp Files resource with SMB volume
{"type": "microsoft.netapp/netappaccounts", "apiversion": "2020-06-01", "name": "[parameters('netappaccountname')]", "location": "[parameters('location')]", "properties": {"activedirectories": [{"username": "[parameters('adusername')]", "password": "[parameters('adpassword')]", "domain": "[parameters('domainname')]", "dns": "[parameters('dnsipaddress')]", "smbservername": "[parameters('smbservername')]"}]}}{"type": "microsoft.netapp/netappaccounts/capacitypools", "apiversion": "2020-06-01", "name": "[concat(parameters('netappaccountname'),"/",parameters('netapppoolname'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.netapp/netappaccounts", parameters('netappaccountname'))]"], "properties": {"servicelevel": "[parameters('servicelevel')]", "size": "[parameters('poolsizebytes')]"}}{"type": "microsoft.netapp/netappaccounts/capacitypools/volumes", "apiversion": "2020-06-01", "name": "[concat(parameters('netappaccountname'),"/",parameters('netapppoolname'),"/", parameters('netappvolumename'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.netapp/netappaccounts/capacitypools", parameters('netappaccountname'), parameters('netapppoolname'))]", "addsubnet"], "properties": {"servicelevel": "[parameters('servicelevel')]", "creationtoken": "[parameters('netappvolumename')]", "usagethreshold": "[parameters('volsizebytes')]", "subnetid": "[resourceid(parameters('virtualnetworksubscriptionid'), parameters('virtualnetworkresourcegroupname'), "microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('anfsubnetname'))]"}}
Create new Azure NetApp Files resource with NFSV3 or NFSv4.1 volume
{"type": "microsoft.netapp/netappaccounts", "apiversion": "2020-06-01", "name": "[parameters('netappaccountname')]", "location": "[parameters('location')]", "properties": {}}{"type": "microsoft.netapp/netappaccounts/capacitypools", "apiversion": "2020-06-01", "name": "[variables('capacitypoolname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.netapp/netappaccounts", parameters('netappaccountname'))]"], "properties": {"servicelevel": "[parameters('servicelevel')]", "size": "[parameters('poolsizebytes')]"}}{"type": "microsoft.netapp/netappaccounts/capacitypools/volumes", "apiversion": "2020-06-01", "name": "[variables('volumename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.netapp/netappaccounts/capacitypools", parameters('netappaccountname'), parameters('netapppoolname'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]"], "properties": {"servicelevel": "[parameters('servicelevel')]", "creationtoken": "[parameters('netappvolumename')]", "usagethreshold": "[parameters('volsizebytes')]", "exportpolicy": {"rules": [{"ruleindex": 1, "unixreadonly": "[parameters('unixreadonly')]", "unixreadwrite": "[parameters('unixreadwrite')]", "cifs": false, "nfsv3": "[if(equals( parameters('protocoltypes'), "nfsv3'),bool('true'),bool('false'))]", "nfsv41": "[if(equals(parameters('protocoltypes'), "nfsv4.1'),bool('true'),bool('false'))]", "allowedclients": "[parameters('allowedclients')]"}]}, "protocoltypes": ["[parameters('protocoltypes')]"], "subnetid": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]", "snapshotdirectoryvisible": "[parameters('snapshotdirectoryvisible')]"}}
This template creates a vnet and a subnet hosting a Linux virtual machine that accesses a Event Hubs namespace with a private endpoint.
{"apiversion": "2018-01-01-preview", "name": "[parameters('eventhubsnamespacename')]", "type": "microsoft.eventhub/namespaces", "location": "[parameters('location')]", "sku": {"name": "[parameters('eventhubsnamespacesku')]", "tier": "[parameters('eventhubsnamespacesku')]", "capacity": "[parameters('eventhubsnamespacecapacity')]"}, "properties": {"zoneredundant": "[parameters('eventhubsnamespacezoneredundant')]"}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('eventhubname')]", "type": "eventhubs", "dependson": ["[variables('eventhubsnamespaceid')]"], "properties": {}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('consumergroupname')]", "type": "consumergroups", "dependson": ["[parameters('eventhubname')]"], "properties": {"usermetadata": "user metadata goes here"}}]}]}
This template creates a EventHub Basic/Standard namespace.
{"apiversion": "2018-01-01-preview", "name": "[parameters('eventhubnamespacenamesecondary')]", "type": "microsoft.eventhub/namespaces", "location": "[parameters('locationsecondarynamepsace')]", "sku": {"name": "[parameters('eventhubsku')]", "tier": "[parameters('eventhubsku')]", "capacity": "[parameters('skucapacity')]"}, "tags": {"tag1": "value1", "tag2": "value2"}}{"apiversion": "2018-01-01-preview", "name": "[parameters('eventhubnamespacenameprimary')]", "type": "microsoft.eventhub/namespaces", "dependson": ["[resourceid('microsoft.eventhub/namespaces/", parameters('eventhubnamespacenamesecondary'))]"], "location": "[parameters('locationprimarynamepsace')]", "sku": {"name": "[parameters('eventhubsku')]", "tier": "[parameters('eventhubsku')]", "capacity": "[parameters('skucapacity')]"}, "tags": {"tag1": "value1", "tag2": "value2"}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('aliasname')]", "type": "disasterrecoveryconfigs", "dependson": ["[resourceid('microsoft.eventhub/namespaces/", parameters('eventhubnamespacenameprimary'))]"], "properties": {"partnernamespace": "[resourceid('microsoft.eventhub/namespaces", parameters('eventhubnamespacenamesecondary'))]"}}]}
Creates a Event Hub cluster and namesapce in the cluster
{"type": "microsoft.eventhub/clusters", "apiversion": "2018-01-01-preview", "name": "[parameters('clustername')]", "location": "[parameters('location')]", "sku": {"name": "dedicated", "capacity": 1}}{"type": "microsoft.eventhub/namespaces", "apiversion": "2021-01-01-preview", "name": "[parameters('namespacename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.eventhub/clusters", parameters('clustername'))]"], "sku": {"name": "standard", "tier": "standard", "capacity": 1}, "properties": {"isautoinflateenabled": false, "maximumthroughputunits": 0, "clusterarmid": "[resourceid('microsoft.eventhub/clusters", parameters('clustername'))]"}}
This template creates an Event Hubs namespace, an Event Hub, and a consumer group.
{"apiversion": "2018-01-01-preview", "name": "[parameters('namespacename')]", "type": "microsoft.eventhub/namespaces", "location": "[parameters('location')]", "sku": {"name": "[parameters('eventhubsku')]", "tier": "[parameters('eventhubsku')]", "capacity": "[parameters('skucapacity')]"}, "tags": {"tag1": "value1", "tag2": "value2"}, "properties": {}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('eventhubname')]", "type": "eventhubs", "dependson": ["[resourceid('microsoft.eventhub/namespaces/", parameters('namespacename'))]"], "properties": {}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('consumergroupname')]", "type": "consumergroups", "dependson": ["[parameters('eventhubname')]"], "properties": {"usermetadata": "user metadata goes here"}}]}]}
Creates a EventHubs namespace, and an event hub.
{"type": "microsoft.eventhub/namespaces", "apiversion": "2018-01-01-preview", "name": "[variables('eventhubnamespacename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('eventhubsku')]", "tier": "[parameters('eventhubsku')]", "capacity": 1}, "properties": {"isautoinflateenabled": false, "maximumthroughputunits": 0}}{"type": "microsoft.eventhub/namespaces/eventhubs", "apiversion": "2017-04-01", "name": "[concat(variables('eventhubnamespacename'), "/", variables('eventhubname'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.eventhub/namespaces", variables('eventhubnamespacename'))]"], "properties": {"messageretentionindays": 7, "partitioncount": 1}}
Turn on the auto-inflate on your namespace to automatically scale-up your throughput units
{"apiversion": "2018-01-01-preview", "name": "[parameters('namespacename')]", "type": "microsoft.eventhub/namespaces", "location": "[parameters('location')]", "sku": {"name": "standard", "tier": "standard"}, "properties": {"isautoinflateenabled": "[parameters('isautoinflateenabled')]", "maximumthroughputunits": "[parameters('maximumthroughputunits')]"}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('eventhubname')]", "type": "eventhubs", "dependson": ["[resourceid('microsoft.eventhub/namespaces/", parameters('namespacename'))]"], "properties": {"messageretentionindays": "[parameters('messageretentionindays')]", "partitioncount": "[parameters('partitioncount')]"}}]}
Creates a Event Hub cluster, namesapce and eventhub in the cluster
{"type": "microsoft.eventhub/clusters", "apiversion": "2018-01-01-preview", "name": "[parameters('clustername')]", "location": "[parameters('location')]", "sku": {"name": "dedicated", "capacity": 1}}{"type": "microsoft.eventhub/namespaces", "apiversion": "2021-01-01-preview", "name": "[parameters('namespacename')]", "location": "[parameters('location')]", "sku": {"name": "standard", "tier": "standard", "capacity": 1}, "dependson": ["[resourceid('microsoft.eventhub/clusters", parameters('clustername'))]"], "properties": {"isautoinflateenabled": false, "maximumthroughputunits": 0, "clusterarmid": "[resourceid('microsoft.eventhub/clusters", parameters('clustername'))]"}}{"apiversion": "2021-01-01-preview", "type": "microsoft.eventhub/namespaces/eventhubs", "name": "[concat(parameters('namespacename'), "/", parameters('eventhubname'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.eventhub/namespaces", parameters('namespacename'))]"], "properties": {"messageretentionindays": 7, "partitioncount": 1}}
Creates a EventHubs namespace, an Event Hub with Capture enabled on it for Azure Storage as destination. Existing storage account resource id and container details are to be specified in the template.
{"apiversion": "2018-01-01-preview", "name": "[parameters('eventhubnamespacename')]", "type": "microsoft.eventhub/namespaces", "location": "[parameters('location')]", "sku": {"name": "[parameters('eventhubsku')]", "tier": "[parameters('eventhubsku')]", "capacity": "[parameters('skucapacity')]"}, "tags": {"tag1": "value1", "tag2": "value2"}, "properties": {"isautoinflateenabled": "[parameters('isautoinflateenabled')]", "maximumthroughputunits": "[parameters('maximumthroughputunits')]"}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('eventhubname')]", "type": "eventhubs", "dependson": ["[resourceid('microsoft.eventhub/namespaces/", parameters('eventhubnamespacename'))]"], "properties": {"messageretentionindays": "[parameters('messageretentionindays')]", "partitioncount": "[parameters('partitioncount')]", "capturedescription": {"enabled": "[parameters('captureenabled')]", "skipemptyarchives": false, "encoding": "[parameters('captureencodingformat')]", "intervalinseconds": "[parameters('capturetime')]", "sizelimitinbytes": "[parameters('capturesize')]", "destination": {"name": "eventhubarchive.azureblockblob", "properties": {"storageaccountresourceid": "[parameters('existingstorageacctresourceid')]", "blobcontainer": "[parameters('blobcontainername')]", "archivenameformat": "[parameters('capturenameformat')]"}}}}}]}
Creates a EventHubs namespace, an Event Hub with Capture enabled on it for Azure Data Lake Store as destination.
{"apiversion": "2017-04-01", "name": "[parameters('eventhubnamespacename')]", "type": "microsoft.eventhub/namespaces", "location": "[resourcegroup().location]", "sku": {"name": "standard", "tier": "standard"}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('eventhubname')]", "type": "eventhubs", "dependson": ["[concat('microsoft.eventhub/namespaces/", parameters('eventhubnamespacename'))]"], "properties": {"path": "[parameters('eventhubname')]", "capturedescription": {"enabled": true, "skipemptyarchives": false, "encoding": "[parameters('captureencodingformat')]", "intervalinseconds": "[parameters('capturetime')]", "sizelimitinbytes": "[parameters('capturesize')]", "destination": {"name": "eventhubarchive.azuredatalake", "properties": {"datalakesubscriptionid": "[parameters('subscriptionid')]", "datalakeaccountname": "[parameters('datalakeaccountname')]", "datalakefolderpath": "[parameters('datalakefolderpath')]", "archivenameformat": "[parameters('capturenameformat')]"}}}}}]}
This template creates a Event Hubs namespace and virtual network rule
{"apiversion": "2018-01-01-preview", "name": "[parameters('eventhubnamespacename')]", "type": "microsoft.eventhub/namespaces", "location": "[parameters('location')]", "sku": {"name": "standard", "tier": "standard"}, "properties": {}}{"apiversion": "2018-01-01-preview", "name": "[variables('namespacevirtualnetworkrulename')]", "type": "microsoft.eventhub/namespaces/virtualnetworkrules", "dependson": ["[resourceid('microsoft.eventhub/namespaces/", parameters('eventhubnamespacename'))]"], "properties": {"virtualnetworksubnetid": "[variables('subnetid')]"}}
This template creates a EventHubs namespace, an Event Hub, a consumer group and authorizationRules
{"apiversion": "2018-01-01-preview", "name": "[parameters('namespacename')]", "type": "microsoft.eventhub/namespaces", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"isautoinflateenabled": true, "maximumthroughputunits": 7}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('eventhubname')]", "type": "eventhubs", "dependson": ["[resourceid('microsoft.eventhub/namespaces/", parameters('namespacename'))]"], "properties": {"messageretentionindays": 4, "partitioncount": 4}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('consumergroupname')]", "type": "consumergroups", "dependson": ["[resourceid('microsoft.eventhub/namespaces/eventhubs/", parameters('namespacename'),parameters('eventhubname'))]"], "properties": {"usermetadata": "user metadata"}}, {"apiversion": "2017-04-01", "name": "[parameters('eventhubauthorizationrulename')]", "type": "authorizationrules", "dependson": ["[resourceid('microsoft.eventhub/namespaces/eventhubs/", parameters('namespacename'),parameters('eventhubname'))]"], "properties": {"rights": ["send", "listen", "manage"]}}, {"apiversion": "2017-04-01", "name": "[parameters('eventhubauthorizationrulename1')]", "type": "authorizationrules", "dependson": ["[resourceid('microsoft.eventhub/namespaces/eventhubs/", parameters('namespacename'),parameters('eventhubname'))]"], "properties": {"rights": ["send"]}}]}]}{"apiversion": "2017-04-01", "name": "[concat(parameters('namespacename'), "/", parameters('namespaceauthorizationrulename'))]", "type": "microsoft.eventhub/namespaces/authorizationrules", "dependson": ["[resourceid('microsoft.eventhub/namespaces/", parameters('namespacename'))]"], "properties": {"rights": ["send", "listen", "manage"]}}
Creates an Azure Storage account and a blob container that can be accessed using SFTP protocol. Access can be password or public-key based.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('storageaccounttype')]"}, "kind": "storagev2", "properties": {"ishnsenabled": true, "islocaluserenabled": true, "issftpenabled": true}}{"type": "microsoft.storage/storageaccounts/blobservices/containers", "apiversion": "2021-04-01", "name": "[format('{0}/default/{1}", parameters('storageaccountname'), parameters('homedirectory'))]", "properties": {"publicaccess": "none"}, "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"]}{"type": "microsoft.storage/storageaccounts/localusers", "apiversion": "2021-04-01", "name": "[format('{0}/{1}", parameters('storageaccountname'), parameters('username'))]", "properties": {"permissionscopes": [{"permissions": "rcwdl", "service": "blob", "resourcename": "[parameters('homedirectory')]"}], "homedirectory": "[parameters('homedirectory')]", "sshauthorizedkeys": "[if(empty(parameters('publickey')), null(), createarray(createobject('description", format('{0} public key", parameters('username')), "key", parameters('publickey'))))]", "hassharedkey": false}, "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"]}
This template creates an Azure storage account and multiple blob containers.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "kind": "storagev2", "sku": {"name": "standard_lrs"}, "properties": {"accesstier": "hot"}}{"copy": {"name": "containers", "count": "[length(range(0, 3))]"}, "type": "microsoft.storage/storageaccounts/blobservices/containers", "apiversion": "2021-04-01", "name": "[format('{0}/default/{1}{2}", parameters('storageaccountname'), parameters('containerprefix'), range(0, 3)[copyindex()])]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"]}
This template creates an Azure Storage account and a blob container. Template originally authored by John Downs. (bicep)
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-06-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storagev2", "properties": {"accesstier": "hot"}}{"type": "microsoft.storage/storageaccounts/blobservices/containers", "apiversion": "2021-06-01", "name": "[format('{0}/default/{1}", parameters('storageaccountname'), parameters('containername'))]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"]}
Create a Storage Account with Storage Service Encryption for Data at Rest
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('storageaccounttype')]"}, "kind": "storage", "properties": {"encryption": {"keysource": "microsoft.storage", "services": {"blob": {"enabled": "[parameters('blobencryptionenabled')]"}}}}}
Create a Standard Storage Account (bicep)
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-06-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('storageaccounttype')]"}, "kind": "storagev2", "properties": {}}
Deploys a static website with a backing storage account
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "kind": "storagev2", "sku": {"name": "[parameters('storagesku')]"}}
Deploy an Azure Storage account with Advanced Threat Protection enabled.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('storageaccountreplication')]"}, "kind": "storagev2", "properties": {}}
This template creates a vnet and a subnet hosting a Linux virtual machine that accesses a storage account using a system-assigned managed identity with a contributor role and a private endpoint.
{"apiversion": "2019-06-01", "type": "microsoft.storage/storageaccounts", "name": "[parameters('adlsstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_ragrs"}, "kind": "storagev2"}{"apiversion": "2019-06-01", "type": "microsoft.storage/storageaccounts", "name": "[parameters('blobstorageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storagev2"}
This template creates an Azure storage account and multiple file shares.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "kind": "storagev2", "sku": {"name": "standard_lrs"}, "properties": {"accesstier": "hot"}}{"copy": {"name": "fileshares", "count": "[length(range(0, parameters('sharecopy')))]"}, "type": "microsoft.storage/storageaccounts/fileservices/shares", "apiversion": "2021-04-01", "name": "[format('{0}/default/{1}{2}", parameters('storageaccountname'), parameters('shareprefix'), range(0, parameters('sharecopy'))[copyindex()])]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"]}
This template creates an Azure storage account with file share.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "kind": "storagev2", "sku": {"name": "standard_lrs"}, "properties": {"accesstier": "hot"}}{"type": "microsoft.storage/storageaccounts/fileservices/shares", "apiversion": "2021-04-01", "name": "[format('{0}/default/{1}", parameters('storageaccountname'), parameters('filesharename'))]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"]}
This template deploys a Storage Account with a customer-managed key for encryption that's generated and placed inside a Key Vault.
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "standard_lrs"}, "kind": "storagev2", "identity": {"type": "userassigned", "userassignedidentities": {"[format('{0}", resourceid('microsoft.managedidentity/userassignedidentities", parameters('userassignedidentityname')))]": {}}}, "properties": {"accesstier": "hot", "supportshttpstrafficonly": true, "minimumtlsversion": "tls1_2", "encryption": {"identity": {"userassignedidentity": "[resourceid('microsoft.managedidentity/userassignedidentities", parameters('userassignedidentityname'))]"}, "services": {"blob": {"enabled": true}}, "keysource": "microsoft.keyvault", "keyvaultproperties": {"keyname": "[parameters('keyvaultkeyname')]", "keyvaulturi": "[if(endswith(reference(resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))).vaulturi, "/'), substring(reference(resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))).vaulturi, 0, sub(length(reference(resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))).vaulturi), 1)), reference(resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))).vaulturi)]"}}}, "dependson": ["[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]", "[resourceid('microsoft.keyvault/vaults/keys", parameters('keyvaultname'), parameters('keyvaultkeyname'))]", "[resourceid('microsoft.managedidentity/userassignedidentities", parameters('userassignedidentityname'))]"]}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "apiversion": "2021-04-01", "name": "[parameters('storageaccountname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('storagesku')]"}, "kind": "[parameters('storagekind')]", "properties": {"accesstier": "[parameters('storagetier')]", "encryption": {"keysource": "microsoft.storage", "services": {"blob": {"enabled": "[parameters('blobencryptionenabled')]"}}}}}{"type": "microsoft.storage/storageaccounts/blobservices", "apiversion": "2021-04-01", "name": "[format('{0}/{1}", parameters('storageaccountname'), "default')]", "properties": {"deleteretentionpolicy": {"enabled": true, "days": "[parameters('deleteretentionpolicy')]"}}, "dependson": ["[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"]}
This sample will go into detail on how to extend existing Azure resources and Resource Manager templates to add in custom workloads.
{"type": "microsoft.customproviders/associations", "apiversion": "2018-09-01-preview", "name": "[parameters('associationname')]", "location": "global", "dependson": ["customproviderinfrastructuretemplate"], "properties": {"targetresourceid": "[if(empty(parameters('customresourceproviderid')), reference('customproviderinfrastructuretemplate').outputs.customproviderresourceid.value, parameters('customresourceproviderid'))]", "mycustominputproperty": "mycustominputvalue", "mycustominputobject": {"property1": "value1"}}}
This sample shows how to add custom resources to Resource Manager Templates using custom providers and logic apps.
{"type": "microsoft.customproviders/resourceproviders", "apiversion": "2018-09-01-preview", "name": "[parameters('customresourceprovidername')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.logic/workflows", parameters('logicappname'))]"], "properties": {"resourcetypes": [{"name": "customresources", "mode": "secure", "routingtype": "webhook,cache", "endpoint": "[listcallbackurl(resourceid('microsoft.logic/workflows/triggers", parameters('logicappname'), "customproviderwebhook'), "2019-05-01').value]"}]}}{"type": "microsoft.customproviders/resourceproviders/customresources", "apiversion": "2018-09-01-preview", "name": "[concat(parameters('customresourceprovidername'), "/", parameters('customresourcename'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.customproviders/resourceproviders", parameters('customresourceprovidername'))]"], "properties": {"mycustominputproperty": "mycustominputvalue", "mycustominputobject": {"property1": "value1"}}}
This template deploys a simple Setup for Azure Blockchain Service.
{"type": "microsoft.blockchain/blockchainmembers", "apiversion": "2018-06-01-preview", "name": "[parameters('bcmembername')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('skuname')]", "tier": "[parameters('skutier')]"}, "tags": {"consortium": "consortium"}, "properties": {"protocol": "quorum", "consensus": "default", "password": "[parameters('memberpassword')]", "validatornodessku": {"capacity": 1}, "consortium": "[parameters('consortiumname')]", "consortiummanagementaccountpassword": "[parameters('consortiummanagementaccountpassword')]", "firewallrules": [{"rulename": "allowall", "startipaddress": "0.0.0.0", "endipaddress": "255.255.255.255"}]}}
This sample creates and deploys a templateSpec.
{"type": "microsoft.resources/deployments", "apiversion": "2020-10-01", "name": "[format('{0}-{1}-deployment", parameters('templatespecname'), parameters('templatespecversion'))]", "properties": {"mode": "incremental", "parameters": {"location": {"value": "[parameters('location')]"}, "diskname": {"value": "disk-from-templatespec"}}, "templatelink": {"id": "[resourceid(parameters('templatespecsubscriptionid'), parameters('templatespecresourcegroupname'), "microsoft.resources/templatespecs/versions", parameters('templatespecname'), parameters('templatespecversion'))]"}}}
This template uses the deploymentScript resource to generate ssh keys and stores the private key in keyVault.
{"type": "microsoft.resources/deploymentscripts", "apiversion": "2020-10-01", "name": "[variables('scriptname')]", "location": "[parameters('location')]", "dependson": ["[variables('roledefinitionname')]"], "identity": {"type": "userassigned", "userassignedidentities": {"[resourceid('microsoft.managedidentity/userassignedidentities", variables('identityname'))]": {}}}, "kind": "azurecli", "properties": {"forceupdatetag": "[parameters('newguid')]", "azcliversion": "2.0.80", "timeout": "pt30m", "retentioninterval": "p1d", "cleanuppreference": "onsuccess", "arguments": "[parameters('passphrase')]", "primaryscripturi": "[uri(parameters('_artifactslocation'), concat('new-key.sh", parameters('_artifactslocationsastoken')))]"}}{"apiversion": "2019-09-01", "name": "storesshkeys", "type": "microsoft.resources/deployments", "resourcegroup": "[parameters('vaultresourcegroup')]", "subscriptionid": "[parameters('vaultsubscriptionid')]", "properties": {"mode": "incremental", "expressionevaluationoptions": {"scope": "inner"}, "parameters": {"keys": {"value": "[reference(variables('scriptname')).outputs.keyinfo]"}, "vaultname": {"value": "[parameters('vaultname')]"}, "secretname": {"value": "[parameters('secretname')]"}}, "template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymenttemplate.json#", "contentversion": "1.0.0.0", "parameters": {"keys": {"type": "secureobject"}, "vaultname": {"type": "string"}, "secretname": {"type": "string"}}, "resources": [{"name": "[concat(parameters('vaultname'), "/", parameters('secretname'))]", "type": "microsoft.keyvault/vaults/secrets", "apiversion": "2019-09-01", "properties": {"value": "[parameters('keys').privatekey]"}}]}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"type": "microsoft.resources/deployments", "apiversion": "2020-10-01", "name": "[concat('templatespec-", replace(last(split(parameters('templatespecfiles')[copyindex()], "/')), ".json", "'))]", "copy": {"name": "templatespecloop", "count": "[length(parameters('templatespecfiles'))]"}, "properties": {"mode": "incremental", "parameters": {"location": {"value": "[parameters('location')]"}}, "templatelink": {"relativepath": "[concat(parameters('templatespecfiles')[copyindex()], parameters('_artifactslocationsastoken'))]"}}}
Create a Power BI Embedded capacity
{"type": "microsoft.powerbidedicated/capacities", "apiversion": "2018-09-01-preview", "name": "[parameters('name')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('sku')]"}, "properties": {"administration": {"members": ["[parameters('admin')]"]}}}
This template provides a way to deploy an Azure database for MySQL with VNet integration.
{"type": "microsoft.dbformysql/servers/virtualnetworkrules", "apiversion": "2017-12-01", "name": "[format('{0}/{1}", parameters('servername'), parameters('virtualnetworkrulename'))]", "properties": {"virtualnetworksubnetid": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]", "ignoremissingvnetserviceendpoint": true}, "dependson": ["[resourceid('microsoft.dbformysql/servers", parameters('servername'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]"]}{"type": "microsoft.dbformysql/servers", "apiversion": "2017-12-01", "name": "[parameters('servername')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('skuname')]", "tier": "[parameters('skutier')]", "capacity": "[parameters('skucapacity')]", "size": "[format('{0}", parameters('skusizemb'))]", "family": "[parameters('skufamily')]"}, "properties": {"createmode": "default", "version": "[parameters('mysqlversion')]", "administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]", "storageprofile": {"storagemb": "[parameters('skusizemb')]", "backupretentiondays": "[parameters('backupretentiondays')]", "georedundantbackup": "[parameters('georedundantbackup')]"}}}{"copy": {"name": "firewallrules", "count": "[length(variables('firewallrules'))]", "mode": "serial", "batchsize": 1}, "type": "microsoft.dbformysql/servers/firewallrules", "apiversion": "2017-12-01", "name": "[format('{0}/{1}", parameters('servername'), variables('firewallrules')[copyindex()].name)]", "properties": {"startipaddress": "[variables('firewallrules')[copyindex()].startipaddress]", "endipaddress": "[variables('firewallrules')[copyindex()].endipaddress]"}, "dependson": ["[resourceid('microsoft.dbformysql/servers", parameters('servername'))]"]}
This template creates an account that provides public DNS record and allows to make REST API calls to Data Plane.
{"type": "microsoft.deviceupdate/accounts", "apiversion": "2020-03-01-preview", "name": "[parameters('accountname')]", "location": "[parameters('location')]"}
This template creates an account, and an instance and a hub to link the instance with.
{"type": "microsoft.deviceupdate/accounts", "apiversion": "2020-03-01-preview", "name": "[parameters('accountname')]", "location": "[parameters('location')]"}{"type": "microsoft.deviceupdate/accounts/instances", "apiversion": "2020-03-01-preview", "name": "[format('{0}/{1}", parameters('accountname'), parameters('instancename'))]", "location": "[parameters('location')]", "properties": {"iothubs": [{"resourceid": "[variables('iothubresourceid')]", "iothubconnectionstring": "[format('hostname={0};sharedaccesskeyname={1};sharedaccesskey={2}", reference(variables('iothubresourceid'), "2021-03-31').hostname, variables('iothubkeyname'), listkeys(variables('iothubresourceid'), "2021-03-31').value[variables('iothubkeyindex')].primarykey)]", "eventhubconnectionstring": "[format('endpoint={0};sharedaccesskeyname={1};sharedaccesskey={2};entitypath={3}", reference(variables('iothubresourceid'), "2021-03-31').eventhubendpoints.events.endpoint, variables('iothubkeyname'), listkeys(variables('iothubresourceid'), "2021-03-31').value[variables('iothubkeyindex')].primarykey, reference(variables('iothubresourceid'), "2021-03-31').eventhubendpoints.events.path)]"}]}, "dependson": ["[resourceid('microsoft.deviceupdate/accounts", parameters('accountname'))]", "[resourceid('microsoft.devices/iothubs", parameters('iothubname'))]"]}
Create a Batch Account using a template and a storage account associated with the batch account.
{"type": "microsoft.batch/batchaccounts", "apiversion": "2020-05-01", "name": "[parameters('batchaccountname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"], "tags": {"objectname": "[parameters('batchaccountname')]"}, "properties": {"autostorage": {"storageaccountid": "[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"}}}
Deploy a new Data Lake Analytics account on a new Data Lake Store account.
{"name": "[parameters('adlstorename')]", "type": "microsoft.datalakestore/accounts", "location": "[parameters('location')]", "apiversion": "2016-11-01", "properties": {}}
Deploy Azure Data Lake Store accounts with no data encryption.
{"type": "microsoft.datalakestore/accounts", "name": "[parameters('accountname')]", "location": "[parameters('location')]", "apiversion": "2016-11-01", "properties": {"newtier": "consumption", "encryptionstate": "disabled"}}
Deploy an Azure Data Lake Store account with data encryption using Data Lake for encryption key management.
{"type": "microsoft.datalakestore/accounts", "apiversion": "2016-11-01", "name": "[parameters('accountname')]", "location": "[parameters('location')]", "properties": {"newtier": "consumption", "encryptionstate": "enabled", "encryptionconfig": {"type": "servicemanaged"}}}
Deploy an Azure Data Lake Store account with data encryption using Azure Key Vault for encryption key management.
{"apiversion": "2016-11-01", "name": "[parameters('datalakestorename')]", "location": "[parameters('location')]", "type": "microsoft.datalakestore/accounts", "properties": {"encryptionstate": "enabled", "encryptionconfig": {"type": "usermanaged", "keyvaultmetainfo": {"keyvaultresourceid": "[resourceid(parameters('keyvaultresourcegroupname'), "microsoft.keyvault/vaults", parameters('keyvaultname'))]", "encryptionkeyname": "[parameters('keyname')]", "encryptionkeyversion": "[parameters('keyversion')]"}}}, "identity": {"type": "systemassigned"}}
Create a new SQL logical server with Azure AD-only authentication and an Azure AD Administrator.
{"type": "microsoft.sql/servers", "apiversion": "2020-11-01-preview", "name": "[parameters('server')]", "location": "[parameters('location')]", "properties": {"administrators": {"login": "[parameters('aad_admin_name')]", "sid": "[parameters('aad_admin_objectid')]", "tenantid": "[parameters('aad_admin_tenantid')]", "principaltype": "[parameters('aad_admin_type')]", "azureadonlyauthentication": "[parameters('aad_only_auth')]"}}}
This template allows you to deploy an Azure SQL server with Auditing enabled to write audit logs to Event Hub
{"type": "microsoft.sql/servers", "apiversion": "2019-06-01-preview", "location": "[parameters('location')]", "name": "[parameters('sqlservername')]", "properties": {"administratorlogin": "[parameters('sqladministratorlogin')]", "administratorloginpassword": "[parameters('sqladministratorloginpassword')]", "version": "12.0"}, "tags": {"displayname": "[parameters('sqlservername')]"}, "resources": [{"type": "databases", "apiversion": "2019-06-01-preview", "location": "[parameters('location')]", "dependson": ["[parameters('sqlservername')]"], "name": "master", "properties": {}}, {"type": "databases/providers/diagnosticsettings", "name": "[concat('master/microsoft.insights/",variables('diagnosticsettingsname'))]", "dependson": ["[parameters('sqlservername')]", "[resourceid('microsoft.eventhub/namespaces", parameters('eventhubnamespacename'))]", "[resourceid('microsoft.sql/servers/databases", parameters('sqlservername'), "master')]"], "apiversion": "2017-05-01-preview", "properties": {"name": "[variables('diagnosticsettingsname')]", "eventhubauthorizationruleid": "[resourceid('microsoft.eventhub/namespaces/authorizationrules", parameters('eventhubnamespacename'), parameters('eventhubauthorizationrulename'))]", "eventhubname": "[parameters('eventhubname')]", "logs": [{"category": "sqlsecurityauditevents", "enabled": true, "retentionpolicy": {"days": 0, "enabled": false}}, {"condition": "[parameters('ismsdevopsauditenabled')]", "category": "devopsoperationsaudit", "enabled": true, "retentionpolicy": {"days": 0, "enabled": false}}]}}, {"apiversion": "2017-03-01-preview", "type": "auditingsettings", "name": "defaultauditingsettings", "dependson": ["[parameters('sqlservername')]"], "properties": {"state": "enabled", "isazuremonitortargetenabled": true}}, {"condition": "[parameters('ismsdevopsauditenabled')]", "type": "devopsauditingsettings", "apiversion": "2020-08-01-preview", "name": "default", "dependson": ["[parameters('sqlservername')]"], "properties": {"state": "enabled", "isazuremonitortargetenabled": true}}]}
Deploy Azure Sql Managed Instance (SQL MI) and configure diagnostic settings for sending logs and metrics. Logs and metrics are sent to Azure storage account, Azure Event Hub, and Azure Monitor.
{"type": "microsoft.sql/managedinstances", "apiversion": "2020-02-02-preview", "name": "[parameters('managedinstancename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('skuname')]"}, "identity": {"type": "systemassigned"}, "dependson": ["[parameters('virtualnetworkname')]"], "properties": {"administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]", "subnetid": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]", "storagesizeingb": "[parameters('storagesizeingb')]", "vcores": "[parameters('vcores')]", "licensetype": "[parameters('licensetype')]"}}
Create a SQL logical server.
{"type": "microsoft.sql/servers", "apiversion": "2020-02-02-preview", "name": "[parameters('servername')]", "location": "[parameters('location')]", "identity": "[if(parameters(\"enableads\'), json(\"{"type":"systemassigned"}\'), json(\"null\'))]", "properties": {"administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]", "version": "12.0"}, "resources": [{"condition": "[parameters('allowazureips')]", "type": "firewallrules", "apiversion": "2020-02-02-preview", "name": "allowallwindowsazureips", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.sql/servers", parameters('servername'))]"], "properties": {"endipaddress": "0.0.0.0", "startipaddress": "0.0.0.0"}}, {"condition": "[parameters('enableads')]", "type": "securityalertpolicies", "apiversion": "2020-02-02-preview", "name": "default", "dependson": ["[resourceid('microsoft.sql/servers", parameters('servername'))]"], "properties": {"state": "enabled", "emailaccountadmins": true}}, {"condition": "[parameters('enableads')]", "type": "vulnerabilityassessments", "apiversion": "2020-02-02-preview", "name": "default", "dependson": ["[resourceid('microsoft.sql/servers", parameters('servername'))]", "[resourceid('microsoft.sql/servers/securityalertpolicies", parameters('servername'), "default')]", "[resourceid('microsoft.storage/storageaccounts", variables('storagename'))]"], "properties": {"storagecontainerpath": "[if(parameters('enableads'), concat(reference(resourceid('microsoft.storage/storageaccounts", variables('storagename'))).primaryendpoints.blob, "vulnerability-assessment'), json('null'))]", "recurringscans": {"isenabled": true, "emailsubscriptionadmins": true}}}, {"type": "connectionpolicies", "apiversion": "2014-04-01", "name": "default", "dependson": ["[resourceid('microsoft.sql/servers", parameters('servername'))]"], "properties": {"connectiontype": "[parameters('connectiontype')]"}}]}
Provision a SQL Server with firewall and a SQL database with Transparent Data Encryption.
{"name": "[variables('sqlservername')]", "type": "microsoft.sql/servers", "apiversion": "2020-02-02-preview", "location": "[parameters('location')]", "tags": {"displayname": "sqlserver"}, "properties": {"administratorlogin": "[parameters('sqladministratorlogin')]", "administratorloginpassword": "[parameters('sqladministratorloginpassword')]", "version": "12.0"}, "resources": [{"name": "[variables('databasename')]", "type": "databases", "apiversion": "2020-02-02-preview", "location": "[parameters('location')]", "tags": {"displayname": "database"}, "properties": {"edition": "[variables('databaseedition')]", "collation": "[variables('databasecollation')]", "requestedserviceobjectivename": "[variables('databaseserviceobjectivename')]"}, "dependson": ["[variables('sqlservername')]"], "resources": [{"comments": "transparent data encryption", "name": "current", "type": "transparentdataencryption", "apiversion": "2017-03-01-preview", "properties": {"status": "[parameters('transparentdataencryption')]"}, "dependson": ["[variables('databasename')]"]}]}, {"name": "allowallmicrosoftazureips", "type": "firewallrules", "apiversion": "2020-02-02-preview", "location": "[parameters('location')]", "properties": {"endipaddress": "0.0.0.0", "startipaddress": "0.0.0.0"}, "dependson": ["[variables('sqlservername')]"]}]}
Deploy an Azure SQL Server with Auditing enabled to write audit logs to Log Analytics
{"type": "microsoft.sql/servers", "apiversion": "2019-06-01-preview", "location": "[parameters('location')]", "name": "[parameters('sqlservername')]", "properties": {"administratorlogin": "[parameters('sqladministratorlogin')]", "administratorloginpassword": "[parameters('sqladministratorloginpassword')]", "version": "12.0"}, "tags": {"displayname": "[parameters('sqlservername')]"}, "resources": [{"type": "databases", "apiversion": "2017-03-01-preview", "location": "[parameters('location')]", "dependson": ["[parameters('sqlservername')]"], "name": "master", "properties": {}}, {"type": "databases/providers/diagnosticsettings", "name": "[concat('master/microsoft.insights/",variables('diagnosticsettingsname'))]", "dependson": ["[parameters('sqlservername')]", "[resourceid('microsoft.operationalinsights/workspaces", parameters('omsworkspacename'))]", "[resourceid('microsoft.sql/servers/databases", parameters('sqlservername'), "master')]"], "apiversion": "2017-05-01-preview", "properties": {"name": "[variables('diagnosticsettingsname')]", "workspaceid": "[resourceid('microsoft.operationalinsights/workspaces", parameters('omsworkspacename'))]", "logs": [{"category": "sqlsecurityauditevents", "enabled": true, "retentionpolicy": {"days": 0, "enabled": false}}, {"condition": "[parameters('ismsdevopsauditenabled')]", "category": "devopsoperationsaudit", "enabled": true, "retentionpolicy": {"days": 0, "enabled": false}}]}}, {"apiversion": "2017-03-01-preview", "type": "auditingsettings", "name": "defaultauditingsettings", "dependson": ["[resourceid('microsoft.sql/servers/", parameters('sqlservername'))]"], "properties": {"state": "enabled", "isazuremonitortargetenabled": true}}, {"condition": "[parameters('ismsdevopsauditenabled')]", "type": "devopsauditingsettings", "apiversion": "2020-08-01-preview", "name": "default", "dependson": ["[parameters('sqlservername')]"], "properties": {"state": "enabled", "isazuremonitortargetenabled": true}}]}
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"}
Deploy Azure Sql Database Managed Instance (SQL MI) and Virtual network gateway configured for point-to-site connection inside the new virtual network.
{"type": "microsoft.sql/managedinstances", "apiversion": "2019-06-01-preview", "dependson": ["[parameters('virtualnetworkname')]"], "identity": {"type": "systemassigned"}, "location": "[parameters('location')]", "name": "[parameters('managedinstancename')]", "sku": {"name": "[parameters('skuname')]"}, "properties": {"administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]", "subnetid": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]", "storagesizeingb": "[parameters('storagesizeingb')]", "vcores": "[parameters('vcores')]", "licensetype": "[parameters('licensetype')]"}}
Deploy an Azure SQL Server with Threat Detection enabled and a user-defined number of Azure SQL Databases with Threat Detection enabled, with an email address to receive alerts for each database.
{"type": "microsoft.sql/servers", "apiversion": "2020-02-02-preview", "location": "[variables('databaseserverlocation')]", "name": "[variables('databaseservername')]", "properties": {"administratorlogin": "[variables('databaseserveradminlogin')]", "administratorloginpassword": "[variables('databaseserveradminloginpassword')]", "version": "12.0"}, "tags": {"displayname": "[variables('databaseservername')]"}}{"apiversion": "2020-02-02-preview", "type": "microsoft.sql/servers/databases", "sku": {"name": "s0", "tier": "standard"}, "kind": "v12.0,user", "location": "[variables('databaseserverlocation')]", "name": "[concat(string(variables('databaseservername')), "/", string(variables('databasenames')[copyindex()]))]", "dependson": ["[resourceid('microsoft.sql/servers", variables('databaseservername'))]"], "tags": {"displayname": "[variables('databaseservername')]"}, "copy": {"name": "databasecopy", "count": "[length(variables('databasenames'))]"}, "properties": {}, "resources": [{"apiversion": "2020-02-02-preview", "type": "securityalertpolicies", "name": "default", "dependson": ["[resourceid('microsoft.sql/servers/databases", variables('databaseservername'), variables('databasenames')[copyindex()])]"], "properties": {"state": "enabled"}}]}
Create a SQL Server and Database
{"type": "microsoft.sql/servers", "apiversion": "2021-05-01-preview", "name": "[parameters('servername')]", "location": "[parameters('location')]", "properties": {"administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]"}}{"type": "microsoft.sql/servers/databases", "apiversion": "2021-05-01-preview", "name": "[format('{0}/{1}", parameters('servername'), parameters('sqldbname'))]", "location": "[parameters('location')]", "sku": {"name": "standard", "tier": "standard"}, "dependson": ["[resourceid('microsoft.sql/servers", parameters('servername'))]"]}
This template creates two Azure SQL servers, a database, and a failover group.
{"type": "microsoft.sql/servers", "kind": "v12.0", "name": "[parameters('sqlserverprimaryname')]", "apiversion": "2020-02-02-preview", "location": "[parameters('location')]", "properties": {"administratorlogin": "[parameters('sqlserverprimaryadminusername')]", "administratorloginpassword": "[parameters('sqlserverprimaryadminpassword')]", "version": "12.0"}, "resources": [{"apiversion": "2020-02-02-preview", "type": "failovergroups", "name": "[parameters('sqlfailovergroupname')]", "properties": {"servername": "[parameters('sqlserverprimaryname')]", "partnerservers": [{"id": "[resourceid('microsoft.sql/servers", parameters('sqlserversecondaryname'))]"}], "readwriteendpoint": {"failoverpolicy": "automatic", "failoverwithdatalossgraceperiodminutes": 60}, "readonlyendpoint": {"failoverpolicy": "disabled"}, "databases": ["[resourceid('microsoft.sql/servers/databases", parameters('sqlserverprimaryname'), variables('sqldatabasename'))]"]}, "dependson": ["[parameters('sqlserverprimaryname')]", "[resourceid('microsoft.sql/servers/databases", parameters('sqlserverprimaryname'), variables('sqldatabasename'))]", "[resourceid('microsoft.sql/servers", parameters('sqlserversecondaryname'))]"]}, {"name": "[variables('sqldatabasename')]", "type": "databases", "apiversion": "2020-02-02-preview", "location": "[parameters('location')]", "dependson": ["[parameters('sqlserverprimaryname')]"], "properties": {"edition": "[variables('sqldatabaseedition')]", "requestedserviceobjectivename": "[variables('sqldatabaseserviceobjective')]"}}]}{"type": "microsoft.sql/servers", "kind": "v12.0", "name": "[parameters('sqlserversecondaryname')]", "apiversion": "2020-02-02-preview", "location": "[parameters('sqlserversecondaryregion')]", "properties": {"administratorlogin": "[parameters('sqlserversecondaryadminusername')]", "administratorloginpassword": "[parameters('sqlserversecondaryadminpassword')]", "version": "12.0"}}
Deploy Azure Sql Database Managed Instance (SQL MI) and JumpBox with SSMS inside new Virtual Network
{"type": "microsoft.sql/managedinstances", "apiversion": "2019-06-01-preview", "dependson": ["[parameters('virtualnetworkname')]"], "identity": {"type": "systemassigned"}, "location": "[parameters('location')]", "name": "[parameters('managedinstancename')]", "sku": {"name": "[parameters('skuname')]"}, "properties": {"administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]", "subnetid": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]", "storagesizeingb": "[parameters('storagesizeingb')]", "vcores": "[parameters('vcores')]", "licensetype": "[parameters('licensetype')]"}}
This template creates a private endpoint, Private DNS Zone and a virtual machine to test the private connection to an Azure SQL Server
{"type": "microsoft.sql/servers", "apiversion": "2020-02-02-preview", "name": "[variables('sqlservername')]", "location": "[parameters('location')]", "kind": "v12.0", "tags": {"displayname": "[variables('sqlservername')]"}, "properties": {"administratorlogin": "[parameters('sqladministratorlogin')]", "administratorloginpassword": "[parameters('sqladministratorloginpassword')]", "version": "12.0", "publicnetworkaccess": "disabled"}, "resources": []}{"type": "microsoft.sql/servers/databases", "apiversion": "2020-02-02-preview", "name": "[variables('databasename')]", "location": "[parameters('location')]", "sku": {"name": "basic", "tier": "basic", "capacity": 5}, "dependson": ["[resourceid('microsoft.sql/servers", variables('sqlservername'))]"], "tags": {"displayname": "[variables('databasename')]"}, "properties": {"collation": "sql_latin1_general_cp1_ci_as", "edition": "basic", "maxsizebytes": 104857600, "requestedserviceobjectivename": "basic", "samplename": "adventureworkslt"}}
Deploy an Azure SQL Server with Auditing enabled to write audit logs to a blob storage
{"type": "microsoft.sql/servers", "apiversion": "2020-08-01-preview", "location": "[parameters('location')]", "name": "[parameters('sqlservername')]", "identity": "[if(parameters(\"isstoragebehindvnet\'), json(\"{"type":"systemassigned"}\'), json(\"null\'))]", "properties": {"administratorlogin": "[parameters('sqladministratorlogin')]", "administratorloginpassword": "[parameters('sqladministratorloginpassword')]", "version": "12.0"}, "tags": {"displayname": "[parameters('sqlservername')]"}, "resources": [{"type": "auditingsettings", "apiversion": "2019-06-01-preview", "name": "defaultauditingsettings", "dependson": ["[parameters('sqlservername')]", "[parameters('storageaccountname')]", "[extensionresourceid(resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname')), "microsoft.authorization/roleassignments/", variables('uniqueroleguid'))]"], "properties": {"state": "enabled", "storageendpoint": "[reference(resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname')), "2019-06-01').primaryendpoints.blob]", "storageaccountaccesskey": "[if(parameters('isstoragebehindvnet'), json('null'), listkeys(resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname')), "2019-06-01').keys[0].value)]", "storageaccountsubscriptionid": "[subscription().subscriptionid]", "isstoragesecondarykeyinuse": false}}, {"condition": "[parameters('ismsdevopsauditenabled')]", "type": "devopsauditingsettings", "apiversion": "2020-08-01-preview", "name": "default", "dependson": ["[parameters('sqlservername')]", "[parameters('storageaccountname')]", "[variables('uniqueroleguid')]"], "properties": {"state": "enabled", "storageendpoint": "[reference(resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname')), "2019-06-01').primaryendpoints.blob]", "storageaccountaccesskey": "[if(parameters('isstoragebehindvnet'), json('null'), listkeys(resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname')), "2019-06-01').keys[0].value)]", "storageaccountsubscriptionid": "[subscription().subscriptionid]", "isstoragesecondarykeyinuse": false}}]}
This template creates a managed application that has a customized default view.
{"type": "microsoft.solutions/applicationdefinitions", "apiversion": "2019-07-01", "name": "[variables('managedapplicationdefinitionname')]", "location": "[parameters('location')]", "properties": {"locklevel": "[variables('locklevel')]", "description": "[variables('description')]", "displayname": "[variables('displayname')]", "packagefileuri": "[variables('packagefileuri')]"}}{"type": "microsoft.solutions/applications", "apiversion": "2019-07-01", "name": "[parameters('applicationname')]", "location": "[parameters('location')]", "kind": "servicecatalog", "dependson": ["[resourceid('microsoft.solutions/applicationdefinitions/",variables('managedapplicationdefinitionname'))]"], "properties": {"managedresourcegroupid": "[variables('managedresourcegroupid')]", "applicationdefinitionid": "[variables('applicationdefinitionresourceid')]", "parameters": {"location": {"value": "[parameters('location')]"}, "storageaccountname": {"value": "[parameters('storageaccountname')]"}, "storageaccounttype": {"value": "[parameters('storageaccounttype')]"}}}}
This template creates a managed application that deploys linked templates.
{"type": "microsoft.solutions/applicationdefinitions", "apiversion": "2019-07-01", "name": "[variables('managedapplicationdefinitionname')]", "location": "[parameters('location')]", "properties": {"locklevel": "[variables('locklevel')]", "description": "[variables('description')]", "displayname": "[variables('displayname')]", "packagefileuri": "[variables('packagefileuri')]"}}{"type": "microsoft.solutions/applications", "apiversion": "2019-07-01", "name": "[parameters('applicationname')]", "location": "[parameters('location')]", "kind": "servicecatalog", "dependson": ["[resourceid('microsoft.solutions/applicationdefinitions/",variables('managedapplicationdefinitionname'))]"], "properties": {"managedresourcegroupid": "[variables('managedresourcegroupid')]", "applicationdefinitionid": "[variables('applicationdefinitionresourceid')]", "parameters": {"location": {"value": "[parameters('location')]"}, "storageaccountname": {"value": "[parameters('storageaccountname')]"}, "storageaccounttype": {"value": "[parameters('storageaccounttype')]"}}}}
This template creates a managed application that has application metrics and alerts.
{"type": "microsoft.solutions/applicationdefinitions", "apiversion": "2019-07-01", "name": "[variables('applicationdefinitionname')]", "location": "[parameters('location')]", "properties": {"locklevel": "[variables('locklevel')]", "description": "[variables('description')]", "displayname": "[variables('displayname')]", "packagefileuri": "[variables('packagefileuri')]"}}{"type": "microsoft.solutions/applications", "apiversion": "2019-07-01", "name": "[parameters('applicationname')]", "location": "[parameters('location')]", "kind": "servicecatalog", "dependson": ["[variables('applicationdefinitionresourceid')]"], "properties": {"managedresourcegroupid": "[variables('managedresourcegroupid')]", "applicationdefinitionid": "[variables('applicationdefinitionresourceid')]", "parameters": {"location": {"value": "[parameters('location')]"}, "storageaccountname": {"value": "[parameters('storageaccountname')]"}, "storageaccounttype": {"value": "[parameters('storageaccounttype')]"}}}}
This template creates an App Service Plan, a Web App, a scheduler job collection and a job.
{"apiversion": "2016-03-01", "type": "microsoft.scheduler/jobcollections", "name": "[parameters('jobcollectionname')]", "location": "[parameters('location')]", "properties": {"sku": "[parameters('sku')]"}, "resources": [{"apiversion": "2016-03-01", "type": "jobs", "name": "[parameters('jobname')]", "dependson": ["[resourceid('microsoft.scheduler/jobcollections/", parameters('jobcollectionname'))]"], "properties": {"state": "enabled", "action": {"type": "http", "request": {"uri": "[concat('http://", reference(resourceid('microsoft.web/sites", parameters('webappname'))).hostnames[0])]", "method": "get", "retrypolicy": {"retrytype": "none"}}}, "recurrence": {"interval": 1, "frequency": "week", "schedule": {"weekdays": ["monday", "tuesday", "wednesday", "thursday", "friday"], "hours": [10, 12], "minutes": [0, 30]}}}}]}
Create an Application Gateway with Public IP
{"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"apiversion": "2020-05-01", "name": "[variables('applicationgatewayname')]", "type": "microsoft.network/applicationgateways", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]"], "properties": {"sku": {"name": "[parameters('skuname')]", "tier": "standard", "capacity": "[parameters('capacity')]"}, "gatewayipconfigurations": [{"name": "appgatewayipconfig", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('virtualnetworkname'), variables('subnetname'))]"}}}], "frontendipconfigurations": [{"name": "appgatewayfrontendip", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname'))]"}}}], "frontendports": [{"name": "appgatewayfrontendport", "properties": {"port": 80}}], "backendaddresspools": [{"name": "appgatewaybackendpool", "properties": {"backendaddresses": [{"ipaddress": "[parameters('backendipaddress1')]"}, {"ipaddress": "[parameters('backendipaddress2')]"}]}}], "backendhttpsettingscollection": [{"name": "appgatewaybackendhttpsettings", "properties": {"port": 80, "protocol": "http", "cookiebasedaffinity": "disabled"}}], "httplisteners": [{"name": "appgatewayhttplistener", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations", variables('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports",variables('applicationgatewayname'), "appgatewayfrontendport')]"}, "protocol": "http"}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners",variables('applicationgatewayname'), "appgatewayhttplistener')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",variables('applicationgatewayname'), "appgatewaybackendpool')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}]}}
Create Testing environment for Firewall Premium (IDPS,TLS Inspection,Web Categories)
{"type": "microsoft.network/routetables", "apiversion": "2020-05-01", "name": "workerroute", "location": "[parameters('location')]", "properties": {"routes": [{"name": "workerroutefirewall", "properties": {"addressprefix": "0.0.0.0/0", "nexthoptype": "virtualappliance", "nexthopipaddress": "[variables('firewallprivateipaddress')]"}}], "disablebgproutepropagation": false}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-07-01", "name": "demovnet", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/routetables", "workerroute')]"], "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressspace')]"]}, "subnets": [{"name": "workersubnet", "properties": {"addressprefix": "[variables('workeraddressspace')]", "routetable": {"id": "[resourceid('microsoft.network/routetables", "workerroute')]"}}}, {"name": "azurebastionsubnet", "properties": {"addressprefix": "[variables('bastionaddressspace')]"}}, {"name": "azurefirewallsubnet", "properties": {"addressprefix": "[variables('firewalladdressspace')]"}}]}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-07-01", "name": "workernic", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", "demovnet')]"], "properties": {"ipconfigurations": [{"name": "workeripconfiguration", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", "demovnet", "workersubnet')]"}, "privateipallocationmethod": "static", "privateipaddress": "[variables('workerprivateipaddress')]"}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-07-01", "name": "bastionpublicip", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipallocationmethod": "static"}}{"type": "microsoft.network/bastionhosts", "apiversion": "2020-07-01", "name": "demobastion", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", "demovnet')]", "[resourceid('microsoft.network/publicipaddresses", "bastionpublicip')]"], "properties": {"ipconfigurations": [{"name": "bastionipconfiguration", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", "demovnet", "azurebastionsubnet')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", "bastionpublicip')]"}}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-07-01", "name": "firewallpublicip", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipallocationmethod": "static"}}{"type": "microsoft.network/firewallpolicies", "apiversion": "2020-07-01", "name": "demofirewallpolicy", "location": "[parameters('location')]", "identity": {"type": "userassigned", "userassignedidentities": {"[resourceid('microsoft.managedidentity/userassignedidentities", "demoidentity')]": {}}}, "dependson": ["[resourceid('microsoft.keyvault/vaults/secrets", variables('keyvaultname'), variables('keyvaultcasecretname'))]", "[resourceid('microsoft.managedidentity/userassignedidentities", "demoidentity')]"], "properties": {"sku": {"tier": "premium"}, "transportsecurity": {"certificateauthority": {"name": "[variables('keyvaultcasecretname')]", "keyvaultsecretid": "[concat(reference(resourceid('microsoft.keyvault/vaults", variables('keyvaultname')), "2019-09-01').vaulturi, "secrets/", variables('keyvaultcasecretname'), "/')]"}}, "intrusiondetection": {"mode": "alert", "configuration": {"signatureoverrides": [{"id": "[parameters('sigoverrideparam1')]", "mode": "deny"}, {"id": "[parameters('sigoverrideparam2')]", "mode": "alert"}], "bypasstrafficsettings": [{"name": "secretbypass", "protocol": "tcp", "sourceaddresses": ["*"], "destinationaddresses": ["1.1.1.1"], "destinationports": ["80"]}]}}}}{"type": "microsoft.network/firewallpolicies/rulecollectiongroups", "apiversion": "2020-07-01", "name": "demofirewallpolicy/policyrules", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/firewallpolicies", "demofirewallpolicy')]"], "properties": {"priority": 200, "rulecollections": [{"name": "allowweb", "priority": 101, "rulecollectiontype": "firewallpolicyfilterrulecollection", "action": {"type": "allow"}, "rules": [{"ruletype": "applicationrule", "name": "allowazure", "protocols": [{"protocoltype": "https", "port": 443}], "targetfqdns": ["*azure.com", "*microsoft.com"], "sourceaddresses": ["*"], "terminatetls": true}, {"ruletype": "applicationrule", "name": "allownews", "protocols": [{"protocoltype": "https", "port": 443}], "webcategories": ["business", "webbasedemail"], "sourceaddresses": ["*"], "terminatetls": true}]}, {"name": "blockpage", "priority": 100, "rulecollectiontype": "firewallpolicyfilterrulecollection", "action": {"type": "deny"}, "rules": [{"ruletype": "applicationrule", "name": "blockazureevents", "protocols": [{"protocoltype": "https", "port": 443}], "targeturls": ["azure.microsoft.com/en-us/community/events", "azure.microsoft.com/en-us/community/events/*"], "sourceaddresses": ["*"], "terminatetls": true}]}]}}{"type": "microsoft.network/azurefirewalls", "apiversion": "2020-07-01", "name": "demofirewall", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", "demovnet')]", "[resourceid('microsoft.network/publicipaddresses", "firewallpublicip')]", "[resourceid('microsoft.network/firewallpolicies", "demofirewallpolicy')]", "[resourceid('microsoft.network/firewallpolicies/rulecollectiongroups", "demofirewallpolicy", "policyrules')]"], "properties": {"ipconfigurations": [{"name": "firewallipconfiguration", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", "demovnet", "azurefirewallsubnet')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", "firewallpublicip')]"}}}], "firewallpolicy": {"id": "[resourceid('microsoft.network/firewallpolicies", "demofirewallpolicy')]"}, "sku": {"name": "azfw_vnet", "tier": "premium"}}}
Load Balancer with Inbound NAT Rule
{"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[parameters('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforlbip')]"}}}{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/networkinterfaces", "name": "[variables('nicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/loadbalancers/", variables('loadbalancername'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('subnetref')]"}, "loadbalancerbackendaddresspools": [{"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('loadbalancername'), "loadbalancerbackend')]"}], "loadbalancerinboundnatrules": [{"id": "[resourceid('microsoft.network/loadbalancers/inboundnatrules", variables('loadbalancername'), "rdp')]"}]}}]}}{"apiversion": "2020-05-01", "name": "[variables('loadbalancername')]", "type": "microsoft.network/loadbalancers", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]"], "properties": {"frontendipconfigurations": [{"name": "loadbalancerfrontend", "properties": {"publicipaddress": {"id": "[variables('publicipaddressid')]"}}}], "backendaddresspools": [{"name": "loadbalancerbackend"}], "inboundnatrules": [{"name": "rdp", "properties": {"frontendipconfiguration": {"id": "[variables('frontendipconfigid')]"}, "protocol": "tcp", "frontendport": 3389, "backendport": 3389, "enablefloatingip": false}}]}}
Route table with routes
{"type": "microsoft.network/routetables", "apiversion": "2021-02-01", "name": "[parameters('routetablename')]", "location": "[parameters('location')]", "properties": {"copy": [{"name": "routes", "count": "[length(parameters('routes'))]", "input": {"name": "[parameters('routes')[copyindex('routes')].name]", "properties": {"addressprefix": "[parameters('routes')[copyindex('routes')].addressprefix]", "hasbgpoverride": "[if(contains(parameters('routes')[copyindex('routes')], "hasbgpoverride'), parameters('routes')[copyindex('routes')].hasbgpoverride, null())]", "nexthopipaddress": "[if(contains(parameters('routes')[copyindex('routes')], "nexthopipaddress'), parameters('routes')[copyindex('routes')].nexthopipaddress, null())]", "nexthoptype": "[parameters('routes')[copyindex('routes')].nexthoptype]"}}}], "disablebgproutepropagation": "[parameters('disablebgproutepropagation')]"}}
Create an Application Gateway
{"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"apiversion": "2020-05-01", "name": "[parameters('applicationgatewayname')]", "type": "microsoft.network/applicationgateways", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", parameters('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]"], "properties": {"sku": {"name": "[parameters('skuname')]", "tier": "standard", "capacity": "[parameters('capacity')]"}, "sslcertificates": [{"name": "appgatewaysslcert", "properties": {"data": "[parameters('certdata')]", "password": "[parameters('certpassword')]"}}], "gatewayipconfigurations": [{"name": "appgatewayipconfig", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]"}}}], "frontendipconfigurations": [{"name": "appgatewayfrontendip", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"}}}], "frontendports": [{"name": "appgatewayfrontendhttpport1", "properties": {"port": 80}}, {"name": "appgatewayfrontendhttpsport1", "properties": {"port": 443}}, {"name": "appgatewayfrontendhttpport2", "properties": {"port": 8080}}], "backendaddresspools": [{"name": "appgatewaybackendpool1", "properties": {"backendaddresses": [{"ipaddress": "[parameters('backendipaddress1')]"}]}}, {"name": "appgatewaybackendpool2", "properties": {"backendaddresses": [{"ipaddress": "[parameters('backendipaddress2')]"}]}}], "backendhttpsettingscollection": [{"name": "appgatewaybackendhttpsettings", "properties": {"port": 80, "protocol": "http"}}], "httplisteners": [{"name": "appgatewayhttplistener1", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations", parameters('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports", parameters('applicationgatewayname'), "appgatewayfrontendhttpport1')]"}, "protocol": "http"}}, {"name": "appgatewayhttpslistener1", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations",parameters('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports",parameters('applicationgatewayname'), "appgatewayfrontendhttpsport1')]"}, "protocol": "https", "sslcertificate": {"id": "[resourceid('microsoft.network/applicationgateways/sslcertificates",parameters('applicationgatewayname'), "appgatewaysslcert')]"}}}, {"name": "appgatewayhttplistener2", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations",parameters('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports",parameters('applicationgatewayname'), "appgatewayfrontendhttpport2')]"}, "protocol": "http"}}], "redirectconfigurations": [{"name": "redirectconfig1", "properties": {"redirecttype": "temporary", "targetlistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners",parameters('applicationgatewayname'), "appgatewayhttpslistener1')]"}}}, {"name": "redirectconfig2", "properties": {"redirecttype": "temporary", "targeturl": "http://www.bing.com"}}], "urlpathmaps": [{"name": "urlpathmap1", "properties": {"defaultredirectconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/redirectconfigurations",parameters('applicationgatewayname'), "redirectconfig2')]"}, "pathrules": [{"name": "pathrule1", "properties": {"paths": ["[parameters('pathmatch1')]"], "redirectconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/redirectconfigurations",parameters('applicationgatewayname'), "redirectconfig1')]"}}}]}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners",parameters('applicationgatewayname'), "appgatewayhttplistener1')]"}, "redirectconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/redirectconfigurations",parameters('applicationgatewayname'), "redirectconfig1')]"}}}, {"name": "rule2", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners/", parameters('applicationgatewayname'), "appgatewayhttpslistener1')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools/", parameters('applicationgatewayname'), "appgatewaybackendpool1')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection/", parameters('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}, {"name": "rule3", "properties": {"ruletype": "pathbasedrouting", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners/",parameters('applicationgatewayname'), "appgatewayhttplistener2')]"}, "urlpathmap": {"id": "[resourceid('microsoft.network/applicationgateways/urlpathmaps/",parameters('applicationgatewayname'), "urlpathmap1')]"}}}]}}
Create an ExpressRoute Circuit
{"type": "microsoft.network/expressroutecircuits", "apiversion": "2021-02-01", "name": "[parameters('circuitname')]", "location": "[parameters('location')]", "sku": {"name": "[format('{0}_{1}", parameters('skutier'), parameters('skufamily'))]", "tier": "[parameters('skutier')]", "family": "[parameters('skufamily')]"}, "properties": {"serviceproviderproperties": {"serviceprovidername": "[parameters('serviceprovidername')]", "peeringlocation": "[parameters('peeringlocation')]", "bandwidthinmbps": "[parameters('bandwidthinmbps')]"}}}
Create a Site to Site VPN connection to any on premises or other cloud networks such as AWS Virtual Private Cloud
{"apiversion": "2020-08-01", "type": "microsoft.network/localnetworkgateways", "name": "[parameters('localgatewayname')]", "location": "[parameters('location')]", "properties": {"localnetworkaddressspace": {"addressprefixes": "[parameters('localaddressprefix')]"}, "gatewayipaddress": "[parameters('localgatewayipaddress')]"}}{"apiversion": "2020-07-01", "name": "[parameters('connectionname')]", "type": "microsoft.network/connections", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworkgateways/", parameters('gatewayname'))]", "[resourceid('microsoft.network/localnetworkgateways/", parameters('localgatewayname'))]"], "properties": {"virtualnetworkgateway1": {"id": "[resourceid('microsoft.network/virtualnetworkgateways", parameters('gatewayname'))]"}, "localnetworkgateway2": {"id": "[resourceid('microsoft.network/localnetworkgateways", parameters('localgatewayname'))]"}, "connectiontype": "ipsec", "routingweight": 10, "sharedkey": "[parameters('sharedkey')]"}}{"apiversion": "2015-06-15", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('azurevnetaddressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}, {"name": "gatewaysubnet", "properties": {"addressprefix": "[parameters('gatewaysubnetprefix')]"}}]}}{"apiversion": "2015-06-15", "type": "microsoft.network/publicipaddresses", "name": "[parameters('gatewaypublicipname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2015-06-15", "type": "microsoft.network/virtualnetworkgateways", "name": "[parameters('gatewayname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", parameters('gatewaypublicipname'))]", "[resourceid('microsoft.network/virtualnetworks/", parameters('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('gatewaysubnetref')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",parameters('gatewaypublicipname'))]"}}, "name": "vnetgatewayconfig"}], "sku": {"name": "[parameters('gatewaysku')]", "tier": "[parameters('gatewaysku')]"}, "gatewaytype": "vpn", "vpntype": "[parameters('vpntype')]", "enablebgp": "false"}}
Create a Virtual Network with two Subnets
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[parameters('vnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "subnets": [{"name": "[parameters('subnet1name')]", "properties": {"addressprefix": "[parameters('subnet1prefix')]"}}, {"name": "[parameters('subnet2name')]", "properties": {"addressprefix": "[parameters('subnet2prefix')]"}}]}}
Virtual Network with diagnostic logs
{"type": "microsoft.network/virtualnetworks", "apiversion": "2021-02-01", "name": "[parameters('vnetname')]", "location": "[parameters('location')]", "properties": {"copy": [{"name": "subnets", "count": "[length(parameters('subnets'))]", "input": {"name": "[parameters('subnets')[copyindex('subnets')].name]", "properties": {"addressprefix": "[parameters('subnets')[copyindex('subnets')].addressprefix]", "delegations": "[if(contains(parameters('subnets')[copyindex('subnets')], "delegation'), createarray(createobject('name", format('{0}-delegation", parameters('subnets')[copyindex('subnets')].name), "properties", createobject('servicename", parameters('subnets')[copyindex('subnets')].delegation))), createarray())]", "natgateway": "[if(contains(parameters('subnets')[copyindex('subnets')], "natgatewayid'), createobject('id", parameters('subnets')[copyindex('subnets')].natgatewayid), null())]", "networksecuritygroup": "[if(contains(parameters('subnets')[copyindex('subnets')], "nsgid'), createobject('id", parameters('subnets')[copyindex('subnets')].nsgid), null())]", "routetable": "[if(contains(parameters('subnets')[copyindex('subnets')], "udrid'), createobject('id", parameters('subnets')[copyindex('subnets')].udrid), null())]", "privateendpointnetworkpolicies": "[parameters('subnets')[copyindex('subnets')].privateendpointnetworkpolicies]", "privatelinkservicenetworkpolicies": "[parameters('subnets')[copyindex('subnets')].privatelinkservicenetworkpolicies]", "serviceendpoints": "[if(contains(parameters('subnets')[copyindex('subnets')], "serviceendpoints'), parameters('subnets')[copyindex('subnets')].serviceendpoints, null())]"}}}], "addressspace": {"addressprefixes": "[parameters('vnetaddressspace')]"}, "dhcpoptions": "[if(empty(parameters('dnsservers')), null(), createobject('dnsservers", parameters('dnsservers')))]"}}
Create an Application Gateway
{"apiversion": "2020-07-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2017-06-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"apiversion": "2017-06-01", "name": "[variables('applicationgatewayname')]", "type": "microsoft.network/applicationgateways", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]"], "properties": {"sku": {"name": "[parameters('applicationgatewaysize')]", "tier": "standard", "capacity": "[parameters('capacity')]"}, "gatewayipconfigurations": [{"name": "appgatewayipconfig", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('virtualnetworkname'), variables('subnetname'))]"}}}], "frontendipconfigurations": [{"name": "appgatewayfrontendip", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname'))]"}}}], "frontendports": [{"name": "appgatewayfrontendport", "properties": {"port": 80}}], "backendaddresspools": [{"name": "appgatewaybackendpool", "properties": {"backendaddresses": [{"ipaddress": "[parameters('azurewebapp1')]"}, {"ipaddress": "[parameters('azurewebapp2')]"}]}}], "backendhttpsettingscollection": [{"name": "appgatewaybackendhttpsettings", "properties": {"port": 80, "protocol": "http", "cookiebasedaffinity": "disabled", "pickhostnamefrombackendaddress": true, "probeenabled": "[parameters('probeenabled')]", "probe": {"id": "[resourceid('microsoft.network/applicationgateways/probes",variables('applicationgatewayname'), "probe1')]"}}}], "httplisteners": [{"name": "appgatewayhttplistener", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations",variables('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports",variables('applicationgatewayname'), "appgatewayfrontendport')]"}, "protocol": "http"}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners",variables('applicationgatewayname'), "appgatewayhttplistener')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",variables('applicationgatewayname'), "appgatewaybackendpool')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}], "probes": [{"name": "probe1", "properties": {"protocol": "http", "path": "/", "interval": 30, "timeout": 10, "unhealthythreshold": 3, "minservers": 0, "pickhostnamefrombackendhttpsettings": true}}]}}
This template creates a private link service that exposes a virtual machine, and it is consumed via a private endpoint.
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('vnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressprefix')]"]}, "subnets": [{"name": "[variables('frontendsubnetname')]", "properties": {"addressprefix": "[variables('frontendsubnetprefix')]", "privatelinkservicenetworkpolicies": "disabled"}}, {"name": "[variables('backendsubnetname')]", "properties": {"addressprefix": "[variables('backendsubnetprefix')]"}}]}}{"type": "microsoft.network/loadbalancers", "apiversion": "2020-06-01", "name": "[variables('loadbalancername')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "dependson": ["[variables('vnetname')]"], "properties": {"frontendipconfigurations": [{"name": "[variables('loadbalancerfrontendipconfigurationname')]", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('frontendsubnetname'))]"}}}], "backendaddresspools": [{"name": "[variables('backendpoolname')]"}], "inboundnatrules": [{"name": "rdp-vm0", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('loadbalancername'), variables('loadbalancerfrontendipconfigurationname'))]"}, "protocol": "tcp", "frontendport": 3389, "backendport": 3389, "enablefloatingip": false}}], "loadbalancingrules": [{"name": "myhttprule", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('loadbalancername'), variables('loadbalancerfrontendipconfigurationname'))]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('loadbalancername'), variables('backendpoolname'))]"}, "probe": {"id": "[resourceid('microsoft.network/loadbalancers/probes", variables('loadbalancername'), variables('healthprobename'))]"}, "protocol": "tcp", "frontendport": 80, "backendport": 80, "idletimeoutinminutes": 15}}], "probes": [{"properties": {"protocol": "tcp", "port": 80, "intervalinseconds": 15, "numberofprobes": 2}, "name": "[variables('healthprobename')]"}]}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[variables('networkinterfacename')]", "location": "[parameters('location')]", "dependson": ["[variables('loadbalancername')]"], "tags": {"displayname": "[variables('networkinterfacename')]"}, "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('backendsubnetname'))]"}, "loadbalancerbackendaddresspools": [{"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('loadbalancername'), variables('backendpoolname'))]"}], "loadbalancerinboundnatrules": [{"id": "[resourceid('microsoft.network/loadbalancers/inboundnatrules/", variables('loadbalancername'), "rdp-vm0')]"}]}}]}}{"type": "microsoft.network/privatelinkservices", "apiversion": "2020-06-01", "name": "[variables('privatelinkservicename')]", "location": "[parameters('location')]", "properties": {"enableproxyprotocol": false, "loadbalancerfrontendipconfigurations": [{"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('loadbalancername'), variables('loadbalancerfrontendipconfigurationname'))]"}], "ipconfigurations": [{"name": "snet-provider-default-1", "properties": {"privateipallocationmethod": "dynamic", "privateipaddressversion": "ipv4", "subnet": {"id": "[reference(variables('loadbalancerid'), "2019-06-01').frontendipconfigurations[0].properties.subnet.id]"}, "primary": false}}]}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('vnetconsumername')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressprefix')]"]}, "subnets": [{"name": "[variables('consumersubnetname')]", "properties": {"addressprefix": "[variables('consumersubnetprefix')]", "privateendpointnetworkpolicies": "disabled"}}, {"name": "[variables('backendsubnetname')]", "properties": {"addressprefix": "[variables('backendsubnetprefix')]"}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('publicipaddressconsumername')]", "location": "[parameters('location')]", "tags": {"displayname": "[variables('publicipaddressconsumername')]"}, "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[tolower(variables('vmconsumername'))]"}}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[variables('networkinterfaceconsumername')]", "location": "[parameters('location')]", "dependson": ["[variables('vnetconsumername')]", "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressconsumername'))]"], "tags": {"displayname": "[variables('networkinterfaceconsumername')]"}, "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressconsumername'))]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetconsumername'), variables('consumersubnetname'))]"}}}]}}{"type": "microsoft.network/privateendpoints", "apiversion": "2020-06-01", "name": "[variables('privateendpointname')]", "location": "[parameters('location')]", "dependson": ["[variables('vnetconsumername')]", "[variables('privatelinkservicename')]"], "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetconsumername'), variables('consumersubnetname'))]"}, "privatelinkserviceconnections": [{"name": "[variables('privateendpointname')]", "properties": {"privatelinkserviceid": "[resourceid('microsoft.network/privatelinkservices",variables('privatelinkservicename'))]"}}]}}
This template adds and secures a custom domain to your Front Door with a customer-managed certificate.
{"type": "microsoft.network/frontdoors", "apiversion": "2020-01-01", "name": "[parameters('frontdoorname')]", "location": "global", "properties": {"enabledstate": "enabled", "frontendendpoints": [{"name": "[variables('frontendendpointdefaultname')]", "properties": {"hostname": "[variables('frontendendpointdefaulthostname')]", "sessionaffinityenabledstate": "disabled"}}, {"name": "[variables('frontendendpointcustomname')]", "properties": {"hostname": "[parameters('customdomainname')]", "sessionaffinityenabledstate": "disabled"}}], "loadbalancingsettings": [{"name": "[variables('loadbalancingsettingsname')]", "properties": {"samplesize": 4, "successfulsamplesrequired": 2}}], "healthprobesettings": [{"name": "[variables('healthprobesettingsname')]", "properties": {"path": "/", "protocol": "http", "intervalinseconds": 120}}], "backendpools": [{"name": "[variables('backendpoolname')]", "properties": {"backends": [{"address": "[parameters('backendaddress')]", "backendhostheader": "[parameters('backendaddress')]", "httpport": 80, "httpsport": 443, "weight": 50, "priority": 1, "enabledstate": "enabled"}], "loadbalancingsettings": {"id": "[resourceid('microsoft.network/frontdoors/loadbalancingsettings", parameters('frontdoorname'), variables('loadbalancingsettingsname'))]"}, "healthprobesettings": {"id": "[resourceid('microsoft.network/frontdoors/healthprobesettings", parameters('frontdoorname'), variables('healthprobesettingsname'))]"}}}], "routingrules": [{"name": "[variables('routingrulename')]", "properties": {"frontendendpoints": [{"id": "[resourceid('microsoft.network/frontdoors/frontendendpoints", parameters('frontdoorname'), variables('frontendendpointdefaultname'))]"}, {"id": "[resourceid('microsoft.network/frontdoors/frontendendpoints", parameters('frontdoorname'), variables('frontendendpointcustomname'))]"}], "acceptedprotocols": ["http", "https"], "patternstomatch": ["/*"], "routeconfiguration": {"@odata.type": "#microsoft.azure.frontdoor.models.frontdoorforwardingconfiguration", "forwardingprotocol": "matchrequest", "backendpool": {"id": "[resourceid('microsoft.network/frontdoors/backendpools", parameters('frontdoorname'), variables('backendpoolname'))]"}}, "enabledstate": "enabled"}}]}}{"type": "microsoft.network/frontdoors/frontendendpoints/customhttpsconfiguration", "apiversion": "2020-07-01", "name": "[format('{0}/{1}/{2}", parameters('frontdoorname'), variables('frontendendpointcustomname'), "default')]", "properties": {"protocoltype": "servernameindication", "certificatesource": "azurekeyvault", "keyvaultcertificatesourceparameters": {"vault": {"id": "[parameters('certificatekeyvaultresourceid')]"}, "secretname": "[parameters('certificatekeyvaultsecretname')]", "secretversion": "[if(equals(parameters('certificatekeyvaultsecretversion'), "'), null(), parameters('certificatekeyvaultsecretversion'))]"}, "minimumtlsversion": "1.2"}, "dependson": ["[resourceid('microsoft.network/frontdoors", parameters('frontdoorname'))]"]}
Create a VNET to VNET connection across using BGP
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('vnet1cfg').name]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnet1cfg').addressspaceprefix]"]}, "subnets": [{"name": "[variables('vnet1cfg').subnetname]", "properties": {"addressprefix": "[variables('vnet1cfg').subnetprefix]"}}, {"name": "gatewaysubnet", "properties": {"addressprefix": "[variables('vnet1cfg').gatewaysubnetprefix]"}}]}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('vnet2cfg').name]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnet2cfg').addressspaceprefix]"]}, "subnets": [{"name": "[variables('vnet2cfg').subnetname]", "properties": {"addressprefix": "[variables('vnet2cfg').subnetprefix]"}}, {"name": "gatewaysubnet", "properties": {"addressprefix": "[variables('vnet2cfg').gatewaysubnetprefix]"}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('vnet1cfg').gatewaypublicipname]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('vnet2cfg').gatewaypublicipname]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"type": "microsoft.network/virtualnetworkgateways", "apiversion": "2020-06-01", "name": "[variables('vnet1cfg').gatewayname]", "location": "[parameters('location')]", "properties": {"ipconfigurations": [{"name": "vnet1gatewayconfig", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnet1cfg').name, "gatewaysubnet')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('vnet1cfg').gatewaypublicipname)]"}}}], "gatewaytype": "vpn", "sku": {"name": "[parameters('gatewaysku')]", "tier": "[parameters('gatewaysku')]"}, "vpntype": "routebased", "enablebgp": true, "bgpsettings": {"asn": "[variables('vnet1cfg').asn]"}}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('vnet1cfg').gatewaypublicipname)]", "[resourceid('microsoft.network/virtualnetworks", variables('vnet1cfg').name)]"]}{"type": "microsoft.network/virtualnetworkgateways", "apiversion": "2020-05-01", "name": "[variables('vnet2cfg').gatewayname]", "location": "[parameters('location')]", "properties": {"ipconfigurations": [{"name": "vnet2gatewayconfig", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnet2cfg').name, "gatewaysubnet')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('vnet2cfg').gatewaypublicipname)]"}}}], "gatewaytype": "vpn", "sku": {"name": "[parameters('gatewaysku')]", "tier": "[parameters('gatewaysku')]"}, "vpntype": "routebased", "enablebgp": true, "bgpsettings": {"asn": "[variables('vnet2cfg').asn]"}}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('vnet2cfg').gatewaypublicipname)]", "[resourceid('microsoft.network/virtualnetworks", variables('vnet2cfg').name)]"]}{"type": "microsoft.network/connections", "apiversion": "2020-05-01", "name": "[variables('vnet1cfg').connectionname]", "location": "[parameters('location')]", "properties": {"virtualnetworkgateway1": {"id": "[resourceid('microsoft.network/virtualnetworkgateways", variables('vnet1cfg').gatewayname)]", "properties": {}}, "virtualnetworkgateway2": {"id": "[resourceid('microsoft.network/virtualnetworkgateways", variables('vnet2cfg').gatewayname)]", "properties": {}}, "connectiontype": "vnet2vnet", "routingweight": 3, "sharedkey": "[parameters('sharedkey')]", "enablebgp": true}, "dependson": ["[resourceid('microsoft.network/virtualnetworkgateways", variables('vnet1cfg').gatewayname)]", "[resourceid('microsoft.network/virtualnetworkgateways", variables('vnet2cfg').gatewayname)]"]}{"type": "microsoft.network/connections", "apiversion": "2020-05-01", "name": "[variables('vnet2cfg').connectionname]", "location": "[parameters('location')]", "properties": {"virtualnetworkgateway1": {"id": "[resourceid('microsoft.network/virtualnetworkgateways", variables('vnet2cfg').gatewayname)]", "properties": {}}, "virtualnetworkgateway2": {"id": "[resourceid('microsoft.network/virtualnetworkgateways", variables('vnet1cfg').gatewayname)]", "properties": {}}, "connectiontype": "vnet2vnet", "routingweight": 3, "sharedkey": "[parameters('sharedkey')]", "enablebgp": true}, "dependson": ["[resourceid('microsoft.network/virtualnetworkgateways", variables('vnet1cfg').gatewayname)]", "[resourceid('microsoft.network/virtualnetworkgateways", variables('vnet2cfg').gatewayname)]"]}
Application Gateway for Multi Hosting
{"apiversion": "2021-02-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2015-06-15", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"apiversion": "2017-06-01", "name": "[variables('applicationgatewayname')]", "type": "microsoft.network/applicationgateways", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]"], "properties": {"sku": {"name": "[parameters('skuname')]", "tier": "standard", "capacity": "[parameters('capacity')]"}, "sslcertificates": [{"name": "appgatewaysslcert1", "properties": {"data": "[parameters('certdata1')]", "password": "[parameters('certpassword1')]"}}, {"name": "appgatewaysslcert2", "properties": {"data": "[parameters('certdata2')]", "password": "[parameters('certpassword2')]"}}], "gatewayipconfigurations": [{"name": "appgatewayipconfig", "properties": {"subnet": {"id": "[variables('subnetref')]"}}}], "frontendipconfigurations": [{"name": "appgatewayfrontendip", "properties": {"publicipaddress": {"id": "[variables('publicipref')]"}}}], "frontendports": [{"name": "appgatewayfrontendport1", "properties": {"port": 443}}, {"name": "appgatewayfrontendport2", "properties": {"port": 444}}], "backendaddresspools": [{"name": "appgatewaybackendpool1", "properties": {"backendaddresses": [{"ipaddress": "[parameters('backendipaddress1')]"}]}}, {"name": "appgatewaybackendpool2", "properties": {"backendaddresses": [{"ipaddress": "[parameters('backendipaddress2')]"}]}}], "backendhttpsettingscollection": [{"name": "appgatewaybackendhttpsettings", "properties": {"port": 80, "protocol": "http", "cookiebasedaffinity": "disabled"}}], "httplisteners": [{"name": "appgatewayhttplistener1", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations", variables('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports", variables('applicationgatewayname'), "appgatewayfrontendport1')]"}, "protocol": "https", "sslcertificate": {"id": "[resourceid('microsoft.network/applicationgateways/sslcertificates", variables('applicationgatewayname'), "appgatewaysslcert1')]"}, "hostname": "[parameters('hostname1')]", "requireservernameindication": true}}, {"name": "appgatewayhttplistener2", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations", variables('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports", variables('applicationgatewayname'), "appgatewayfrontendport2')]"}, "protocol": "https", "sslcertificate": {"id": "[resourceid('microsoft.network/applicationgateways/sslcertificates", variables('applicationgatewayname'), "appgatewaysslcert2')]"}, "hostname": "[parameters('hostname2')]", "requireservernameindication": true}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners", variables('applicationgatewayname'), "appgatewayhttplistener1')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools", variables('applicationgatewayname'), "appgatewaybackendpool1')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection", variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}, {"name": "rule2", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners", variables('applicationgatewayname'), "appgatewayhttplistener2')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools", variables('applicationgatewayname'), "appgatewaybackendpool2')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection", variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}]}}
Create an Application Gateway
{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-01", "name": "[parameters('publicipaddressname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipallocationmethod": "static", "dnssettings": {"domainnamelabel": "[concat('appgw-vm-", uniquestring(resourcegroup().id))]"}}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "subnet1", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"type": "microsoft.network/applicationgateways", "apiversion": "2020-05-01", "name": "[parameters('applicationgatewayname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses/", parameters('publicipaddressname'))]"], "properties": {"sku": {"name": "[parameters('skuname')]", "tier": "standard_v2", "capacity": 2}, "gatewayipconfigurations": [{"name": "appgatewayipconfig", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('virtualnetworkname'), "subnet1')]"}}}], "frontendipconfigurations": [{"name": "appgatewayfrontendip", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", parameters('publicipaddressname'))]"}}}], "frontendports": [{"name": "httpport", "properties": {"port": 80}}], "backendaddresspools": [{"name": "appgatewaybackendpool", "properties": {"backendaddresses": [{"ipaddress": "[parameters('backendipaddress1')]"}]}}], "backendhttpsettingscollection": [{"name": "appgatewaybackendhttpsettings", "properties": {"port": 80, "protocol": "http", "cookiebasedaffinity": "disabled", "pickhostnamefrombackendaddress": true, "probe": {"id": "[resourceid('microsoft.network/applicationgateways/probes", parameters('applicationgatewayname'), "httpcustomprobe')]"}}}], "httplisteners": [{"name": "httplistener", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations", parameters('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports", parameters('applicationgatewayname'), "httpport')]"}, "protocol": "http"}}], "requestroutingrules": [{"name": "httprule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners", parameters('applicationgatewayname'), "httplistener')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools", parameters('applicationgatewayname'), "appgatewaybackendpool')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection", parameters('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}, "rewriteruleset": {"id": "[resourceid('microsoft.network/applicationgateways/rewriterulesets", parameters('applicationgatewayname'), "rewriteruleset1')]"}}}], "rewriterulesets": [{"name": "rewriteruleset1", "properties": {"rewriterules": [{"name": "rwrule1", "actionset": {"requestheaderconfigurations": [{"headername": "accept-charset", "headervalue": "utf-8"}], "responseheaderconfigurations": [{"headername": "content-type", "headervalue": "text/html; charset=utf-8"}]}}]}, "type": "microsoft.network/applicationgateways/rewriterulesets"}], "probes": [{"name": "httpcustomprobe", "properties": {"protocol": "http", "path": "/", "interval": 30, "timeout": 30, "unhealthythreshold": 3, "pickhostnamefrombackendhttpsettings": true, "minservers": 0, "match": {"statuscodes": ["200-399"]}}, "type": "microsoft.network/applicationgateways/probes"}]}}
Deploy Managed AADDS with required VNet and NSG configurations
{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-11-01", "name": "[variables('domainservicesnsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allowpsremotingslicep", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "5986", "sourceaddressprefixes": "[variables('psremotingslicepipaddresses')]", "destinationaddressprefix": "*", "access": "allow", "priority": 301, "direction": "inbound"}}, {"name": "allowrdp", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefixes": "[variables('rdpipaddresses')]", "destinationaddressprefix": "*", "access": "allow", "priority": 201, "direction": "inbound"}}, {"name": "allowsyncwithazuread", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "443", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 101, "direction": "inbound"}}, {"name": "allowpsremotingslicet", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "5986", "sourceaddressprefixes": "[variables('psremotingslicetipaddresses')]", "destinationaddressprefix": "*", "access": "allow", "priority": 302, "direction": "inbound"}}]}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-11-01", "name": "[parameters('domainservicesvnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('domainservicesvnetaddressprefix')]"]}, "subnets": [{"name": "[parameters('domainservicessubnetname')]", "properties": {"addressprefix": "[parameters('domainservicessubnetaddressprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('domainservicesnsgname'))]"}}}]}, "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('domainservicesnsgname'))]"]}
This template updates your Front Door to change the health probe settings by setting the probe path and also the intervals in which the probes will be sent.
{"type": "microsoft.network/frontdoors", "apiversion": "2020-05-01", "name": "[parameters('frontdoorname')]", "location": "[variables('frontdoorlocation')]", "properties": {"routingrules": [{"name": "routingrule1", "properties": {"frontendendpoints": [{"id": "[resourceid('microsoft.network/frontdoors/frontendendpoints", parameters('frontdoorname'), "frontendendpoint1')]"}], "acceptedprotocols": ["http"], "patternstomatch": ["/*"], "routeconfiguration": {"@odata.type": "#microsoft.azure.frontdoor.models.frontdoorforwardingconfiguration", "forwardingprotocol": "matchrequest", "backendpool": {"id": "[resourceid('microsoft.network/frontdoors/backendpools", parameters('frontdoorname'), "backendpool1')]"}}, "enabledstate": "enabled"}}], "healthprobesettings": [{"name": "[parameters('healthprobename')]", "properties": {"path": "[parameters('healthprobepath')]", "protocol": "[parameters('healthprobeprotocol')]", "intervalinseconds": "[parameters('healthprobeintervalinseconds')]"}}], "loadbalancingsettings": [{"name": "loadbalancingsettings1", "properties": {"samplesize": 4, "successfulsamplesrequired": 2}}], "backendpools": [{"name": "backendpool1", "properties": {"backends": [{"address": "[parameters('backendaddress')]", "httpport": 80, "httpsport": 443, "weight": 50, "priority": 1, "enabledstate": "enabled"}], "loadbalancingsettings": {"id": "[resourceid('microsoft.network/frontdoors/loadbalancingsettings", parameters('frontdoorname'), "loadbalancingsettings1')]"}, "healthprobesettings": {"id": "[resourceid('microsoft.network/frontdoors/healthprobesettings", parameters('frontdoorname'), "healthprobesettings1')]"}}}], "frontendendpoints": [{"name": "frontendendpoint1", "properties": {"hostname": "[variables('frontdoorhostname')]", "sessionaffinityenabledstate": "disabled"}}], "enabledstate": "enabled"}}
Sets service endpoint on one of the 2 subnets in a VNet and secures storage account to that subnet
{"comments": "default network security group for template", "type": "microsoft.network/networksecuritygroups", "apiversion": "2019-08-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "default-allow-3389", "properties": {"priority": 1000, "access": "allow", "direction": "inbound", "destinationportrange": "3389", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}]}}{"apiversion": "2017-09-01", "type": "microsoft.network/virtualnetworks", "name": "[parameters('vnetname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"], "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "subnets": [{"name": "subnet1", "properties": {"addressprefix": "[parameters('subnet1prefix')]", "serviceendpoints": [{"service": "microsoft.storage"}], "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}, {"name": "subnet2", "properties": {"addressprefix": "[parameters('subnet2prefix')]"}}]}}{"apiversion": "2017-09-01", "type": "microsoft.network/publicipaddresses", "name": "[concat(variables('publicipaddressname'), copyindex())]", "location": "[parameters('location')]", "copy": {"name": "piploop", "count": 2}, "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2016-10-01", "type": "microsoft.network/networkinterfaces", "name": "[concat('nic", copyindex())]", "location": "[parameters('location')]", "dependson": ["[parameters('vnetname')]", "piploop"], "copy": {"name": "nicloop", "count": 2}, "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('subnetid')[copyindex()]]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", concat(variables('publicipaddressname'), copyindex()))]"}}}]}}
This template creates a Network Security Group
{"apiversion": "2020-05-01", "type": "microsoft.network/networksecuritygroups", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "first_rule", "properties": {"description": "this is the first rule", "protocol": "tcp", "sourceportrange": "23-45", "destinationportrange": "46-56", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 123, "direction": "inbound"}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups/", variables('networksecuritygroupname'))]"], "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}
This template creates an Azure Traffic Manager profile that provides an App Service behind it
{"type": "microsoft.network/trafficmanagerprofiles", "apiversion": "2018-08-01", "name": "[parameters('trafficmanagername')]", "location": "global", "properties": {"profilestatus": "enabled", "trafficroutingmethod": "priority", "dnsconfig": {"relativename": "[parameters('uniquednsname')]", "ttl": 30}, "monitorconfig": {"protocol": "https", "port": 443, "path": "/"}, "endpoints": [{"name": "[parameters('uniquednsnameforwebapp')]", "type": "microsoft.network/trafficmanagerprofiles/azureendpoints", "properties": {"targetresourceid": "[resourceid('microsoft.web/sites", parameters('uniquednsnameforwebapp'))]", "endpointstatus": "enabled"}}]}, "dependson": ["[resourceid('microsoft.web/sites", parameters('uniquednsnameforwebapp'))]"]}
Create a sandbox setup of Azure Firewall with Availability Zones
{"type": "microsoft.network/routetables", "apiversion": "2020-06-01", "name": "[variables('azfwroutetablename')]", "location": "[parameters('location')]", "properties": {"disablebgproutepropagation": false, "routes": [{"name": "azfwdefaultroute", "properties": {"addressprefix": "0.0.0.0/0", "nexthoptype": "virtualappliance", "nexthopipaddress": "[variables('nexthopip')]"}}]}}{"comments": "simple network security group for subnet [variables('serverssubnetname')]", "type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/routetables", variables('azfwroutetablename'))]", "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"], "tags": {"displayname": "[parameters('virtualnetworkname')]"}, "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressprefix')]"]}, "subnets": [{"name": "[variables('jumpboxsubnetname')]", "properties": {"addressprefix": "[variables('jumpboxsubnetprefix')]"}}, {"name": "[variables('azurefirewallsubnetname')]", "properties": {"addressprefix": "[variables('azurefirewallsubnetprefix')]"}}, {"name": "[variables('serverssubnetname')]", "properties": {"addressprefix": "[variables('serverssubnetprefix')]", "routetable": {"id": "[resourceid('microsoft.network/routetables", variables('azfwroutetablename'))]"}, "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[concat(variables('publicipnameprefix'), add(copyindex(), 1))]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "copy": {"name": "publicipcopy", "count": "[parameters('numberoffirewallpublicipaddresses')]"}, "properties": {"publicipallocationmethod": "static", "publicipaddressversion": "ipv4"}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('jumpboxpublicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "[variables('jumpboxnsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "mynetworksecuritygrouprulerdp", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1000, "direction": "inbound"}}]}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[variables('jumpboxnicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", variables('jumpboxpublicipaddressname'))]", "[resourceid('microsoft.network/virtualnetworks/", parameters('virtualnetworkname'))]", "[resourceid('microsoft.network/networksecuritygroups", variables('jumpboxnsgname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('jumpboxpublicipaddressname'))]"}, "subnet": {"id": "[variables('jumpboxsubnetid')]"}}}], "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('jumpboxnsgname'))]"}}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[variables('servernicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", parameters('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('serversubnetid')]"}}}]}}{"type": "microsoft.network/azurefirewalls", "apiversion": "2020-06-01", "name": "[variables('firewallname')]", "location": "[parameters('location')]", "zones": "[if(equals(length(parameters('availabilityzones')), 0), json('null'), parameters('availabilityzones'))]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "publicipcopy"], "properties": {"ipconfigurations": "[variables('azurefirewallipconfigurations')]", "applicationrulecollections": [{"name": "apprc1", "properties": {"priority": 101, "action": {"type": "allow"}, "rules": [{"name": "apprule1", "protocols": [{"port": 80, "protocoltype": "http"}, {"port": 443, "protocoltype": "https"}], "targetfqdns": ["www.microsoft.com"], "sourceaddresses": ["10.0.2.0/24"]}]}}], "networkrulecollections": [{"name": "netrc1", "properties": {"priority": 200, "action": {"type": "allow"}, "rules": [{"name": "netrule1", "protocols": ["tcp"], "sourceaddresses": ["10.0.2.0/24"], "destinationaddresses": ["*"], "destinationports": ["8000-8999"]}]}}]}}
Create an Azure Firewall with Availability Zones
{"type": "microsoft.network/ipgroups", "apiversion": "2020-06-01", "name": "[parameters('ipgroups_name1')]", "location": "[parameters('location')]", "properties": {"ipaddresses": ["13.73.64.64/26", "13.73.208.128/25", "52.126.194.0/23"]}}{"type": "microsoft.network/ipgroups", "apiversion": "2020-06-01", "name": "[parameters('ipgroups_name2')]", "location": "[parameters('location')]", "properties": {"ipaddresses": ["12.0.0.0/24", "13.9.0.0/24"]}}{"type": "microsoft.network/routetables", "apiversion": "2020-06-01", "name": "[variables('azfwroutetablename')]", "location": "[parameters('location')]", "properties": {"disablebgproutepropagation": false, "routes": [{"name": "azfwdefaultroute", "properties": {"addressprefix": "0.0.0.0/0", "nexthoptype": "virtualappliance", "nexthopipaddress": "[variables('nexthopip')]"}}]}}{"comments": "simple network security group for subnet [variables('serverssubnetname')]", "type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/routetables", variables('azfwroutetablename'))]", "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"], "tags": {"displayname": "[parameters('virtualnetworkname')]"}, "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressprefix')]"]}, "subnets": [{"name": "[variables('jumpboxsubnetname')]", "properties": {"addressprefix": "[variables('jumpboxsubnetprefix')]"}}, {"name": "[variables('azurefirewallsubnetname')]", "properties": {"addressprefix": "[variables('azurefirewallsubnetprefix')]"}}, {"name": "[variables('serverssubnetname')]", "properties": {"addressprefix": "[variables('serverssubnetprefix')]", "routetable": {"id": "[resourceid('microsoft.network/routetables", variables('azfwroutetablename'))]"}, "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[concat(variables('publicipnameprefix'), add(copyindex(), 1))]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "copy": {"name": "publicipcopy", "count": "[parameters('numberoffirewallpublicipaddresses')]"}, "properties": {"publicipallocationmethod": "static", "publicipaddressversion": "ipv4"}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('jumpboxpublicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "[variables('jumpboxnsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "mynetworksecuritygrouprulessh", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1000, "direction": "inbound"}}]}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[variables('jumpboxnicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('jumpboxpublicipaddressname'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "[resourceid('microsoft.network/networksecuritygroups", variables('jumpboxnsgname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('jumpboxpublicipaddressname'))]"}, "subnet": {"id": "[variables('jumpboxsubnetid')]"}}}], "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('jumpboxnsgname'))]"}}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[variables('servernicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('serversubnetid')]"}}}]}}{"type": "microsoft.network/azurefirewalls", "apiversion": "2020-06-01", "name": "[variables('firewallname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name1'))]", "[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name2'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "publicipcopy"], "properties": {"ipconfigurations": "[variables('azurefirewallipconfigurations')]", "applicationrulecollections": [{"name": "apprc1", "properties": {"priority": 101, "action": {"type": "allow"}, "rules": [{"name": "someapprule", "protocols": [{"protocoltype": "http", "port": 8080}], "targetfqdns": ["*bing.com"], "sourceipgroups": ["[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name1'))]"]}, {"name": "someotherapprule", "protocols": [{"protocoltype": "mssql", "port": 1433}], "targetfqdns": ["[concat('sql1", environment().suffixes.sqlserverhostname)]"], "sourceipgroups": ["[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name1'))]", "[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name2'))]"]}]}}], "networkrulecollections": [{"name": "netrc1", "properties": {"priority": 200, "action": {"type": "allow"}, "rules": [{"name": "networkrule", "description": "desc1", "protocols": ["udp", "tcp", "icmp"], "sourceaddresses": ["10.0.0.0", "111.1.0.0/23"], "sourceipgroups": ["[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name1'))]"], "destinationipgroups": ["[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name2'))]"], "destinationports": ["90"]}]}}]}}
This template creates an Azure Traffic Manager profile using external endpoints.
{"type": "microsoft.network/trafficmanagerprofiles", "apiversion": "2018-08-01", "name": "externalendpointexample", "location": "global", "properties": {"profilestatus": "enabled", "trafficroutingmethod": "performance", "dnsconfig": {"relativename": "[parameters('uniquednsname')]", "ttl": 30}, "monitorconfig": {"protocol": "https", "port": 443, "path": "/", "expectedstatuscoderanges": [{"min": 200, "max": 202}, {"min": 301, "max": 302}]}, "endpoints": [{"type": "microsoft.network/trafficmanagerprofiles/externalendpoints", "name": "endpoint1", "properties": {"target": "www.microsoft.com", "endpointstatus": "enabled", "endpointlocation": "northeurope"}}, {"type": "microsoft.network/trafficmanagerprofiles/externalendpoints", "name": "endpoint2", "properties": {"target": "docs.microsoft.com", "endpointstatus": "enabled", "endpointlocation": "southcentralus"}}]}}
This template allows you to add an NSG with Azure Redis Cache security rules to an existing subnet within a VNET.
{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-05-01", "name": "[parameters('newnsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allow_outbound_storage_pki", "properties": {"description": "redis dependencies on azure storage/pki (internet)", "protocol": "tcp", "sourceportrange": "*", "destinationportranges": ["80", "443"], "sourceaddressprefix": "*", "destinationaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "access": "allow", "priority": 200, "direction": "outbound"}}, {"name": "allow_outbound_dns", "properties": {"description": "redis dependencies on dns (internet/vnet)", "protocol": "*", "sourceportrange": "*", "destinationportrange": "53", "sourceaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "destinationaddressprefix": "*", "access": "allow", "priority": 201, "direction": "outbound"}}, {"name": "allow_outbound_redisportswithinsubnet", "properties": {"description": "internal communications for redis", "protocol": "tcp", "sourceportrange": "*", "destinationportranges": ["6379", "6380", "8443", "10221-10231", "20226", "13000-13999", "15000-15999"], "sourceaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "destinationaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "access": "allow", "priority": 202, "direction": "outbound"}}, {"name": "allow_inbound_clientendpoints", "properties": {"description": "client communication to redis, azure load balancing", "protocol": "tcp", "sourceportrange": "*", "destinationportranges": ["6379", "6380"], "sourceaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "destinationaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "access": "allow", "priority": 200, "direction": "inbound"}}, {"name": "allow_inbound_clientcommunicationwithinvnet", "properties": {"description": "client communication to redis, azure load balancing", "protocol": "tcp", "sourceportrange": "*", "destinationportranges": ["6379", "6380", "13000-13999", "15000-15999"], "sourceaddressprefix": "virtualnetwork", "destinationaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "access": "allow", "priority": 201, "direction": "inbound"}}, {"name": "allow_inbound_loadbalancingwithinvnet", "properties": {"description": "client communication to redis, azure load balancing", "protocol": "tcp", "sourceportrange": "*", "destinationportranges": ["6379", "6380", "13000-13999", "15000-15999"], "sourceaddressprefix": "azureloadbalancer", "destinationaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "access": "allow", "priority": 202, "direction": "inbound"}}, {"name": "allow_inbound_internalrediscommunication", "properties": {"description": "internal communications for redis", "protocol": "tcp", "sourceportrange": "*", "destinationportranges": ["8443", "10221-10231", "20226"], "sourceaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "destinationaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "access": "allow", "priority": 203, "direction": "inbound"}}, {"name": "allow_inbound_loadbalancertoredisinternaladdresses", "properties": {"description": "internal communications for redis", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "10221-10231", "sourceaddressprefix": "azureloadbalancer", "destinationaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "access": "allow", "priority": 204, "direction": "inbound"}}, {"name": "allow_inbound_loadbalancing", "properties": {"description": "azure load balancing", "protocol": "*", "sourceportrange": "*", "destinationportranges": ["8500", "16001"], "sourceaddressprefix": "azureloadbalancer", "destinationaddressprefix": "[reference(variables('subnetid'), "2018-04-01').addressprefix]", "access": "allow", "priority": 205, "direction": "inbound"}}]}}
Deploy a NAT gateway and virtual machine to the virtual network associated with the NAT gateway
{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "[parameters('nsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "ssh", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 300, "direction": "inbound"}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[parameters('publicipname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static", "idletimeoutinminutes": 4}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[parameters('publicipvmname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static", "idletimeoutinminutes": 4}}{"type": "microsoft.network/publicipprefixes", "apiversion": "2020-06-01", "name": "[parameters('publicipprefixname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"prefixlength": 31, "publicipaddressversion": "ipv4"}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[parameters('vnetname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/natgateways", parameters('natgatewayname'))]"], "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressspace')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('vnetsubnetprefix')]", "natgateway": {"id": "[resourceid('microsoft.network/natgateways", parameters('natgatewayname'))]"}, "privateendpointnetworkpolicies": "enabled", "privatelinkservicenetworkpolicies": "enabled"}}], "enableddosprotection": false, "enablevmprotection": false}}{"type": "microsoft.network/natgateways", "apiversion": "2020-06-01", "name": "[parameters('natgatewayname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", parameters('publicipname'))]", "[resourceid('microsoft.network/publicipprefixes", parameters('publicipprefixname'))]"], "properties": {"idletimeoutinminutes": 4, "publicipaddresses": [{"id": "[resourceid('microsoft.network/publicipaddresses", parameters('publicipname'))]"}], "publicipprefixes": [{"id": "[resourceid('microsoft.network/publicipprefixes", parameters('publicipprefixname'))]"}]}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-05-01", "name": "[concat(parameters('vnetname'), "/mysubnet')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('vnetname'))]", "[resourceid('microsoft.network/natgateways", parameters('natgatewayname'))]"], "properties": {"addressprefix": "[parameters('vnetsubnetprefix')]", "natgateway": {"id": "[resourceid('microsoft.network/natgateways", parameters('natgatewayname'))]"}, "privateendpointnetworkpolicies": "enabled", "privatelinkservicenetworkpolicies": "enabled"}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[parameters('networkinterfacename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", parameters('publicipvmname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('vnetname'), "mysubnet')]", "[resourceid('microsoft.network/networksecuritygroups", parameters('nsgname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipaddress": "192.168.0.4", "privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", parameters('publicipvmname'))]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('vnetname'), "mysubnet')]"}, "primary": true, "privateipaddressversion": "ipv4"}}], "enableacceleratednetworking": false, "enableipforwarding": false, "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", parameters('nsgname'))]"}}}