Description
stringlengths
19
200
IaC
stringlengths
159
7.6k
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"}}
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')]"}}}}
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 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')))]"}}
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')]"}}}]}}
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"]}]}}]}}
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'))]"}}}
This template applies a newly created NSG to an existing subnet
{"type": "microsoft.network/networksecuritygroups", "name": "new-nsg", "location": "[parameters('location')]", "apiversion": "2020-05-01", "properties": {"securityrules": [{"name": "ssh", "properties": {"description": "allows ssh traffic", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}}
Reserved IP Use Case Snippet
{"type": "microsoft.network/publicipaddresses", "name": "[variables('network_pip_reserved_name')]", "apiversion": "2020-11-01", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "static", "dnssettings": {"domainnamelabel": "[variables('network_pip_reserved_fqdn')]"}}}{"type": "microsoft.network/loadbalancers", "name": "[variables('network_lb_public_name')]", "apiversion": "2020-11-01", "location": "[parameters('location')]", "dependson": ["[variables('network_pip_reserved_id')]"], "properties": {"frontendipconfigurations": [{"name": "[variables('network_lb_public_fename')]", "properties": {"publicipaddress": {"id": "[variables('network_pip_reserved_id')]"}}}], "backendaddresspools": [{"name": "[variables('network_lb_public_bepoolname')]"}], "inboundnatrules": [{"name": "[variables('network_lb_public_natrule_ssh_vm_name')]", "properties": {"frontendipconfiguration": {"id": "[variables('network_lb_public_feid')]"}, "protocol": "tcp", "frontendport": "[variables('network_lb_public_natrule_ssh_vm_publicport')]", "backendport": 22, "enablefloatingip": false}}]}}{"type": "microsoft.network/loadbalancers", "name": "[variables('network_lb_public_name2')]", "apiversion": "2020-11-01", "location": "[parameters('location')]", "properties": {"frontendipconfigurations": [{"name": "[variables('network_lb_public_fename2')]", "properties": {"publicipaddress": {"id": "[variables('network_pip_reserved_id2')]"}}}], "backendaddresspools": [{"name": "[variables('network_lb_public_bepoolname2')]"}], "inboundnatrules": [{"name": "[variables('network_lb_public_natrule_ssh_vm_name2')]", "properties": {"frontendipconfiguration": {"id": "[variables('network_lb_public_feid2')]"}, "protocol": "tcp", "frontendport": "[variables('network_lb_public_natrule_ssh_vm_publicport2')]", "backendport": 22, "enablefloatingip": false}}]}}
Deploy a NAT gateway and virtual network. The NAT gateway resource will be associated with the single subnet in the virtual network
{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('publicipname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static", "idletimeoutinminutes": 4, "dnssettings": {"domainnamelabel": "[parameters('publicipdns')]"}}}{"type": "microsoft.network/natgateways", "apiversion": "2020-06-01", "name": "[parameters('natgatewayname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"idletimeoutinminutes": 4, "publicipaddresses": "[if(not(empty(parameters('publicipdns'))), variables('publicipaddresses'), null())]"}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('publicipname'))]"]}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[parameters('vnetname')]", "location": "[parameters('location')]", "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}, "dependson": ["[resourceid('microsoft.network/natgateways", parameters('natgatewayname'))]"]}
Creates a simple environment that shows how to work with Application Security Groups within templates.
{"comments": "application security group", "name": "[variables('asgname')]", "type": "microsoft.network/applicationsecuritygroups", "apiversion": "2020-05-01", "location": "[parameters('location')]", "properties": {}}{"comments": "network security group", "name": "[variables('nsgname')]", "type": "microsoft.network/networksecuritygroups", "apiversion": "2020-05-01", "location": "[parameters('location')]", "dependson": ["[variables('asgname')]"], "properties": {"securityrules": [{"name": "allowhttpall", "properties": {"description": "allow http traffic to web servers", "sourceaddressprefix": "*", "sourceportrange": "*", "direction": "inbound", "access": "allow", "priority": 100, "protocol": "tcp", "destinationportrange": "80", "destinationapplicationsecuritygroups": [{"id": "[variables('asgid')]"}]}}, {"name": "allowsshall", "properties": {"description": "allow ssh traffic to web servers", "sourceaddressprefix": "*", "sourceportrange": "*", "direction": "inbound", "access": "allow", "priority": 200, "protocol": "tcp", "destinationportrange": "22", "destinationapplicationsecuritygroups": [{"id": "[variables('asgid')]"}]}}]}}{"comments": "virtual network", "name": "[variables('vnetname')]", "type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "location": "[parameters('location')]", "dependson": ["[variables('nsgname')]"], "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressspace')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetadressprefix')]", "networksecuritygroup": {"id": "[variables('nsgid')]"}}}]}}{"comments": "public ip address", "name": "[variables('pipname')]", "type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-01", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"comments": "web server network interface", "name": "[concat(parameters('vmname'),"-nic')]", "type": "microsoft.network/networkinterfaces", "location": "[parameters('location')]", "apiversion": "2020-05-01", "dependson": ["[variables('vnetname')]", "[variables('pipname')]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[variables('pipid')]"}, "subnet": {"id": "[variables('subnetid')]"}, "applicationsecuritygroups": [{"id": "[variables('asgid')]"}]}}]}}
Create an virtual hub secured with Azure Firewall
{"type": "microsoft.network/virtualwans", "apiversion": "2020-06-01", "name": "vwan-01", "location": "[parameters('location')]", "properties": {"disablevpnencryption": false, "allowbranchtobranchtraffic": true, "office365localbreakoutcategory": "none", "type": "standard"}}{"type": "microsoft.network/virtualhubs", "apiversion": "2020-06-01", "name": "hub-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualwans", "vwan-01')]"], "properties": {"addressprefix": "10.1.0.0/16", "virtualwan": {"id": "[resourceid('microsoft.network/virtualwans", "vwan-01')]"}}}{"type": "microsoft.network/virtualhubs/hubvirtualnetworkconnections", "apiversion": "2020-06-01", "name": "hub-01/hub-spoke", "dependson": ["[resourceid('microsoft.network/azurefirewalls", "azfwtest')]", "[resourceid('microsoft.network/virtualhubs", "hub-01')]", "[resourceid('microsoft.network/virtualnetworks", "spoke-01')]", "[resourceid('microsoft.network/virtualhubs/hubroutetables", "hub-01", "rt_vnet')]"], "properties": {"remotevirtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks", "spoke-01')]"}, "allowhubtoremotevnettransit": true, "allowremotevnettousehubvnetgateways": false, "enableinternetsecurity": true, "routingconfiguration": {"associatedroutetable": {"id": "[resourceid('microsoft.network/virtualhubs/hubroutetables", "hub-01", "rt_vnet')]"}, "propagatedroutetables": {"labels": ["vnet"], "ids": [{"id": "[resourceid('microsoft.network/virtualhubs/hubroutetables", "hub-01", "rt_vnet')]"}]}}}}{"type": "microsoft.network/firewallpolicies", "apiversion": "2020-06-01", "name": "policy-01", "location": "[parameters('location')]", "properties": {"threatintelmode": "alert"}}{"type": "microsoft.network/firewallpolicies/rulecollectiongroups", "apiversion": "2020-06-01", "name": "policy-01/defaultapplicationrulecollectiongroup", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/firewallpolicies", "policy-01')]"], "properties": {"priority": 300, "rulecollections": [{"rulecollectiontype": "firewallpolicyfilterrulecollection", "name": "rc-01", "priority": 100, "action": {"type": "allow"}, "rules": [{"ruletype": "applicationrule", "name": "allow-msft", "sourceaddresses": ["*"], "protocols": [{"port": "80", "protocoltype": "http"}, {"port": "443", "protocoltype": "https"}], "targetfqdns": ["*.microsoft.com"]}]}]}}{"type": "microsoft.network/azurefirewalls", "apiversion": "2020-06-01", "name": "azfwtest", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualhubs", "hub-01')]", "[resourceid('microsoft.network/firewallpolicies", "policy-01')]"], "properties": {"sku": {"name": "azfw_hub", "tier": "standard"}, "hubipaddresses": {"publicips": {"count": 1}}, "virtualhub": {"id": "[resourceid('microsoft.network/virtualhubs", "hub-01')]"}, "firewallpolicy": {"id": "[resourceid('microsoft.network/firewallpolicies", "policy-01')]"}}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "spoke-01", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["10.0.0.0/16"]}, "enableddosprotection": false, "enablevmprotection": false}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-06-01", "name": "spoke-01/workload-sn", "dependson": ["[resourceid('microsoft.network/virtualnetworks", "spoke-01')]"], "properties": {"addressprefix": "10.0.1.0/24", "privateendpointnetworkpolicies": "enabled", "privatelinkservicenetworkpolicies": "enabled"}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-06-01", "name": "spoke-01/jump-sn", "dependson": ["[resourceid('microsoft.network/virtualnetworks/subnets", "spoke-01", "workload-sn')]", "[resourceid('microsoft.network/routetables", "rt-01')]"], "properties": {"addressprefix": "10.0.2.0/24", "routetable": {"id": "[resourceid('microsoft.network/routetables","rt-01')]"}, "privateendpointnetworkpolicies": "enabled", "privatelinkservicenetworkpolicies": "enabled"}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "netinterface-workload-srv", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/subnets", "spoke-01","workload-sn')]", "[resourceid('microsoft.network/networksecuritygroups", "nsg-workload-srv')]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", "spoke-01", "workload-sn')]"}, "primary": true, "privateipaddressversion": "ipv4"}}], "enableacceleratednetworking": false, "enableipforwarding": false, "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", "nsg-workload-srv')]"}}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "netinterface-jump-srv", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", "publicip-jump-srv')]", "[resourceid('microsoft.network/virtualnetworks/subnets", "spoke-01","jump-sn')]", "[resourceid('microsoft.network/networksecuritygroups", "nsg-jump-srv')]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", "publicip-jump-srv')]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", "spoke-01", "jump-sn')]"}, "primary": true, "privateipaddressversion": "ipv4"}}], "enableacceleratednetworking": false, "enableipforwarding": false, "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", "nsg-jump-srv')]"}}}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "nsg-jump-srv", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "rdp", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 300, "direction": "inbound"}}]}}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "nsg-workload-srv", "location": "[parameters('location')]", "properties": {}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "publicip-jump-srv", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static", "idletimeoutinminutes": 4}}{"type": "microsoft.network/routetables", "apiversion": "2020-06-01", "name": "rt-01", "location": "[parameters('location')]", "properties": {"disablebgproutepropagation": false, "routes": [{"name": "jump-to-inet", "properties": {"addressprefix": "0.0.0.0/0", "nexthoptype": "internet"}}]}}{"type": "microsoft.network/virtualhubs/hubroutetables", "apiversion": "2020-06-01", "name": "hub-01/rt_vnet", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/azurefirewalls", "azfwtest')]"], "properties": {"routes": [{"name": "workload-sntofirewall", "destinationtype": "cidr", "destinations": ["10.0.1.0/24"], "nexthoptype": "resourceid", "nexthop": "[resourceid('microsoft.network/azurefirewalls", "azfwtest')]"}, {"name": "internettofirewall", "destinationtype": "cidr", "destinations": ["0.0.0.0/0"], "nexthoptype": "resourceid", "nexthop": "[resourceid('microsoft.network/azurefirewalls", "azfwtest')]"}], "labels": ["vnet"]}}
Create a sandbox setup of Azure Firewall with Linux jumpbox and Linux server
{"type": "microsoft.network/routetables", "name": "[variables('azfwroutetablename')]", "apiversion": "2020-05-01", "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-05-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {}}{"name": "[parameters('virtualnetworkname')]", "apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "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'))]"}}}]}}{"name": "[concat(variables('publicipnameprefix'), add(copyindex(), 1))]", "type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-01", "location": "[parameters('location')]", "sku": {"name": "standard"}, "copy": {"name": "publicipcopy", "count": "[parameters('numberoffirewallpublicipaddresses')]"}, "properties": {"publicipallocationmethod": "static", "publicipaddressversion": "ipv4"}}{"name": "[variables('jumpboxpublicipaddressname')]", "type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-01", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"name": "[variables('jumpboxnsgname')]", "type": "microsoft.network/networksecuritygroups", "apiversion": "2020-05-01", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "mynetworksecuritygrouprulessh", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1000, "direction": "inbound"}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/networkinterfaces", "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'))]"}}}{"apiversion": "2020-05-01", "type": "microsoft.network/networkinterfaces", "name": "[variables('servernicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('serversubnetid')]"}}}]}}{"apiversion": "2020-04-01", "type": "microsoft.network/firewallpolicies", "name": "[variables('firewallpolicyname')]", "location": "[parameters('location')]", "properties": {"threatintelmode": "alert"}, "resources": [{"apiversion": "2020-04-01", "type": "rulegroups", "name": "networkrg", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/firewallpolicies", variables('firewallpolicyname'))]", "[resourceid('microsoft.network/firewallpolicies/rulegroups", variables('firewallpolicyname'), "apprg')]"], "properties": {"priority": 100, "rules": [{"name": "networkrule1", "conditiontype": "network", "ruletype": "firewallpolicyfilterrule", "action": {"type": "allow"}, "priority": 230, "ruleconditions": [{"name": "netrc1", "ipprotocols": ["tcp"], "destinationports": ["80"], "sourceaddresses": ["*"], "destinationaddresses": ["*"], "ruleconditiontype": "networkrulecondition"}]}]}}, {"apiversion": "2020-04-01", "type": "rulegroups", "name": "apprg", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/firewallpolicies", variables('firewallpolicyname'))]"], "properties": {"priority": 200, "rules": [{"name": "apprule1", "priority": 4444, "ruletype": "firewallpolicyfilterrule", "action": {"type": "allow"}, "ruleconditions": [{"ruleconditiontype": "applicationrulecondition", "name": "apprc1", "protocols": [{"protocoltype": "http", "port": 8000}], "targetfqdns": ["*"], "sourceaddresses": ["*"]}]}]}}]}{"apiversion": "2020-04-01", "type": "microsoft.network/azurefirewalls", "name": "[variables('firewallname')]", "location": "[parameters('location')]", "zones": "[if(equals(length(parameters('availabilityzones')), 0), json('null'), parameters('availabilityzones'))]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "[resourceid('microsoft.network/firewallpolicies", variables('firewallpolicyname'))]", "[resourceid('microsoft.network/firewallpolicies/rulegroups", variables('firewallpolicyname'), "apprg')]", "[resourceid('microsoft.network/firewallpolicies/rulegroups", variables('firewallpolicyname'), "networkrg')]", "publicipcopy"], "properties": {"ipconfigurations": "[variables('azurefirewallipconfigurations')]", "firewallpolicy": {"id": "[resourceid('microsoft.network/firewallpolicies", variables('firewallpolicyname'))]"}}}
This template updates a Front Door to enable session affinity for your frontend host, thereby, sending subsequent traffic from the same user session to the same backend.
{"apiversion": "2020-07-01", "type": "microsoft.network/frontdoors", "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": "healthprobesettings1", "properties": {"path": "/", "protocol": "http", "intervalinseconds": 120}}], "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": "[parameters('sessionaffinityenabledstate')]", "sessionaffinityttlseconds": "[parameters('sessionaffinityttlseconds')]"}}], "enabledstate": "enabled"}}
This template demonstrates configuring a Backend Pool by IP Address when deploying a Standard Load Balancer
{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[concat(parameters('projectname'),"-vm", copyindex(1), "-networkinterface')]", "location": "[parameters('location')]", "copy": {"name": "networkinterfacecopy", "count": 3}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('vnetsubnetname'))]", "[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "static", "privateipaddress": "[variables('nicipaddresses')[copyindex()]]", "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('vnetsubnetname'))]"}}}], "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"}}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-06-01", "name": "[concat(variables('vnetname'), "/" ,variables('bastionsubnetname'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('vnetsubnetname'))]"], "properties": {"addressprefix": "[variables('vnetbastionsubnetaddressprefix')]"}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-06-01", "name": "[concat(variables('vnetname'), "/" ,variables('vnetsubnetname'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"], "properties": {"addressprefix": "[variables('vnetsubnetaddressprefix')]"}}{"type": "microsoft.network/bastionhosts", "apiversion": "2020-05-01", "name": "[variables('bastionname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('bastionpublicipaddressname'))]", "[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('bastionsubnetname'))]"], "properties": {"ipconfigurations": [{"name": "ipconf", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('bastionpublicipaddressname'))]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('bastionsubnetname'))]"}}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('bastionpublicipaddressname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('lbskuname')]"}, "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static"}}{"type": "microsoft.network/loadbalancers", "apiversion": "2020-06-01", "name": "[variables('lbname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('lbskuname')]"}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('lbpublicipaddressname'))]", "[resourceid('microsoft.network/publicipaddresses", variables('lbpublicipaddressnameoutbound'))]"], "properties": {"frontendipconfigurations": [{"name": "[variables('lbfrontendname')]", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('lbpublicipaddressname'))]"}}}, {"name": "[variables('lbfrontendnameoutbound')]", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('lbpublicipaddressnameoutbound'))]"}}}], "backendaddresspools": [{"name": "[variables('lbbackendpoolname')]"}], "loadbalancingrules": [{"name": "myhttprule", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('lbname'), variables('lbfrontendname'))]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('lbname'), variables('lbbackendpoolname'))]"}, "frontendport": 80, "backendport": 80, "enablefloatingip": false, "idletimeoutinminutes": 15, "protocol": "tcp", "enabletcpreset": true, "loaddistribution": "default", "disableoutboundsnat": true, "probe": {"id": "[resourceid('microsoft.network/loadbalancers/probes", variables('lbname'), variables('lbprobename'))]"}}}], "probes": [{"name": "[variables('lbprobename')]", "properties": {"protocol": "http", "port": 80, "requestpath": "/", "intervalinseconds": 5, "numberofprobes": 2}}], "outboundrules": [{"name": "myoutboundrule", "properties": {"allocatedoutboundports": 10000, "protocol": "all", "enabletcpreset": false, "idletimeoutinminutes": 15, "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('lbname'), variables('lbbackendpoolname'))]"}, "frontendipconfigurations": [{"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('lbname'), variables('lbfrontendnameoutbound'))]"}]}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('lbpublicipaddressname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('lbskuname')]"}, "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static"}}{"type": "microsoft.network/loadbalancers/backendaddresspools", "apiversion": "2020-05-01", "name": "[concat(variables('lbname'), "/", variables('lbbackendpoolname'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/loadbalancers", variables('lbname'))]"], "properties": {"copy": [{"name": "loadbalancerbackendaddresses", "count": "[length(variables('nicipaddresses'))]", "input": {"name": "[concat('address", copyindex('loadbalancerbackendaddresses'))]", "properties": {"virtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"}, "ipaddress": "[variables('nicipaddresses')[copyindex('loadbalancerbackendaddresses')]]"}}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('lbpublicipaddressnameoutbound')]", "location": "[parameters('location')]", "sku": {"name": "[variables('lbskuname')]"}, "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static"}}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "[variables('nsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allowhttpinbound", "properties": {"protocol": "*", "sourceportrange": "*", "destinationportrange": "80", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('vnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressprefix')]"]}}}
Create an Internet-facing standard load-balancer with three VMs
{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[concat(parameters('projectname'),"-vm", copyindex(1), "-networkinterface')]", "location": "[parameters('location')]", "copy": {"name": "networkinterfacecopy", "count": 3}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('vnetsubnetname'))]", "[resourceid('microsoft.network/loadbalancers", variables('lbname'))]", "[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('vnetsubnetname'))]"}, "loadbalancerbackendaddresspools": [{"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('lbname'), variables('lbbackendpoolname'))]"}, {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('lbname'), variables('lbbackendpoolnameoutbound'))]"}]}}], "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"}}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-06-01", "location": "[parameters('location')]", "name": "[concat(variables('vnetname'), "/" ,variables('bastionsubnetname'))]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"], "properties": {"addressprefix": "[variables('vnetbastionsubnetaddressprefix')]"}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-06-01", "location": "[parameters('location')]", "name": "[concat(variables('vnetname'), "/" ,variables('vnetsubnetname'))]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"], "properties": {"addressprefix": "[variables('vnetsubnetaddressprefix')]"}}{"type": "microsoft.network/bastionhosts", "apiversion": "2020-05-01", "name": "[variables('bastionname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('bastionpublicipaddressname'))]", "[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('bastionsubnetname'))]"], "properties": {"ipconfigurations": [{"name": "ipconf", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('bastionpublicipaddressname'))]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('bastionsubnetname'))]"}}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('bastionpublicipaddressname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('lbskuname')]"}, "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static"}}{"type": "microsoft.network/loadbalancers", "apiversion": "2020-06-01", "name": "[variables('lbname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('lbskuname')]"}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('lbpublicipaddressname'))]", "[resourceid('microsoft.network/publicipaddresses", variables('lbpublicipaddressnameoutbound'))]"], "properties": {"frontendipconfigurations": [{"name": "[variables('lbfrontendname')]", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('lbpublicipaddressname'))]"}}}, {"name": "[variables('lbfrontendnameoutbound')]", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('lbpublicipaddressnameoutbound'))]"}}}], "backendaddresspools": [{"name": "[variables('lbbackendpoolname')]"}, {"name": "[variables('lbbackendpoolnameoutbound')]"}], "loadbalancingrules": [{"name": "myhttprule", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('lbname'), variables('lbfrontendname'))]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('lbname'), variables('lbbackendpoolname'))]"}, "frontendport": 80, "backendport": 80, "enablefloatingip": false, "idletimeoutinminutes": 15, "protocol": "tcp", "enabletcpreset": true, "loaddistribution": "default", "disableoutboundsnat": true, "probe": {"id": "[resourceid('microsoft.network/loadbalancers/probes", variables('lbname'), variables('lbprobename'))]"}}}], "probes": [{"name": "[variables('lbprobename')]", "properties": {"protocol": "http", "port": 80, "requestpath": "/", "intervalinseconds": 5, "numberofprobes": 2}}], "outboundrules": [{"name": "myoutboundrule", "properties": {"allocatedoutboundports": 10000, "protocol": "all", "enabletcpreset": false, "idletimeoutinminutes": 15, "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('lbname'), variables('lbbackendpoolnameoutbound'))]"}, "frontendipconfigurations": [{"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('lbname'), variables('lbfrontendnameoutbound'))]"}]}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('lbpublicipaddressname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('lbskuname')]"}, "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static"}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('lbpublicipaddressnameoutbound')]", "location": "[parameters('location')]", "sku": {"name": "[variables('lbskuname')]"}, "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static"}}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "[variables('nsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allowhttpinbound", "properties": {"protocol": "*", "sourceportrange": "*", "destinationportrange": "80", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('vnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressprefix')]"]}}}
This template creates a WAF geo filtering rule for Azure Front Door that allows/blocks traffic from certain countries.
{"apiversion": "2020-11-01", "type": "microsoft.network/frontdoorwebapplicationfirewallpolicies", "name": "[parameters('wafpolicyname')]", "location": "[variables('waflocation')]", "properties": {"policysettings": {"mode": "[parameters('wafmode')]", "enabledstate": "enabled"}, "customrules": {"rules": [{"name": "rule1", "priority": 1, "ruletype": "matchrule", "matchconditions": [{"matchvariable": "remoteaddr", "operator": "geomatch", "matchvalue": ["[parameters('geomatch')]"]}], "action": "[parameters('geofilteringaction')]"}]}}}
This template creates a private DNS zone within the Azure DNS resource provider. It can optionally enable VM registration which lets newly created VMs add their A record to the zone.
{"type": "microsoft.network/virtualnetworks", "apiversion": "2021-03-01", "name": "[parameters('vnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"type": "microsoft.network/privatednszones", "apiversion": "2020-06-01", "name": "[parameters('privatednszonename')]", "location": "global"}{"type": "microsoft.network/privatednszones/virtualnetworklinks", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('privatednszonename'), format('{0}-link", parameters('vnetname')))]", "location": "global", "properties": {"registrationenabled": "[parameters('vmregistration')]", "virtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks", parameters('vnetname'))]"}}, "dependson": ["[resourceid('microsoft.network/privatednszones", parameters('privatednszonename'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('vnetname'))]"]}
This template creates a Front Door with load balancing configured for multiple backends in a backend pool and also across backend pools based on URL path.
{"apiversion": "2020-05-01", "type": "microsoft.network/frontdoors", "name": "[parameters('frontdoorname')]", "location": "[variables('frontdoorlocation')]", "properties": {"routingrules": [{"name": "routingrule1", "properties": {"frontendendpoints": [{"id": "[resourceid('microsoft.network/frontdoors/frontendendpoints", parameters('frontdoorname'), "frontendendpoint1')]"}], "acceptedprotocols": ["http", "https"], "patternstomatch": ["/*", "/site1/*"], "routeconfiguration": {"@odata.type": "#microsoft.azure.frontdoor.models.frontdoorforwardingconfiguration", "forwardingprotocol": "matchrequest", "backendpool": {"id": "[resourceid('microsoft.network/frontdoors/backendpools", parameters('frontdoorname'), "backendpool1')]"}}, "enabledstate": "enabled"}}, {"name": "routingrule2", "properties": {"frontendendpoints": [{"id": "[resourceid('microsoft.network/frontdoors/frontendendpoints", parameters('frontdoorname'), "frontendendpoint1')]"}], "acceptedprotocols": ["https"], "patternstomatch": ["/site2/*"], "routeconfiguration": {"@odata.type": "#microsoft.azure.frontdoor.models.frontdoorforwardingconfiguration", "forwardingprotocol": "matchrequest", "backendpool": {"id": "[resourceid('microsoft.network/frontdoors/backendpools", parameters('frontdoorname'), "backendpool2')]"}}, "enabledstate": "enabled"}}], "healthprobesettings": [{"name": "healthprobesettings1", "properties": {"path": "/", "protocol": "http", "intervalinseconds": 120}}, {"name": "healthprobesettings2", "properties": {"path": "/", "protocol": "https", "intervalinseconds": 60}}], "loadbalancingsettings": [{"name": "loadbalancingsettings1", "properties": {"samplesize": 4, "successfulsamplesrequired": 2}}, {"name": "loadbalancingsettings2", "properties": {"samplesize": 2, "successfulsamplesrequired": 1}}], "backendpools": [{"name": "[parameters('backendpools1').name]", "properties": {"copy": [{"name": "backends", "count": "[length(parameters('backendpools1').backends)]", "input": {"address": "[parameters('backendpools1').backends[copyindex('backends')].address]", "httpport": "[parameters('backendpools1').backends[copyindex('backends')].httpport]", "httpsport": "[parameters('backendpools1').backends[copyindex('backends')].httpsport]", "weight": "[parameters('backendpools1').backends[copyindex('backends')].weight]", "priority": "[parameters('backendpools1').backends[copyindex('backends')].priority]", "enabledstate": "[parameters('backendpools1').backends[copyindex('backends')].enabledstate]"}}], "loadbalancingsettings": {"id": "[resourceid('microsoft.network/frontdoors/loadbalancingsettings", parameters('frontdoorname'), "loadbalancingsettings1')]"}, "healthprobesettings": {"id": "[resourceid('microsoft.network/frontdoors/healthprobesettings", parameters('frontdoorname'), "healthprobesettings1')]"}}}, {"name": "[parameters('backendpools2').name]", "properties": {"copy": [{"name": "backends", "count": "[length(parameters('backendpools2').backends)]", "input": {"address": "[parameters('backendpools2').backends[copyindex('backends')].address]", "httpport": "[parameters('backendpools2').backends[copyindex('backends')].httpport]", "httpsport": "[parameters('backendpools2').backends[copyindex('backends')].httpsport]", "weight": "[parameters('backendpools2').backends[copyindex('backends')].weight]", "priority": "[parameters('backendpools2').backends[copyindex('backends')].priority]", "enabledstate": "[parameters('backendpools2').backends[copyindex('backends')].enabledstate]"}}], "loadbalancingsettings": {"id": "[resourceid('microsoft.network/frontdoors/loadbalancingsettings", parameters('frontdoorname'), "loadbalancingsettings2')]"}, "healthprobesettings": {"id": "[resourceid('microsoft.network/frontdoors/healthprobesettings", parameters('frontdoorname'), "healthprobesettings2')]"}}}], "frontendendpoints": [{"name": "frontendendpoint1", "properties": {"hostname": "[concat(parameters('frontdoorname'), ".azurefd.net')]", "sessionaffinityenabledstate": "disabled"}}], "enabledstate": "enabled"}}
This template creates a basic Front Door configuration with a single backend, single default path match '/*' and no custom domain.
{"type": "microsoft.network/frontdoors", "apiversion": "2020-05-01", "name": "[parameters('frontdoorname')]", "location": "global", "properties": {"enabledstate": "enabled", "frontendendpoints": [{"name": "[variables('frontendendpointname')]", "properties": {"hostname": "[format('{0}.azurefd.net", parameters('frontdoorname'))]", "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('frontendendpointname'))]"}], "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"}}]}}
Create an Internet-facing load-balancer with a Public IPv6 address
{"apiversion": "2016-03-30", "type": "microsoft.network/publicipaddresses", "name": "[variables('ipv4publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "[variables('ipv4publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforipv4lbip')]"}}}{"apiversion": "2016-03-30", "type": "microsoft.network/publicipaddresses", "name": "[variables('ipv6publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipaddressversion": "ipv6", "publicipallocationmethod": "[variables('ipv6publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforipv6lbip')]"}}}{"comments": "simple network security group for subnet [variables('subnetname')]", "type": "microsoft.network/networksecuritygroups", "apiversion": "2019-08-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {}}{"apiversion": "2016-03-30", "type": "microsoft.network/virtualnetworks", "name": "[variables('vnetname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"], "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}{"apiversion": "2018-01-01", "type": "microsoft.network/networkinterfaces", "name": "[concat(variables('nicnameprefix'), copyindex())]", "location": "[parameters('location')]", "copy": {"name": "nicloop", "count": "[variables('numberofinstances')]"}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]", "[resourceid('microsoft.network/loadbalancers", variables('lbname'))]"], "properties": {"ipconfigurations": [{"name": "ipv4ipconfig", "properties": {"privateipaddressversion": "ipv4", "privateipallocationmethod": "[variables('ipv4privateipaddresstype')]", "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets",variables('vnetname'), variables('subnetname'))]"}, "loadbalancerbackendaddresspools": [{"id": "[variables('ipv4lbbackendpoolid')]"}], "loadbalancerinboundnatrules": [{"id": "[resourceid('microsoft.network/loadbalancers/inboundnatrules",variables('lbname'),concat('rdp-vm", copyindex()))]"}]}}, {"name": "ipv6ipconfig", "properties": {"privateipaddressversion": "ipv6", "privateipallocationmethod": "[variables('ipv6privateipaddresstype')]", "loadbalancerbackendaddresspools": [{"id": "[variables('ipv6lbbackendpoolid')]"}]}}]}}{"apiversion": "2016-03-30", "name": "[variables('lbname')]", "type": "microsoft.network/loadbalancers", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('ipv4publicipaddressname'))]", "[resourceid('microsoft.network/publicipaddresses", variables('ipv6publicipaddressname'))]"], "properties": {"frontendipconfigurations": [{"name": "loadbalancerfrontendipv4", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('ipv4publicipaddressname'))]"}}}, {"name": "loadbalancerfrontendipv6", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('ipv6publicipaddressname'))]"}}}], "backendaddresspools": [{"name": "backendpoolipv4"}, {"name": "backendpoolipv6"}], "inboundnatrules": [{"name": "rdp-vm0", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations",variables('lbname'),"loadbalancerfrontendipv4')]"}, "protocol": "tcp", "frontendport": 50001, "backendport": 3389, "enablefloatingip": false}}, {"name": "rdp-vm1", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations",variables('lbname'),"loadbalancerfrontendipv4')]"}, "protocol": "tcp", "frontendport": 50002, "backendport": 3389, "enablefloatingip": false}}], "loadbalancingrules": [{"name": "lbruleipv4", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations",variables('lbname'),"loadbalancerfrontendipv4')]"}, "backendaddresspool": {"id": "[variables('ipv4lbbackendpoolid')]"}, "protocol": "tcp", "frontendport": 80, "backendport": 80, "enablefloatingip": false, "idletimeoutinminutes": 5, "probe": {"id": "[variables('ipv4ipv6lbprobeid')]"}}}, {"name": "lbruleipv6", "properties": {"frontendipconfiguration": {"id": "[variables('ipv6frontendipconfigid')]"}, "backendaddresspool": {"id": "[variables('ipv6lbbackendpoolid')]"}, "protocol": "tcp", "frontendport": 80, "backendport": 8080, "probe": {"id": "[variables('ipv4ipv6lbprobeid')]"}}}], "probes": [{"name": "[variables('ipv4ipv6lbprobename')]", "properties": {"protocol": "tcp", "port": 80, "intervalinseconds": 5, "numberofprobes": 2}}]}}
Service Chaining with User defined Routes (UDR)
{"apiversion": "2020-08-01", "type": "microsoft.network/publicipaddresses", "name": "[concat(parameters('uniquednsprefixforvm'), copyindex())]", "location": "[parameters('location')]", "copy": {"name": "pubiploop", "count": "[variables('scalenumber')]"}, "properties": {"publicipallocationmethod": "[parameters('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[concat(parameters('uniquednsprefixforvm'), copyindex())]"}}}{"apiversion": "2015-06-15", "type": "microsoft.network/networksecuritygroups", "name": "defaultnsg", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "rdp_rule", "properties": {"description": "allow rdp", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}}{"type": "microsoft.network/routetables", "name": "[variables('routetablename')]", "apiversion": "2015-06-15", "location": "[parameters('location')]", "properties": {"routes": [{"name": "virtualapplianceroutetosubnet3", "properties": {"addressprefix": "[variables('subnet3prefix')]", "nexthoptype": "virtualappliance", "nexthopipaddress": "[variables('nvmprivateipaddress')]"}}]}}{"apiversion": "2015-06-15", "type": "microsoft.network/virtualnetworks", "name": "[variables('vnetname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/routetables/", variables('routetablename'))]", "[resourceid('microsoft.network/networksecuritygroups/", variables('nsgname'))]"], "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressprefix')]"]}, "subnets": [{"name": "[variables('subnet1name')]", "properties": {"addressprefix": "[variables('subnet1prefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"}, "routetable": {"id": "[resourceid('microsoft.network/routetables", variables('routetablename'))]"}}}, {"name": "[variables('subnet2name')]", "properties": {"addressprefix": "[variables('subnet2prefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"}}}, {"name": "[variables('subnet3name')]", "properties": {"addressprefix": "[variables('subnet3prefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('nsgname'))]"}}}]}}{"apiversion": "2015-06-15", "type": "microsoft.network/networkinterfaces", "name": "nic0", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", variables('vnetname'))]", "[resourceid('microsoft.network/publicipaddresses/", concat(parameters('uniquednsprefixforvm'), "0'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", concat(parameters('uniquednsprefixforvm'), "0'))]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('subnet1name'))]"}}}]}}{"apiversion": "2015-06-15", "type": "microsoft.network/networkinterfaces", "name": "nic1", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", concat(parameters('uniquednsprefixforvm'), "1'))]", "[resourceid('microsoft.network/virtualnetworks/", variables('vnetname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "static", "privateipaddress": "[variables('nvmprivateipaddress')]", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", concat(parameters('uniquednsprefixforvm'), "1'))]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('subnet2name'))]"}}}], "enableipforwarding": true}}{"apiversion": "2015-06-15", "type": "microsoft.network/networkinterfaces", "name": "nic2", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", concat(parameters('uniquednsprefixforvm'), "2'))]", "[resourceid('microsoft.network/virtualnetworks/", variables('vnetname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", concat(parameters('uniquednsprefixforvm'), "2'))]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('subnet3name'))]"}}}]}}
This template creates an Azure Traffic Manager profile that load-balances across multiple virtual machines.
{"copy": {"name": "pip", "count": "[length(range(0, variables('numvms')))]"}, "type": "microsoft.network/publicipaddresses", "apiversion": "2021-03-01", "name": "[format('{0}{1}-pip", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "location": "[parameters('location')]", "sku": {"name": "basic"}, "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "publicipaddressversion": "ipv4", "dnssettings": {"domainnamelabel": "[format('{0}{1}", parameters('uniquednsnameforpublicip'), range(0, variables('numvms'))[copyindex()])]"}}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2021-03-01", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]"}}]}}{"copy": {"name": "nic", "count": "[length(range(0, variables('numvms')))]"}, "type": "microsoft.network/networkinterfaces", "apiversion": "2021-03-01", "name": "[format('{0}{1}-nic", variables('vmname'), range(0, variables('numvms'))[copyindex()])]", "location": "[parameters('location')]", "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", format('{0}{1}-pip", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex()]]))]"}, "subnet": {"id": "[reference(resourceid('microsoft.network/virtualnetworks", variables('virtualnetworkname'))).subnets[0].id]"}}}], "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}, "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]", "[resourceid('microsoft.network/publicipaddresses", format('{0}{1}-pip", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex()]]))]", "[resourceid('microsoft.network/virtualnetworks", variables('virtualnetworkname'))]"]}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2021-03-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allow-http", "properties": {"protocol": "*", "sourceportrange": "*", "destinationportrange": "80", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}}{"type": "microsoft.network/trafficmanagerprofiles", "apiversion": "2018-08-01", "name": "[variables('traficmanagerprofilename')]", "location": "global", "properties": {"copy": [{"name": "endpoints", "count": "[length(range(0, variables('numvms')))]", "input": {"name": "[format('endpoint{0}", range(0, variables('numvms'))[copyindex('endpoints')])]", "type": "microsoft.network/trafficmanagerprofiles/azureendpoints", "properties": {"targetresourceid": "[resourceid('microsoft.network/publicipaddresses", format('{0}{1}-pip", variables('vmname'), range(0, variables('numvms'))[range(0, variables('numvms'))[copyindex('endpoints')]]))]", "endpointstatus": "enabled", "weight": 1}}}], "profilestatus": "enabled", "trafficroutingmethod": "weighted", "dnsconfig": {"relativename": "[parameters('uniquednsname')]", "ttl": 30}, "monitorconfig": {"protocol": "http", "port": 80, "path": "/"}}, "dependson": ["pip"]}
This template deploys a Custom IPSec Policy to an existing VPN Gateway.
{"type": "microsoft.network/connections", "apiversion": "2020-04-01", "name": "[parameters('vpnname')]", "location": "[parameters('location')]", "properties": {"virtualnetworkgateway1": {"id": "[resourceid('microsoft.network/virtualnetworkgateways", parameters('vpngateway_name'))]"}, "localnetworkgateway2": {"id": "[resourceid('microsoft.network/localnetworkgateways", parameters('localgateway_name'))]"}, "connectiontype": "ipsec", "connectionprotocol": "[parameters('vpnprotocol')]", "sharedkey": "[parameters('sharedkey')]", "usepolicybasedtrafficselectors": "[parameters('policybasedtrafficselectors')]", "ipsecpolicies": [{"salifetimeseconds": "[parameters('salifetimeseconds')]", "sadatasizekilobytes": "[parameters('sadatasizekilobytes')]", "ipsecencryption": "[parameters('ipsecencryption')]", "ipsecintegrity": "[parameters('ipsecintegrity')]", "ikeencryption": "[parameters('ikeencryption')]", "ikeintegrity": "[parameters('ikeintegrity')]", "dhgroup": "[parameters('dhgroup')]", "pfsgroup": "[parameters('pfsgroup')]"}]}}
This template creates a Network Watcher resource for the subscription.
{"type": "microsoft.network/networkwatchers", "apiversion": "2021-02-01", "name": "[parameters('networkwatchername')]", "location": "[parameters('location')]", "properties": {}}
Create an Azure Firewall with Firewall Policy and IpGroups
{"type": "microsoft.network/ipgroups", "apiversion": "2019-12-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": "2019-12-01", "name": "[parameters('ipgroups_name2')]", "location": "[parameters('location')]", "properties": {"ipaddresses": ["12.0.0.0/24", "13.9.0.0/24"]}}{"type": "microsoft.network/routetables", "name": "[variables('azfwroutetablename')]", "apiversion": "2019-12-01", "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": "2019-08-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {}}{"name": "[parameters('virtualnetworkname')]", "apiversion": "2019-12-01", "type": "microsoft.network/virtualnetworks", "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'))]"}}}]}}{"name": "[concat(variables('publicipnameprefix'), add(copyindex(), 1))]", "type": "microsoft.network/publicipaddresses", "apiversion": "2019-12-01", "location": "[parameters('location')]", "sku": {"name": "standard"}, "copy": {"name": "publicipcopy", "count": "[parameters('numberoffirewallpublicipaddresses')]"}, "properties": {"publicipallocationmethod": "static", "publicipaddressversion": "ipv4"}}{"name": "[variables('jumpboxpublicipaddressname')]", "type": "microsoft.network/publicipaddresses", "apiversion": "2019-12-01", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"name": "[variables('jumpboxnsgname')]", "type": "microsoft.network/networksecuritygroups", "apiversion": "2019-12-01", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "mynetworksecuritygrouprulessh", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1000, "direction": "inbound"}}]}}{"apiversion": "2019-12-01", "type": "microsoft.network/networkinterfaces", "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'))]"}}}{"apiversion": "2019-12-01", "type": "microsoft.network/networkinterfaces", "name": "[variables('servernicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('serversubnetid')]"}}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/firewallpolicies", "name": "[parameters('firewallpolicyname')]", "location": "[parameters('location')]", "properties": {"threatintelmode": "alert"}, "resources": [{"apiversion": "2020-05-01", "type": "rulecollectiongroups", "name": "rulecollectiongroup1", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name1'))]", "[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name2'))]", "[resourceid('microsoft.network/firewallpolicies",parameters('firewallpolicyname'))]"], "properties": {"priority": 100, "rulecollections": [{"rulecollectiontype": "firewallpolicyfilterrulecollection", "name": "example-filter-rule", "action": {"type": "deny"}, "priority": 1000, "rules": [{"ruletype": "networkrule", "name": "network-rule1", "ipprotocols": ["tcp"], "destinationports": ["*"], "sourceipgroups": ["[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name1'))]"], "destinationipgroups": ["[resourceid('microsoft.network/ipgroups", parameters('ipgroups_name2'))]"]}]}]}}]}{"apiversion": "2019-09-01", "type": "microsoft.network/azurefirewalls", "name": "[variables('firewallname')]", "location": "[parameters('location')]", "zones": "[if(equals(length(parameters('availabilityzones')), 0), json('null'), parameters('availabilityzones'))]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "[resourceid('microsoft.network/firewallpolicies", parameters('firewallpolicyname'))]", "publicipcopy"], "properties": {"ipconfigurations": "[variables('azurefirewallipconfigurations')]", "firewallpolicy": {"id": "[resourceid('microsoft.network/firewallpolicies", parameters('firewallpolicyname'))]"}}}
Create an Application Gateway v2
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('appgwpublicipname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipallocationmethod": "static"}}{"type": "microsoft.network/applicationgateways", "apiversion": "2020-06-01", "name": "[parameters('applicationgatewayname')]", "location": "[parameters('location')]", "properties": {"sku": {"name": "[variables('appgwsize')]", "tier": "standard_v2"}, "autoscaleconfiguration": {"mincapacity": "[parameters('mincapacity')]", "maxcapacity": "[parameters('maxcapacity')]"}, "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('appgwpublicipname'))]"}}}], "frontendports": [{"name": "appgatewayfrontendport", "properties": {"port": "[parameters('frontendport')]"}}], "backendaddresspools": [{"name": "appgatewaybackendpool", "properties": {"backendaddresses": "[parameters('backendipaddresses')]"}}], "backendhttpsettingscollection": [{"name": "appgatewaybackendhttpsettings", "properties": {"port": "[parameters('backendport')]", "protocol": "http", "cookiebasedaffinity": "[parameters('cookiebasedaffinity')]"}}], "httplisteners": [{"name": "appgatewayhttplistener", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations", parameters('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports", parameters('applicationgatewayname'), "appgatewayfrontendport')]"}, "protocol": "http"}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners", parameters('applicationgatewayname'), "appgatewayhttplistener')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools", parameters('applicationgatewayname'), "appgatewaybackendpool')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection", parameters('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}]}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('appgwpublicipname'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]"]}
This template creates a DNS zone within the Azure DNS resource provider. It then creates a RecordSet containing two DNS A records within that zone.
{"type": "microsoft.network/dnszones", "apiversion": "2018-05-01", "name": "[parameters('newzonename')]", "location": "global"}{"type": "microsoft.network/dnszones/a", "apiversion": "2018-05-01", "name": "[concat(parameters('newzonename'), "/", parameters('newrecordname'))]", "location": "global", "dependson": ["[parameters('newzonename')]"], "properties": {"ttl": 3600, "arecords": [{"ipv4address": "1.2.3.4"}, {"ipv4address": "1.2.3.5"}]}}
Create an Azure Firewall with multiple public IP addresses
{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "[concat(variables('nsg_name'), copyindex(1))]", "location": "[parameters('location')]", "copy": {"name": "nsg-loop", "count": 2}, "properties": {"securityrules": [{"name": "rdp", "properties": {"protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 300, "direction": "inbound"}}]}}{"apiversion": "2020-06-01", "type": "microsoft.network/publicipprefixes", "name": "[variables('ipprefix_name')]", "location": "[parameters('location')]", "properties": {"prefixlength": "[variables('ipprefix_size')]", "publicipaddressversion": "ipv4"}, "sku": {"name": "standard", "tier": "regional"}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[concat(variables('publicipaddress'), copyindex(1))]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "copy": {"name": "publicip-loop", "count": 2}, "dependson": ["[resourceid('microsoft.network/publicipprefixes", variables('ipprefix_name'))]"], "properties": {"publicipaddressversion": "ipv4", "publicipallocationmethod": "static", "publicipprefix": {"id": "[resourceid('microsoft.network/publicipprefixes",variables('ipprefix_name'))]"}, "idletimeoutinminutes": 4}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('virtualnetworks_myvnet_name')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/routetables", "rt-01')]"], "properties": {"addressspace": {"addressprefixes": ["[variables('vnet_prefix')]"]}, "subnets": [{"name": "mybackendsubnet", "properties": {"addressprefix": "[variables('backend_subnet_prefix')]", "routetable": {"id": "[resourceid('microsoft.network/routetables", "rt-01')]"}, "privateendpointnetworkpolicies": "enabled", "privatelinkservicenetworkpolicies": "enabled"}}], "enableddosprotection": false, "enablevmprotection": false}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-06-01", "name": "[concat(variables('virtualnetworks_myvnet_name'), "/azurefirewallsubnet')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('virtualnetworks_myvnet_name'))]"], "properties": {"addressprefix": "[variables('fw_subnet_prefix')]", "privateendpointnetworkpolicies": "enabled", "privatelinkservicenetworkpolicies": "enabled"}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-06-01", "name": "[concat(variables('net_interface'), copyindex(1))]", "location": "[parameters('location')]", "copy": {"name": "int-loop", "count": 2}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('virtualnetworks_myvnet_name'))]", "[resourceid('microsoft.network/networksecuritygroups", concat(variables('nsg_name'), copyindex(1)))]"], "properties": {"ipconfigurations": [{"name": "[concat(variables('ipconfig_name'), copyindex(1))]", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('virtualnetworks_myvnet_name'), "mybackendsubnet')]"}, "primary": true}}], "enableacceleratednetworking": false, "enableipforwarding": false, "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", concat(variables('nsg_name'), copyindex(1)))]"}}}{"type": "microsoft.network/azurefirewalls", "apiversion": "2020-06-01", "name": "[variables('firewall_name')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", concat(variables('publicipaddress'), 1))]", "[resourceid('microsoft.network/publicipaddresses", concat(variables('publicipaddress'), 2))]", "[resourceid('microsoft.network/virtualnetworks/subnets", variables('virtualnetworks_myvnet_name'), "azurefirewallsubnet')]"], "properties": {"sku": {"name": "azfw_vnet", "tier": "standard"}, "threatintelmode": "alert", "ipconfigurations": "[variables('azurefirewallipconfigurations')]", "applicationrulecollections": [{"name": "web", "properties": {"priority": 100, "action": {"type": "allow"}, "rules": [{"name": "wan-address", "protocols": [{"protocoltype": "http", "port": 80}, {"protocoltype": "https", "port": 443}], "targetfqdns": ["getmywanip.com"], "sourceaddresses": ["*"]}, {"name": "google", "protocols": [{"protocoltype": "http", "port": 80}, {"protocoltype": "https", "port": 443}], "targetfqdns": ["www.google.com"], "sourceaddresses": ["10.0.1.0/24"]}, {"name": "wupdate", "protocols": [{"protocoltype": "http", "port": 80}, {"protocoltype": "https", "port": 443}], "fqdntags": ["windowsupdate"], "sourceaddresses": ["*"]}]}}], "natrulecollections": [{"name": "coll-01", "properties": {"priority": 100, "action": {"type": "dnat"}, "rules": [{"name": "rdp-01", "protocols": ["tcp"], "translatedaddress": "10.0.1.4", "translatedport": "3389", "sourceaddresses": ["*"], "destinationaddresses": ["[reference(resourceid('microsoft.network/publicipaddresses/", concat(variables('publicipaddress'), 1))).ipaddress]"], "destinationports": ["3389"]}, {"name": "rdp-02", "protocols": ["tcp"], "translatedaddress": "10.0.1.5", "translatedport": "3389", "sourceaddresses": ["*"], "destinationaddresses": ["[reference(resourceid('microsoft.network/publicipaddresses/", concat(variables('publicipaddress'), 2))).ipaddress]"], "destinationports": ["3389"]}]}}]}}{"type": "microsoft.network/routetables", "apiversion": "2020-06-01", "name": "rt-01", "location": "[parameters('location')]", "properties": {"disablebgproutepropagation": false, "routes": [{"name": "fw", "properties": {"addressprefix": "0.0.0.0/0", "nexthoptype": "virtualappliance", "nexthopipaddress": "10.0.0.4"}}]}}
This template configures WAF custom rules based on specific http parameters for Azure Front Door endpoint.
{"apiversion": "2019-03-01", "type": "microsoft.network/frontdoorwebapplicationfirewallpolicies", "name": "[parameters('wafpolicyname')]", "location": "[variables('waflocation')]", "properties": {"policysettings": {"mode": "[parameters('wafmode')]", "enabledstate": "enabled"}, "customrules": {"rules": [{"name": "[parameters('httprule1').name]", "priority": "[parameters('httprule1').priority]", "enabledstate": "[parameters('httprule1').enabledstate]", "ruletype": "[parameters('httprule1').ruletype]", "copy": [{"name": "matchconditions", "count": "[length(parameters('httprule1').matchconditions)]", "input": {"matchvariable": "[parameters('httprule1').matchconditions[copyindex('matchconditions')].matchvariable]", "operator": "[parameters('httprule1').matchconditions[copyindex('matchconditions')].operator]", "selector": "[parameters('httprule1').matchconditions[copyindex('matchconditions')].selector]", "matchvalue": "[parameters('httprule1').matchconditions[copyindex('matchconditions')].matchvalue]"}}], "action": "[parameters('httprule1').action]"}, {"name": "[parameters('httprule2').name]", "priority": "[parameters('httprule2').priority]", "enabledstate": "[parameters('httprule2').enabledstate]", "ruletype": "[parameters('httprule2').ruletype]", "copy": [{"name": "matchconditions", "count": "[length(parameters('httprule2').matchconditions)]", "input": {"matchvariable": "[parameters('httprule2').matchconditions[copyindex('matchconditions')].matchvariable]", "operator": "[parameters('httprule2').matchconditions[copyindex('matchconditions')].operator]", "selector": "[parameters('httprule2').matchconditions[copyindex('matchconditions')].selector]", "matchvalue": "[parameters('httprule2').matchconditions[copyindex('matchconditions')].matchvalue]"}}], "action": "[parameters('httprule2').action]"}]}}}
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-11-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')]"}}{"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-22", "properties": {"priority": 1000, "access": "allow", "direction": "inbound", "destinationportrange": "22", "protocol": "tcp", "sourceaddressprefix": "*", "sourceportrange": "*", "destinationaddressprefix": "*"}}]}}{"apiversion": "2020-11-01", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"], "properties": {"addressspace": {"addressprefixes": ["[parameters('azurevnetaddressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}, {"name": "gatewaysubnet", "properties": {"addressprefix": "[parameters('gatewaysubnetprefix')]"}}]}}{"apiversion": "2020-11-01", "type": "microsoft.network/publicipaddresses", "name": "[parameters('gatewaypublicipname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2020-11-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('vmpublicipname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2020-11-01", "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"}}{"apiversion": "2020-08-01", "type": "microsoft.network/networkinterfaces", "name": "[variables('nicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('vmpublicipname'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "[resourceid('microsoft.network/virtualnetworkgateways", parameters('gatewayname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('vmpublicipname'))]"}, "subnet": {"id": "[variables('subnetref')]"}}}]}}
Create a Point-to-Site Gateway
{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "subnets": [{"name": "gatewaysubnet", "properties": {"addressprefix": "[parameters('gatewaysubnetprefix')]"}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "[parameters('gatewaypublicipname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2020-05-01", "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": "routebased", "enablebgp": false, "vpnclientconfiguration": {"vpnclientaddresspool": {"addressprefixes": ["[parameters('vpnclientaddresspoolprefix')]"]}, "vpnclientrootcertificates": [{"name": "[parameters('clientrootcertname')]", "properties": {"publiccertdata": "[parameters('clientrootcertdata')]"}}], "vpnclientrevokedcertificates": [{"name": "[parameters('revokedcertname')]", "properties": {"thumbprint": "[parameters('revokedcertthumbprint')]"}}]}}}
This template provisions Azure Bastion and dependent resources in a Virtual Network.
{"apiversion": "2020-07-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('public-ip-address-name')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipallocationmethod": "static"}}{"apiversion": "2020-07-01", "type": "microsoft.network/networksecuritygroups", "name": "[variables('nsg-name')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allowhttpsinbound", "properties": {"protocol": "tcp", "sourceportrange": "*", "sourceaddressprefix": "internet", "destinationportrange": "443", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}, {"name": "allowgatewaymanagerinbound", "properties": {"protocol": "tcp", "sourceportrange": "*", "sourceaddressprefix": "gatewaymanager", "destinationportrange": "443", "destinationaddressprefix": "*", "access": "allow", "priority": 110, "direction": "inbound"}}, {"name": "allowloadbalancerinbound", "properties": {"protocol": "tcp", "sourceportrange": "*", "sourceaddressprefix": "azureloadbalancer", "destinationportrange": "443", "destinationaddressprefix": "*", "access": "allow", "priority": 120, "direction": "inbound"}}, {"name": "allowbastionhostcommunicationinbound", "properties": {"protocol": "*", "sourceportrange": "*", "sourceaddressprefix": "virtualnetwork", "destinationportranges": ["8080", "5701"], "destinationaddressprefix": "virtualnetwork", "access": "allow", "priority": 130, "direction": "inbound"}}, {"name": "denyallinbound", "properties": {"protocol": "*", "sourceportrange": "*", "sourceaddressprefix": "*", "destinationportrange": "*", "destinationaddressprefix": "*", "access": "deny", "priority": 1000, "direction": "inbound"}}, {"name": "allowsshrdpoutbound", "properties": {"protocol": "tcp", "sourceportrange": "*", "sourceaddressprefix": "*", "destinationportranges": ["22", "3389"], "destinationaddressprefix": "virtualnetwork", "access": "allow", "priority": 100, "direction": "outbound"}}, {"name": "allowazurecloudcommunicationoutbound", "properties": {"protocol": "tcp", "sourceportrange": "*", "sourceaddressprefix": "*", "destinationportrange": "443", "destinationaddressprefix": "azurecloud", "access": "allow", "priority": 110, "direction": "outbound"}}, {"name": "allowbastionhostcommunicationoutbound", "properties": {"protocol": "*", "sourceportrange": "*", "sourceaddressprefix": "virtualnetwork", "destinationportranges": ["8080", "5701"], "destinationaddressprefix": "virtualnetwork", "access": "allow", "priority": 120, "direction": "outbound"}}, {"name": "allowgetsessioninformationoutbound", "properties": {"protocol": "*", "sourceportrange": "*", "sourceaddressprefix": "*", "destinationaddressprefix": "internet", "destinationportranges": ["80", "443"], "access": "allow", "priority": 130, "direction": "outbound"}}, {"name": "denyalloutbound", "properties": {"protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "deny", "priority": 1000, "direction": "outbound"}}]}}{"condition": "[equals(parameters('vnet-new-or-existing'), "new')]", "apiversion": "2020-07-01", "name": "[parameters('vnet-name')]", "type": "microsoft.network/virtualnetworks", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('nsg-name'))]"], "properties": {"addressspace": {"addressprefixes": ["[parameters('vnet-ip-prefix')]"]}, "subnets": [{"name": "[variables('bastion-subnet-name')]", "properties": {"addressprefix": "[parameters('bastion-subnet-ip-prefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('nsg-name'))]"}}}]}}{"condition": "[equals(parameters('vnet-new-or-existing'), "existing')]", "apiversion": "2020-07-01", "type": "microsoft.network/virtualnetworks/subnets", "name": "[concat(parameters('vnet-name'), "/", variables('bastion-subnet-name'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('nsg-name'))]"], "properties": {"addressprefix": "[parameters('bastion-subnet-ip-prefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('nsg-name'))]"}}}{"apiversion": "2020-07-01", "type": "microsoft.network/bastionhosts", "name": "[parameters('bastion-host-name')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('public-ip-address-name'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('vnet-name'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('vnet-name'), variables('bastion-subnet-name'))]"], "properties": {"ipconfigurations": [{"name": "ipconf", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('vnet-name'), variables('bastion-subnet-name'))]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('public-ip-address-name'))]"}}}]}}
Creates Virtual WAN resources
{"type": "microsoft.network/virtualwans", "apiversion": "2021-03-01", "name": "[parameters('vwanname')]", "location": "[parameters('location')]", "properties": {"type": "[parameters('vwansku')]"}}{"type": "microsoft.network/virtualhubs", "apiversion": "2021-03-01", "name": "[parameters('hubname')]", "location": "[parameters('location')]", "properties": {"addressprefix": "[parameters('hubaddressprefix')]", "virtualwan": {"id": "[resourceid('microsoft.network/virtualwans", parameters('vwanname'))]"}}, "dependson": ["[resourceid('microsoft.network/virtualwans", parameters('vwanname'))]"]}{"type": "microsoft.network/vpnsites", "apiversion": "2021-03-01", "name": "[parameters('vpnsitename')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": "[parameters('vpnsiteaddressspacelist')]"}, "bgpproperties": "[if(parameters('enablebgp'), createobject('asn", parameters('vpnsitebgpasn'), "bgppeeringaddress", parameters('vpnsitebgppeeringaddress'), "peerweight", 0), null())]", "deviceproperties": {"linkspeedinmbps": 10}, "ipaddress": "[parameters('vpnsitepublicipaddress')]", "virtualwan": {"id": "[resourceid('microsoft.network/virtualwans", parameters('vwanname'))]"}}, "dependson": ["[resourceid('microsoft.network/virtualwans", parameters('vwanname'))]"]}{"type": "microsoft.network/vpngateways", "apiversion": "2021-03-01", "name": "[parameters('vpngatewayname')]", "location": "[parameters('location')]", "properties": {"connections": [{"name": "[parameters('connectionname')]", "properties": {"connectionbandwidth": 10, "enablebgp": "[parameters('enablebgp')]", "remotevpnsite": {"id": "[resourceid('microsoft.network/vpnsites", parameters('vpnsitename'))]"}}}], "virtualhub": {"id": "[resourceid('microsoft.network/virtualhubs", parameters('hubname'))]"}, "bgpsettings": {"asn": 65515}}, "dependson": ["[resourceid('microsoft.network/virtualhubs", parameters('hubname'))]", "[resourceid('microsoft.network/vpnsites", parameters('vpnsitename'))]"]}
This template deploys a Route Server into a subnet named RouteServerSubnet.
{"condition": "[equals(parameters('vnetnew_or_existing'), "new')]", "type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "name": "[parameters('vnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetipprefix')]"]}}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-05-01", "name": "[format('{0}/{1}", parameters('vnetname'), variables('routeserversubnetname'))]", "properties": {"addressprefix": "[parameters('routeserversubnetipprefix')]"}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('vnetname'))]"]}{"condition": "[equals(parameters('publicipnew_or_existing'), "new')]", "type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-01", "name": "[parameters('publicipname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipallocationmethod": "static", "publicipaddressversion": "ipv4", "idletimeoutinminutes": 4}}{"type": "microsoft.network/virtualhubs", "apiversion": "2020-06-01", "name": "[parameters('firstrouteservername')]", "location": "[parameters('location')]", "properties": {"sku": "standard"}}{"type": "microsoft.network/virtualhubs/ipconfigurations", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('firstrouteservername'), variables('ipconfigname'))]", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('vnetname'), variables('routeserversubnetname'))]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", parameters('publicipname'))]"}}, "dependson": ["[resourceid('microsoft.network/virtualhubs", parameters('firstrouteservername'))]", "[resourceid('microsoft.network/publicipaddresses", parameters('publicipname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('vnetname'), variables('routeserversubnetname'))]"]}{"type": "microsoft.network/virtualhubs/bgpconnections", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('firstrouteservername'), parameters('routeserverbgpconnectionname'))]", "properties": {"peerasn": "[parameters('peerasn')]", "peerip": "[parameters('peerip')]"}, "dependson": ["[resourceid('microsoft.network/virtualhubs", parameters('firstrouteservername'))]", "[resourceid('microsoft.network/virtualhubs/ipconfigurations", parameters('firstrouteservername'), variables('ipconfigname'))]"]}
Create an Application Gateway with path override
{"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('backend1')]"}]}}], "backendhttpsettingscollection": [{"name": "appgatewaybackendhttpsettings", "properties": {"port": 80, "protocol": "http", "cookiebasedaffinity": "disabled", "path": "[parameters('backendpath')]"}}], "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"}}], "urlpathmaps": [{"name": "urlpathmap1", "properties": {"defaultbackendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",variables('applicationgatewayname'), "appgatewaybackendpool')]"}, "defaultbackendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}, "pathrules": [{"name": "pathrule1", "properties": {"paths": ["[parameters('pathmatch1')]"], "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",variables('applicationgatewayname'), "appgatewaybackendpool')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}]}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "pathbasedrouting", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners",variables('applicationgatewayname'), "appgatewayhttplistener')]"}, "urlpathmap": {"id": "[resourceid('microsoft.network/applicationgateways/urlpathmaps",variables('applicationgatewayname'), "urlpathmap1')]"}}}]}}
Extend existing VNET to Multi-VNET
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-11-01", "name": "[variables('vnetname')]", "location": "[parameters('vnetlocation')]", "properties": {"addressspace": {"addressprefixes": ["10.0.0.0/16"]}, "subnets": [{"name": "[concat(variables('vnetname'),"-subnet')]", "properties": {"addressprefix": "10.0.0.0/24", "privateendpointnetworkpolicies": "enabled", "privatelinkservicenetworkpolicies": "enabled"}}, {"name": "[parameters('gatewaysubnetname')]", "properties": {"addressprefix": "10.0.1.0/24", "privateendpointnetworkpolicies": "enabled", "privatelinkservicenetworkpolicies": "enabled"}}], "enableddosprotection": false}}{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-11-01", "name": "[variables('pipname')]", "location": "[parameters('vnetlocation')]", "properties": {"publicipallocationmethod": "dynamic"}}{"type": "microsoft.network/virtualnetworkgateways", "apiversion": "2020-11-01", "name": "[variables('gatewayname')]", "location": "[parameters('vnetlocation')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"], "properties": {"enableprivateipaddress": false, "ipconfigurations": [{"name": "default", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses/", variables('pipname'))]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), parameters('gatewaysubnetname'))]"}}}], "gatewaytype": "vpn", "vpntype": "routebased", "vpngatewaygeneration": "generation1"}}{"type": "microsoft.network/connections", "apiversion": "2020-11-01", "name": "connection", "location": "[parameters('existingvnetlocation')]", "dependson": ["[resourceid('microsoft.network/virtualnetworkgateways", variables('gatewayname'))]"], "properties": {"virtualnetworkgateway1": {"id": "[parameters('existinggatewayid')]"}, "virtualnetworkgateway2": {"id": "[resourceid('microsoft.network/virtualnetworkgateways", variables('gatewayname'))]"}, "connectiontype": "vnet2vnet", "connectionprotocol": "ikev2", "routingweight": 0, "sharedkey": "[parameters('sharedkey')]", "enablebgp": false, "uselocalazureipaddress": false, "usepolicybasedtrafficselectors": false, "expressroutegatewaybypass": false, "dpdtimeoutseconds": 45, "connectionmode": "default"}}
Create a Point-to-Site Gateway with AAD
{"type": "microsoft.network/virtualnetworks", "apiversion": "2021-02-01", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('virtualnetworkprefix')]"]}, "subnets": [{"name": "[parameters('frontendsubname')]", "properties": {"addressprefix": "[parameters('frontendsubprefix')]"}}, {"name": "gatewaysubnet", "properties": {"addressprefix": "[parameters('gatewaysubprefix')]"}}]}}{"type": "microsoft.network/virtualnetworkgateways", "apiversion": "2021-02-01", "name": "[parameters('gatewayname')]", "location": "[parameters('location')]", "properties": {"ipconfigurations": [{"properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('gatewaysubnetref')]"}, "publicipaddress": {"id": "[variables('publicipaddressref')]"}}, "name": "vnetgatewayconfig"}], "sku": {"name": "[parameters('gatewaysku')]", "tier": "[parameters('gatewaysku')]"}, "gatewaytype": "vpn", "vpntype": "[parameters('vpntype')]", "vpnclientconfiguration": {"vpnclientaddresspool": {"addressprefixes": ["[parameters('vpnclientaddresspool')]"]}, "vpnclientprotocols": ["openvpn"], "vpnauthenticationtypes": ["aad"], "aadtenant": "[variables('tenant')]", "aadaudience": "[variables('audience')]", "aadissuer": "[variables('issuer')]"}}, "dependson": ["[resourceid('microsoft.network/publicipaddresses", parameters('gatewaypublicipname'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]"]}{"type": "microsoft.network/publicipaddresses", "apiversion": "2021-02-01", "name": "[parameters('gatewaypublicipname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}
Network Security Group with diagnostic logs
{"type": "microsoft.network/networksecuritygroups", "apiversion": "2021-02-01", "name": "[parameters('nsgname')]", "location": "[parameters('location')]", "properties": {"copy": [{"name": "securityrules", "count": "[length(parameters('securityrules'))]", "input": {"name": "[parameters('securityrules')[copyindex('securityrules')].name]", "properties": "[parameters('securityrules')[copyindex('securityrules')].properties]"}}]}}
Create an Azure Firewall with Firewall Policy (including multiple application and network rules) and IpGroups
{"type": "microsoft.network/ipgroups", "apiversion": "2019-12-01", "name": "[parameters('workloadipgroup')]", "location": "[parameters('location')]", "properties": {"ipaddresses": ["10.20.0.0/24", "10.30.0.0/24"]}}{"type": "microsoft.network/ipgroups", "apiversion": "2019-12-01", "name": "[parameters('infraipgroup')]", "location": "[parameters('location')]", "properties": {"ipaddresses": ["10.40.0.0/24", "10.50.0.0/24"]}}{"name": "[parameters('virtualnetworkname')]", "apiversion": "2019-04-01", "type": "microsoft.network/virtualnetworks", "location": "[parameters('location')]", "tags": {"displayname": "[parameters('virtualnetworkname')]"}, "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressprefix')]"]}, "subnets": [{"name": "[variables('azurefirewallsubnetname')]", "properties": {"addressprefix": "[variables('azurefirewallsubnetprefix')]"}}], "enableddosprotection": false}}{"name": "[concat(variables('azurepublicipname'), add(copyindex(), 1))]", "type": "microsoft.network/publicipaddresses", "apiversion": "2019-04-01", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipallocationmethod": "static", "publicipaddressversion": "ipv4"}, "copy": {"name": "publicipcopy", "count": "[parameters('numberofpublicipaddresses')]"}}{"apiversion": "2020-05-01", "type": "microsoft.network/firewallpolicies", "name": "[parameters('firewallpolicyname')]", "location": "[parameters('location')]", "properties": {"threatintelmode": "alert"}}{"type": "microsoft.network/firewallpolicies/rulecollectiongroups", "apiversion": "2020-05-01", "name": "[concat(parameters('firewallpolicyname'), "/defaultnetworkrulecollectiongroup')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/ipgroups", parameters('workloadipgroup'))]", "[resourceid('microsoft.network/ipgroups", parameters('infraipgroup'))]", "[resourceid('microsoft.network/firewallpolicies",parameters('firewallpolicyname'))]"], "properties": {"priority": 200, "rulecollections": [{"rulecollectiontype": "firewallpolicyfilterrulecollection", "action": {"type": "allow"}, "name": "azure-global-services-nrc", "priority": 1250, "rules": [{"ruletype": "networkrule", "name": "time-windows", "ipprotocols": ["udp"], "destinationaddresses": ["13.86.101.172"], "sourceipgroups": ["[resourceid('microsoft.network/ipgroups", parameters('workloadipgroup'))]", "[resourceid('microsoft.network/ipgroups", parameters('infraipgroup'))]"], "destinationports": ["123"]}]}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/firewallpolicies/rulecollectiongroups", "name": "[concat(parameters('firewallpolicyname'), "/defaultapplicationrulecollectiongroup')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/ipgroups", parameters('workloadipgroup'))]", "[resourceid('microsoft.network/ipgroups", parameters('infraipgroup'))]", "[resourceid('microsoft.network/firewallpolicies/rulecollectiongroups",parameters('firewallpolicyname'), "defaultnetworkrulecollectiongroup')]"], "properties": {"priority": 300, "rulecollections": [{"rulecollectiontype": "firewallpolicyfilterrulecollection", "name": "global-rule-url-arc", "priority": 1000, "action": {"type": "allow"}, "rules": [{"ruletype": "applicationrule", "name": "winupdate-rule-01", "protocols": [{"protocoltype": "https", "port": 443}, {"protocoltype": "http", "port": 80}], "fqdntags": ["windowsupdate"], "terminatetls": false, "sourceipgroups": ["[resourceid('microsoft.network/ipgroups",parameters('workloadipgroup'))]", "[resourceid('microsoft.network/ipgroups", parameters('infraipgroup'))]"]}]}, {"rulecollectiontype": "firewallpolicyfilterrulecollection", "action": {"type": "allow"}, "name": "global-rules-arc", "priority": 1202, "rules": [{"ruletype": "applicationrule", "name": "global-rule-01", "protocols": [{"protocoltype": "https", "port": 443}], "targetfqdns": ["www.microsoft.com"], "terminatetls": false, "sourceipgroups": ["[resourceid('microsoft.network/ipgroups",parameters('workloadipgroup'))]", "[resourceid('microsoft.network/ipgroups", parameters('infraipgroup'))]"]}]}]}}{"apiversion": "2019-04-01", "type": "microsoft.network/azurefirewalls", "name": "[parameters('firewallname')]", "location": "[parameters('location')]", "zones": "[if(equals(length(parameters('availabilityzones')), 0), json('null'), parameters('availabilityzones'))]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "publicipcopy", "[resourceid('microsoft.network/ipgroups", parameters('workloadipgroup'))]", "[resourceid('microsoft.network/ipgroups", parameters('infraipgroup'))]", "[resourceid('microsoft.network/firewallpolicies",parameters('firewallpolicyname'))]", "[resourceid('microsoft.network/firewallpolicies/rulecollectiongroups",parameters('firewallpolicyname'), "defaultnetworkrulecollectiongroup')]", "[resourceid('microsoft.network/firewallpolicies/rulecollectiongroups",parameters('firewallpolicyname'), "defaultapplicationrulecollectiongroup')]"], "properties": {"ipconfigurations": "[variables('azurefirewallipconfigurations')]", "firewallpolicy": {"id": "[resourceid('microsoft.network/firewallpolicies", parameters('firewallpolicyname'))]"}}}
Creates a Front Door that demonstrates priority-based routing for Active-Standby application topology. It sends all traffic to the primary (highest-priority) backend until it becomes unavailable.
{"apiversion": "2020-07-01", "type": "microsoft.network/frontdoors", "name": "[parameters('frontdoorname')]", "location": "[variables('frontdoorlocation')]", "properties": {"routingrules": [{"name": "routingrule1", "properties": {"frontendendpoints": [{"id": "[resourceid('microsoft.network/frontdoors/frontendendpoints", parameters('frontdoorname'), "frontendendpoint1')]"}], "acceptedprotocols": ["http", "https"], "patternstomatch": ["/*", "/site1/*"], "routeconfiguration": {"@odata.type": "#microsoft.azure.frontdoor.models.frontdoorforwardingconfiguration", "forwardingprotocol": "matchrequest", "backendpool": {"id": "[resourceid('microsoft.network/frontdoors/backendpools", parameters('frontdoorname'), "backendpool1')]"}}, "enabledstate": "enabled"}}, {"name": "routingrule2", "properties": {"frontendendpoints": [{"id": "[resourceid('microsoft.network/frontdoors/frontendendpoints", parameters('frontdoorname'), "frontendendpoint1')]"}], "acceptedprotocols": ["https"], "patternstomatch": ["/site2/*"], "routeconfiguration": {"@odata.type": "#microsoft.azure.frontdoor.models.frontdoorforwardingconfiguration", "forwardingprotocol": "matchrequest", "backendpool": {"id": "[resourceid('microsoft.network/frontdoors/backendpools", parameters('frontdoorname'), "backendpool2')]"}}, "enabledstate": "enabled"}}], "healthprobesettings": [{"name": "healthprobesettings1", "properties": {"path": "/", "protocol": "http", "intervalinseconds": 120}}, {"name": "healthprobesettings2", "properties": {"path": "/", "protocol": "https", "intervalinseconds": 60}}], "loadbalancingsettings": [{"name": "loadbalancingsettings1", "properties": {"samplesize": 4, "successfulsamplesrequired": 2}}, {"name": "loadbalancingsettings2", "properties": {"samplesize": 2, "successfulsamplesrequired": 1}}], "backendpools": [{"name": "[parameters('backendpools1').name]", "properties": {"copy": [{"name": "backends", "count": "[length(parameters('backendpools1').backends)]", "input": {"address": "[parameters('backendpools1').backends[copyindex('backends')].address]", "httpport": "[parameters('backendpools1').backends[copyindex('backends')].httpport]", "httpsport": "[parameters('backendpools1').backends[copyindex('backends')].httpsport]", "weight": "[parameters('backendpools1').backends[copyindex('backends')].weight]", "priority": "[parameters('backendpools1').backends[copyindex('backends')].priority]", "enabledstate": "[parameters('backendpools1').backends[copyindex('backends')].enabledstate]"}}], "loadbalancingsettings": {"id": "[resourceid('microsoft.network/frontdoors/loadbalancingsettings", parameters('frontdoorname'), "loadbalancingsettings1')]"}, "healthprobesettings": {"id": "[resourceid('microsoft.network/frontdoors/healthprobesettings", parameters('frontdoorname'), "healthprobesettings1')]"}}}, {"name": "[parameters('backendpools2').name]", "properties": {"copy": [{"name": "backends", "count": "[length(parameters('backendpools2').backends)]", "input": {"address": "[parameters('backendpools2').backends[copyindex('backends')].address]", "httpport": "[parameters('backendpools2').backends[copyindex('backends')].httpport]", "httpsport": "[parameters('backendpools2').backends[copyindex('backends')].httpsport]", "weight": "[parameters('backendpools2').backends[copyindex('backends')].weight]", "priority": "[parameters('backendpools2').backends[copyindex('backends')].priority]", "enabledstate": "[parameters('backendpools2').backends[copyindex('backends')].enabledstate]"}}], "loadbalancingsettings": {"id": "[resourceid('microsoft.network/frontdoors/loadbalancingsettings", parameters('frontdoorname'), "loadbalancingsettings2')]"}, "healthprobesettings": {"id": "[resourceid('microsoft.network/frontdoors/healthprobesettings", parameters('frontdoorname'), "healthprobesettings2')]"}}}], "frontendendpoints": [{"name": "frontendendpoint1", "properties": {"hostname": "[variables('frontdoorhostname')]"}}], "enabledstate": "enabled"}}
Install Virtual Network with DMZ Subnet
{"apiversion": "2020-05-01", "type": "microsoft.network/networksecuritygroups", "name": "[parameters('fensgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "rdp_rule", "properties": {"description": "allow rdp", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}, {"name": "web_rule", "properties": {"description": "allow web", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "80", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "allow", "priority": 101, "direction": "inbound"}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/networksecuritygroups", "name": "[parameters('appnsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allow_fe", "properties": {"description": "allow fe subnet", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "443", "sourceaddressprefix": "[parameters('fesubnetprefix')]", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}, {"name": "block_rdp_internet", "properties": {"description": "block rdp", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "internet", "destinationaddressprefix": "*", "access": "deny", "priority": 101, "direction": "inbound"}}, {"name": "block_internet_outbound", "properties": {"description": "block internet", "protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "*", "destinationaddressprefix": "internet", "access": "deny", "priority": 200, "direction": "outbound"}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/networksecuritygroups", "name": "[parameters('dbnsgname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allow_app", "properties": {"description": "allow app subnet", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "1433", "sourceaddressprefix": "[parameters('appsubnetprefix')]", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}, {"name": "block_fe", "properties": {"description": "block fe subnet", "protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "[parameters('fesubnetprefix')]", "destinationaddressprefix": "*", "access": "deny", "priority": 101, "direction": "inbound"}}, {"name": "block_app", "properties": {"description": "block app subnet", "protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "[parameters('appsubnetprefix')]", "destinationaddressprefix": "*", "access": "deny", "priority": 102, "direction": "inbound"}}, {"name": "block_internet", "properties": {"description": "block internet", "protocol": "*", "sourceportrange": "*", "destinationportrange": "*", "sourceaddressprefix": "*", "destinationaddressprefix": "internet", "access": "deny", "priority": 200, "direction": "outbound"}}]}}{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups/", parameters('fensgname'))]", "[resourceid('microsoft.network/networksecuritygroups/", parameters('appnsgname'))]", "[resourceid('microsoft.network/networksecuritygroups/", parameters('dbnsgname'))]"], "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "fesubnet", "properties": {"addressprefix": "[parameters('fesubnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", parameters('fensgname'))]"}}}, {"name": "appsubnet", "properties": {"addressprefix": "[parameters('appsubnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", parameters('appnsgname'))]"}}}, {"name": "dbsubnet", "properties": {"addressprefix": "[parameters('dbsubnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", parameters('dbnsgname'))]"}}}]}}
Creates an ExpressRoute Circuit and an AzurePublicPeering BGP Peering
{"apiversion": "2020-08-01", "type": "microsoft.network/expressroutecircuits", "name": "[parameters('circuitname')]", "location": "[parameters('location')]", "tags": {"key1": "value1", "key2": "value2"}, "sku": {"name": "[concat(parameters('sku_tier'),"_", parameters('sku_family'))]", "tier": "[parameters('sku_tier')]", "family": "[parameters('sku_family')]"}, "properties": {"serviceproviderproperties": {"serviceprovidername": "[parameters('serviceprovidername')]", "peeringlocation": "[parameters('peeringlocation')]", "bandwidthinmbps": "[parameters('bandwidthinmbps')]"}, "peerings": [{"name": "[parameters('peeringtype')]", "properties": {"peeringtype": "[parameters('peeringtype')]", "sharedkey": "[parameters('sharedkey')]", "peerasn": "[parameters('peerasn')]", "primarypeeraddressprefix": "[parameters('primarypeeraddressprefix')]", "secondarypeeraddressprefix": "[parameters('secondarypeeraddressprefix')]", "vlanid": "[parameters('vlanid')]"}}]}}
Azure Route Server in BGP peering with Quagga
{"comments": "network security group", "type": "microsoft.network/networksecuritygroups", "apiversion": "2021-03-01", "name": "[variables('nsgname')]", "location": "[variables('location')]", "properties": {"securityrules": [{"name": "ssh-rule", "properties": {"description": "allow ssh", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "virtualnetwork", "access": "allow", "priority": 100, "direction": "inbound"}}]}}{"comments": "create vnet1. subnet1 is assigned to routeserversubnet. subnet4 is used for the ubuntu vm", "type": "microsoft.network/virtualnetworks", "apiversion": "2021-03-01", "name": "[variables('vnetname')]", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups",variables('nsgname'))]"], "properties": {"addressspace": {"addressprefixes": ["[variables('addressspace1prefix')]"]}, "subnets": [{"name": "[variables('subnet1name')]", "properties": {"addressprefix": "[variables('subnet1prefix')]"}}, {"name": "[variables('subnet2name')]", "properties": {"addressprefix": "[variables('subnet2prefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups",variables('nsgname'))]"}}}, {"name": "[variables('subnet3name')]", "properties": {"addressprefix": "[variables('subnet3prefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups",variables('nsgname'))]"}}}, {"name": "[variables('subnet4name')]", "properties": {"addressprefix": "[variables('subnet4prefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups",variables('nsgname'))]"}}}, {"name": "gatewaysubnet", "properties": {"addressprefix": "[variables('gatewaysubnetprefix')]"}}]}}{"comments": "create a virtual hub object", "type": "microsoft.network/virtualhubs", "apiversion": "2021-03-01", "name": "[variables('rsname')]", "location": "[variables('location')]", "dependson": ["[resourceid( "microsoft.network/virtualnetworks", variables('vnetname') )]"], "properties": {"sku": "standard", "allowbranchtobranchtraffic": true}, "resources": []}{"comments": "public ip of the route server", "type": "microsoft.network/publicipaddresses", "name": "[variables('rspubipname')]", "apiversion": "2021-03-01", "location": "[variables('location')]", "sku": {"name": "standard"}, "properties": {"publicipallocationmethod": "static"}}{"comments": "create the route server and attach it to the routeserversubnet subnet", "type": "microsoft.network/virtualhubs/ipconfigurations", "apiversion": "2021-03-01", "name": "[concat(variables('rsname'), "/",variables('vhubipconfigname'))]", "dependson": ["[resourceid('microsoft.network/virtualhubs", variables('rsname'))]", "[resourceid('microsoft.network/publicipaddresses", variables('rspubipname') )]"], "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('subnet_rs1_id')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('rspubipname') )]"}}}{"comments": "name of the bgp connection configured on the route server. the bgp connection can be created when the microsoft.network/virtualhubs/ipconfigurations deployment complete.", "type": "microsoft.network/virtualhubs/bgpconnections", "apiversion": "2021-03-01", "name": "[variables('bgpconnectionname')]", "dependson": ["[resourceid('microsoft.network/virtualhubs/ipconfigurations", variables('rsname'), variables('vhubipconfigname'))]"], "properties": {"peerip": "[variables('peering1ip')]", "peerasn": "[variables('peering1asn')]"}}{"comments": "public ip of the vm", "type": "microsoft.network/publicipaddresses", "name": "[variables('vmpubipname')]", "apiversion": "2021-03-01", "location": "[variables('location')]", "sku": {"name": "basic"}, "properties": {"publicipallocationmethod": "dynamic"}}{"comments": "network interface of the vm attached to the subnet4", "type": "microsoft.network/networkinterfaces", "apiversion": "2021-03-01", "name": "[variables('nicname')]", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]", "[resourceid('microsoft.network/publicipaddresses", variables('vmpubipname'))]"], "properties": {"ipconfigurations": [{"name": "ipconf-nic0", "properties": {"privateipallocationmethod": "static", "privateipaddress": "[variables('vmprivip')]", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('vmpubipname') )]"}, "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), variables('subnet4name') )]"}}}], "enableipforwarding": true}}
Create a VNET to VNET connection using vNet Peering
{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "name": "[parameters('vnet1name')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnet1config').addressspaceprefix]"]}, "subnets": [{"name": "[variables('vnet1config').subnetname]", "properties": {"addressprefix": "[variables('vnet1config').subnetprefix]"}}]}}{"type": "microsoft.network/virtualnetworks/virtualnetworkpeerings", "apiversion": "2020-05-01", "name": "[format('{0}/{1}", parameters('vnet1name'), format('{0}-{1}", parameters('vnet1name'), parameters('vnet2name')))]", "properties": {"allowvirtualnetworkaccess": true, "allowforwardedtraffic": false, "allowgatewaytransit": false, "useremotegateways": false, "remotevirtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks", parameters('vnet2name'))]"}}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('vnet1name'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('vnet2name'))]"]}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "name": "[parameters('vnet2name')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnet2config').addressspaceprefix]"]}, "subnets": [{"name": "[variables('vnet2config').subnetname]", "properties": {"addressprefix": "[variables('vnet2config').subnetprefix]"}}]}}{"type": "microsoft.network/virtualnetworks/virtualnetworkpeerings", "apiversion": "2020-05-01", "name": "[format('{0}/{1}", parameters('vnet2name'), format('{0}-{1}", parameters('vnet2name'), parameters('vnet1name')))]", "properties": {"allowvirtualnetworkaccess": true, "allowforwardedtraffic": false, "allowgatewaytransit": false, "useremotegateways": false, "remotevirtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks", parameters('vnet1name'))]"}}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('vnet1name'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('vnet2name'))]"]}
Add endpoint to existing profile
{"apiversion": "2018-04-01", "type": "microsoft.network/trafficmanagerprofiles/externalendpoints", "name": "[concat(parameters('existingtmprofilename'), "/", parameters('endpointname'))]", "properties": {"endpointstatus": "[variables('endpointstatus')]", "endpointlocation": "[variables('endpointlocation')]", "endpointmonitorstatus": "[variables('endpointmonitorstatus')]", "target": "[variables('target')]", "weight": "[variables('weight')]", "priority": "[variables('priority')]"}}
This template creates a standard internal Azure Load Balancer with a HA ports load-balancing rule
{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "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/loadbalancers/", variables('loadbalancername'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('subnetref')]"}, "loadbalancerbackendaddresspools": [{"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('loadbalancername'), "loadbalancerbackend')]"}]}}]}}{"apiversion": "2020-05-01", "name": "[variables('loadbalancername')]", "type": "microsoft.network/loadbalancers", "location": "[parameters('location')]", "sku": {"name": "[variables('lbsku')]"}, "dependson": ["[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]"], "properties": {"frontendipconfigurations": [{"name": "loadbalancerfrontend", "properties": {"subnet": {"id": "[variables('subnetref')]"}}}], "backendaddresspools": [{"name": "loadbalancerbackend"}], "loadbalancingrules": [{"name": "[variables('lbrulename')]", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/loadbalancers/frontendipconfigurations", variables('loadbalancername'), "loadbalancerfrontend')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/loadbalancers/backendaddresspools", variables('loadbalancername'), "loadbalancerbackend')]"}, "probe": {"id": "[resourceid('microsoft.network/loadbalancers/probes", variables('loadbalancername'), variables('lbprobename'))]"}, "protocol": "all", "frontendport": 0, "backendport": 0, "enablefloatingip": false, "enabletcpreset": true, "loaddistribution": "default", "disableoutboundsnat": true, "idletimeoutinminutes": 15}}], "probes": [{"name": "[variables('lbprobename')]", "properties": {"protocol": "tcp", "port": 80, "intervalinseconds": 15, "numberofprobes": 2}}]}}
Create an Application Gateway V2 with Key Vault
{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-01", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipallocationmethod": "static"}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "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/applicationgateways", "name": "[parameters('applicationgatewayname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]", "[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]"], "identity": {"type": "userassigned", "userassignedidentities": {"[variables('identityid')]": {}}}, "properties": {"sku": {"name": "[parameters('skuname')]", "tier": "standard_v2", "capacity": 2}, "sslcertificates": [{"name": "appgatewaysslcert", "properties": {"keyvaultsecretid": "[concat(reference(parameters('keyvaultname')).vaulturi,"secrets/sslcert')]"}}], "gatewayipconfigurations": [{"name": "appgatewayipconfig", "properties": {"subnet": {"id": "[variables('subnetref')]"}}}], "frontendipconfigurations": [{"name": "appgatewayfrontendip", "properties": {"publicipaddress": {"id": "[variables('publicipref')]"}}}], "frontendports": [{"name": "appgatewayfrontendport", "properties": {"port": 443}}], "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", parameters('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports", parameters('applicationgatewayname'), "appgatewayfrontendport')]"}, "protocol": "https", "sslcertificate": {"id": "[resourceid('microsoft.network/applicationgateways/sslcertificates", parameters('applicationgatewayname'), "appgatewaysslcert')]"}}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners", parameters('applicationgatewayname'), "appgatewayhttplistener')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",parameters('applicationgatewayname'), "appgatewaybackendpool')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",parameters('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}]}}
This template creates an Azure Traffic Manager profile that load-balances across multiple virtual machines placed in Availability Zones.
{"type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-01", "name": "[concat(variables('publicipaddressname'), copyindex())]", "zones": "[split(string(add(mod(copyindex(),3),1)), ",')]", "sku": {"name": "standard"}, "copy": {"name": "iploop", "count": "[parameters('numberofvms')]"}, "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "static", "dnssettings": {"domainnamelabel": "[concat(parameters('publicipdnsname'), copyindex())]"}}}{"type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["10.0.0.0/16"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "10.0.0.0/24"}}]}}{"type": "microsoft.network/networkinterfaces", "apiversion": "2020-05-01", "name": "[concat(variables('nicname'), copyindex())]", "copy": {"name": "nicloop", "count": "[parameters('numberofvms')]"}, "location": "[parameters('location')]", "dependson": ["iploop", "[variables('virtualnetworkname')]", "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", concat(variables('publicipaddressname'), copyindex()))]"}, "subnet": {"id": "[variables('subnetref')]"}}}], "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}{"apiversion": "2018-08-01", "type": "microsoft.network/trafficmanagerprofiles", "name": "vmendpointexample", "location": "global", "dependson": ["iploop"], "properties": {"profilestatus": "enabled", "trafficroutingmethod": "weighted", "dnsconfig": {"relativename": "[parameters('trafficmanagerdnsname')]", "ttl": 30}, "monitorconfig": {"protocol": "http", "port": 80, "path": "/"}, "copy": [{"name": "endpoints", "count": "[parameters('numberofvms')]", "input": {"name": "[concat('endpoint", copyindex('endpoints'))]", "type": "microsoft.network/trafficmanagerprofiles/azureendpoints", "properties": {"targetresourceid": "[resourceid('microsoft.network/publicipaddresses", concat(variables('publicipaddressname'), copyindex('endpoints')))]", "endpointstatus": "enabled", "weight": 1}}}]}}{"type": "microsoft.network/networksecuritygroups", "apiversion": "2020-05-01", "name": "[variables('networksecuritygroupname')]", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "port_80", "properties": {"protocol": "*", "sourceportrange": "*", "destinationportrange": "80", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}}
This template configures WAF managed defaultRuleSet for Azure Front Door
{"type": "microsoft.network/frontdoorwebapplicationfirewallpolicies", "apiversion": "2020-11-01", "name": "[parameters('wafpolicyname')]", "location": "global", "properties": {"policysettings": {"mode": "[parameters('wafmode')]", "enabledstate": "enabled"}, "managedrules": {"managedrulesets": [{"rulesettype": "defaultruleset", "rulesetversion": "1.0"}]}}}
This template creates two vNets with peerings, a Bastion host in the Hub vNet and a Linux VM in the spoke vNet
{"name": "[parameters('vnethubname')]", "type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnethubprefix')]"]}, "subnets": [{"name": "[variables('subnetbastionname')]", "properties": {"addressprefix": "[variables('subnetbastionprefix')]"}}]}}{"name": "[parameters('vnetspokename')]", "type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('vnetspokeprefix')]"]}, "subnets": [{"name": "[variables('subnetspokename')]", "properties": {"addressprefix": "[variables('subnetspokeprefix')]"}}]}}{"name": "[concat(parameters('vnethubname'),"/peering-to-",parameters('vnetspokename'))]", "type": "microsoft.network/virtualnetworks/virtualnetworkpeerings", "apiversion": "2020-05-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('vnethubname'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('vnetspokename'))]"], "properties": {"allowvirtualnetworkaccess": true, "allowforwardedtraffic": false, "allowgatewaytransit": false, "useremotegateways": false, "remotevirtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks",parameters('vnetspokename'))]"}}}{"name": "[concat(parameters('vnetspokename'),"/peering-to-",parameters('vnethubname'))]", "type": "microsoft.network/virtualnetworks/virtualnetworkpeerings", "apiversion": "2020-05-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('vnethubname'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('vnetspokename'))]"], "properties": {"allowvirtualnetworkaccess": true, "allowforwardedtraffic": false, "allowgatewaytransit": false, "useremotegateways": false, "remotevirtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks",parameters('vnethubname'))]"}}}{"name": "[variables('nsgname')]", "type": "microsoft.network/networksecuritygroups", "apiversion": "2020-05-01", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "allow-inbound-https", "properties": {"description": "allows inbound traffic for https", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "443", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 100, "direction": "inbound"}}]}}{"name": "[variables('bastionpublicipname')]", "type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-01", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "static"}, "sku": {"name": "standard"}}{"name": "[variables('vmpublicipname')]", "type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-01", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "static"}, "sku": {"name": "standard"}}{"name": "[parameters('bastionhostname')]", "type": "microsoft.network/bastionhosts", "apiversion": "2020-05-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('bastionpublicipname'))]"], "properties": {"ipconfigurations": [{"properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets",parameters('vnethubname'),variables('subnetbastionname'))]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('bastionpublicipname'))]"}, "privateipallocationmethod": "dynamic"}, "name": "ipconfig1"}]}}{"name": "[concat(parameters('vmname'),"-nic-01')]", "type": "microsoft.network/networkinterfaces", "apiversion": "2020-05-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('vnetspokename'))]", "[resourceid('microsoft.network/networksecuritygroups",variables('nsgname'))]", "[resourceid('microsoft.network/publicipaddresses", variables('vmpublicipname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('vnetspokename'),variables('subnetspokename'))]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('vmpublicipname'))]"}}}], "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups",variables('nsgname'))]"}}}
Application Gateway for URL Path Based Routing
{"apiversion": "2020-08-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2020-08-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('skuname')]", "tier": "standard", "capacity": "[parameters('capacity')]"}, "gatewayipconfigurations": [{"name": "appgatewayipconfig", "properties": {"subnet": {"id": "[variables('subnetref')]"}}}], "frontendipconfigurations": [{"name": "appgatewayfrontendpublicip", "properties": {"publicipaddress": {"id": "[variables('publicipref')]"}}}], "frontendports": [{"name": "appgatewayfrontendport80", "properties": {"port": 80}}], "backendaddresspools": [{"name": "appgatewaybackendpooldefault", "properties": {"backendaddresses": [{"ipaddress": "[parameters('backendipaddressdefault')]"}]}}, {"name": "appgatewaybackendpool1", "properties": {"backendaddresses": [{"ipaddress": "[parameters('backendipaddressforpathrule1')]"}]}}, {"name": "appgatewaybackendpool2", "properties": {"backendaddresses": [{"ipaddress": "[parameters('backendipaddressforpathrule2')]"}]}}], "backendhttpsettingscollection": [{"name": "appgatewaybackendhttpsettings", "properties": {"port": 80, "protocol": "http", "cookiebasedaffinity": "disabled"}}], "httplisteners": [{"name": "appgatewayhttplistener", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations",variables('applicationgatewayname'), "appgatewayfrontendpublicip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports",variables('applicationgatewayname'), "appgatewayfrontendport80')]"}, "protocol": "http"}}], "urlpathmaps": [{"name": "urlpathmap1", "properties": {"defaultbackendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",variables('applicationgatewayname'), "appgatewaybackendpooldefault')]"}, "defaultbackendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}, "pathrules": [{"name": "pathrule1", "properties": {"paths": ["[parameters('pathmatch1')]"], "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",variables('applicationgatewayname'), "appgatewaybackendpool1')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}, {"name": "pathrule2", "properties": {"paths": ["[parameters('pathmatch2')]"], "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",variables('applicationgatewayname'), "appgatewaybackendpool2')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}]}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "pathbasedrouting", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners",variables('applicationgatewayname'), "appgatewayhttplistener')]"}, "urlpathmap": {"id": "[resourceid('microsoft.network/applicationgateways/urlpathmaps",variables('applicationgatewayname'), "urlpathmap1')]"}}}]}}
Configure ExpressRoute private peering, deploy and connect an Azure VNet to an ExpressRoute circuit
{"comments": "create the er circuit", "type": "microsoft.network/expressroutecircuits", "apiversion": "2020-06-01", "name": "[variables('ercircuitname')]", "location": "[variables('erlocation')]", "sku": {"name": "[variables('ersku_name')]", "tier": "[variables('ersku_tier')]", "family": "[variables('ersku_family')]"}, "properties": {"serviceproviderproperties": {"serviceprovidername": "[variables('serviceprovidername')]", "peeringlocation": "[variables('erpeeringlocation')]", "bandwidthinmbps": "[variables('bandwidthinmbps')]"}, "allowclassicoperations": false}}{"comments": "create er private peering", "type": "microsoft.network/expressroutecircuits/peerings", "apiversion": "2020-06-01", "name": "[concat(variables('ercircuitname'),"/","azureprivatepeering')]", "location": "[variables('erlocation')]", "dependson": ["[resourceid('microsoft.network/expressroutecircuits", variables('ercircuitname'))]"], "properties": {"peeringtype": "azureprivatepeering", "peerasn": "[variables('peerasn')]", "primarypeeraddressprefix": "[variables('primarypeeraddressprefix')]", "secondarypeeraddressprefix": "[variables('secondarypeeraddressprefix')]", "vlanid": "[variables('vlanid')]"}}{"comments": "nsg applied to the subnets in vnet1", "type": "microsoft.network/networksecuritygroups", "apiversion": "2020-06-01", "name": "[variables('nsg')]", "location": "[variables('location')]", "properties": {"securityrules": [{"name": "ssh-rule", "properties": {"description": "allow ssh", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "virtualnetwork", "access": "allow", "priority": 500, "direction": "inbound"}}, {"name": "rdp-rule", "properties": {"description": "allow rdp", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "3389", "sourceaddressprefix": "*", "destinationaddressprefix": "virtualnetwork", "access": "allow", "priority": 600, "direction": "inbound"}}]}}{"comments": "it builds a virtual network with gatewaysubnet", "type": "microsoft.network/virtualnetworks", "apiversion": "2020-06-01", "name": "[variables('vnetname')]", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.network/networksecuritygroups", variables('nsg'))]"], "properties": {"addressspace": {"addressprefixes": ["[variables('vnetaddressspace')]"]}, "subnets": [{"name": "[variables('subnet1name')]", "properties": {"addressprefix": "[variables('subnet1prefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('nsg'))]"}}}, {"name": "gatewaysubnet", "properties": {"addressprefix": "[variables('gatewaysubnetprefix')]"}}]}}{"comments": "public ip of the expressroute gateway. only public ip dynamic allocation is supported", "type": "microsoft.network/publicipaddresses", "apiversion": "2020-06-01", "name": "[variables('gatewaypublicipname')]", "location": "[variables('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"comments": "expressroute gateway in the gatewaysubnet", "type": "microsoft.network/virtualnetworkgateways", "apiversion": "2020-06-01", "name": "[variables('gatewayname')]", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses", variables('gatewaypublicipname'))]", "[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"], "properties": {"ipconfigurations": [{"properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), "gatewaysubnet')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('gatewaypublicipname'))]"}}, "name": "gwipconf"}], "gatewaytype": "expressroute", "sku": {"name": "[variables('gatewaysku')]", "tier": "[variables('gatewaysku')]"}, "vpntype": "routebased"}}
This template creates a Front Door configuration with routing rule that is used to redirect HTTP traffic to HTTPS.
{"type": "microsoft.network/frontdoors", "apiversion": "2020-05-01", "name": "[parameters('frontdoorname')]", "location": "global", "properties": {"routingrules": [{"name": "httptohttps", "properties": {"frontendendpoints": [{"id": "[resourceid('microsoft.network/frontdoors/frontendendpoints", parameters('frontdoorname'), "frontendendpoint1')]"}], "acceptedprotocols": ["http"], "patternstomatch": ["/*"], "routeconfiguration": {"@odata.type": "#microsoft.azure.frontdoor.models.frontdoorredirectconfiguration", "redirectprotocol": "httpsonly", "redirecttype": "moved"}, "enabledstate": "enabled"}}], "healthprobesettings": [{"name": "healthprobesettings1", "properties": {"path": "/", "protocol": "http", "intervalinseconds": 120}}], "loadbalancingsettings": [{"name": "loadbalancingsettings1", "properties": {"samplesize": 4, "successfulsamplesrequired": 2}}], "backendpools": [{"name": "backendpool1", "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'), "loadbalancingsettings1')]"}, "healthprobesettings": {"id": "[resourceid('microsoft.network/frontdoors/healthprobesettings", parameters('frontdoorname'), "healthprobesettings1')]"}}}], "frontendendpoints": [{"name": "frontendendpoint1", "properties": {"hostname": "[format('{0}.azurefd.net", parameters('frontdoorname'))]", "sessionaffinityenabledstate": "disabled"}}], "enabledstate": "enabled"}}
Add a subnet to an existing VNET
{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2021-03-01", "name": "[format('{0}/{1}", parameters('existingvnetname'), parameters('newsubnetname'))]", "properties": {"addressprefix": "[parameters('newsubnetaddressprefix')]"}}
This template configures a WAF rule for Azure Front Door to rate limit incoming traffic for a given frontend host.
{"apiversion": "2019-03-01", "type": "microsoft.network/frontdoorwebapplicationfirewallpolicies", "name": "[parameters('wafpolicyname')]", "location": "[variables('waflocation')]", "properties": {"policysettings": {"mode": "[parameters('wafmode')]", "enabledstate": "enabled"}, "customrules": {"rules": [{"name": "rule1", "enabledstate": "enabled", "priority": 1, "ruletype": "ratelimitrule", "ratelimitthreshold": "[parameters('ratelimitthreshold')]", "ratelimitdurationinminutes": "[parameters('ratelimitdurationinminutes')]", "matchconditions": [{"matchvariable": "remoteaddr", "operator": "ipmatch", "matchvalue": ["[parameters('ipmatch')]"]}], "action": "[parameters('ratelimitaction')]"}]}}}
Network Interface in a Virtual Network with Public IP Address
{"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[parameters('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnslabelprefix')]"}}}{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "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/publicipaddresses/", variables('publicipaddressname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"publicipaddress": {"id": "[resourceid ('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]"}, "privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('subnetref')]"}}}]}}
This template configures WAF client IP restriction for Azure Front Door endpoint
{"apiversion": "2019-03-01", "type": "microsoft.network/frontdoorwebapplicationfirewallpolicies", "name": "[parameters('wafpolicyname')]", "location": "[variables('waflocation')]", "properties": {"policysettings": {"mode": "[parameters('wafmode')]", "enabledstate": "enabled"}, "customrules": {"rules": [{"name": "rule1", "priority": 1, "enabledstate": "enabled", "ruletype": "matchrule", "matchconditions": [{"matchvariable": "remoteaddr", "operator": "ipmatch", "matchvalue": ["[parameters('ipmatch')]"]}], "action": "[parameters('ipfilteringaction')]"}]}}}
Create an Azure portal dashboard
{"type": "microsoft.portal/dashboards", "apiversion": "2019-01-01-preview", "name": "[parameters('dashboardname')]", "location": "[parameters('location')]", "tags": {"hidden-title": "[parameters('dashboarddisplayname')]"}, "properties": {"lenses": {"0": {"order": 0, "parts": {"0": {"position": {"x": 0, "y": 0, "rowspan": 2, "colspan": 3}, "metadata": {"inputs": [], "type": "extension[azure]/hubsextension/parttype/markdownpart", "settings": {"content": {"settings": {"content": "## azure virtual machines overview\r\nnew team members should watch this video to get familiar with azure virtual machines."}}}}}, "1": {"position": {"x": 3, "y": 0, "rowspan": 4, "colspan": 8}, "metadata": {"inputs": [], "type": "extension[azure]/hubsextension/parttype/markdownpart", "settings": {"content": {"settings": {"content": "this is the team dashboard for the test vm we use on our team. here are some useful links:\r\n\r\n1. [create a linux virtual machine](https://docs.microsoft.com/azure/virtual-machines/linux/quick-create-portal)\r\n1. [create a windows virtual machine](https://docs.microsoft.com/azure/virtual-machines/windows/quick-create-portal)\r\n1. [create a virtual machine scale set](https://docs.microsoft.com/azure/virtual-machine-scale-sets/quick-create-portal)", "title": "test vm dashboard", "subtitle": "contoso"}}}}}, "2": {"position": {"x": 0, "y": 2, "rowspan": 2, "colspan": 3}, "metadata": {"inputs": [], "type": "extension[azure]/hubsextension/parttype/videopart", "settings": {"content": {"settings": {"src": "https://www.youtube.com/watch?v=roisrkxtteu", "autoplay": false}}}}}, "3": {"position": {"x": 0, "y": 4, "rowspan": 3, "colspan": 11}, "metadata": {"inputs": [{"name": "queryinputs", "value": {"timespan": {"duration": "pt1h"}, "id": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]", "charttype": 0, "metrics": [{"name": "percentage cpu", "resourceid": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"}]}}], "type": "extension/microsoft_azure_monitoring/parttype/metricschartpart"}}, "4": {"position": {"x": 0, "y": 7, "rowspan": 2, "colspan": 3}, "metadata": {"inputs": [{"name": "queryinputs", "value": {"timespan": {"duration": "pt1h"}, "id": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]", "charttype": 0, "metrics": [{"name": "disk read operations/sec", "resourceid": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"}, {"name": "disk write operations/sec", "resourceid": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"}]}}], "type": "extension/microsoft_azure_monitoring/parttype/metricschartpart"}}, "5": {"position": {"x": 3, "y": 7, "rowspan": 2, "colspan": 3}, "metadata": {"inputs": [{"name": "queryinputs", "value": {"timespan": {"duration": "pt1h"}, "id": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]", "charttype": 0, "metrics": [{"name": "disk read bytes", "resourceid": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"}, {"name": "disk write bytes", "resourceid": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"}]}}], "type": "extension/microsoft_azure_monitoring/parttype/metricschartpart"}}, "6": {"position": {"x": 6, "y": 7, "rowspan": 2, "colspan": 3}, "metadata": {"inputs": [{"name": "queryinputs", "value": {"timespan": {"duration": "pt1h"}, "id": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]", "charttype": 0, "metrics": [{"name": "network in total", "resourceid": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"}, {"name": "network out total", "resourceid": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"}]}}], "type": "extension/microsoft_azure_monitoring/parttype/metricschartpart"}}, "7": {"position": {"x": 9, "y": 7, "rowspan": 2, "colspan": 2}, "metadata": {"inputs": [{"name": "id", "value": "[resourceid(parameters('virtualmachineresourcegroup'), "microsoft.compute/virtualmachines", parameters('virtualmachinename'))]"}], "type": "extension/microsoft_azure_compute/parttype/virtualmachinepart", "asset": {"idinputname": "id", "type": "virtualmachine"}}}}}}}}
A default dashboard that includes a pinned resource group tile and a markup tile with instructions to customize and share
{"apiversion": "2020-09-01-preview", "name": "[concat('shared-dashboard-", parameters('dashboardname'))]", "type": "microsoft.portal/dashboards", "location": "[parameters('location')]", "tags": {"hidden-title": "[parameters('dashboardname')]"}, "properties": {"lenses": [{"order": 0, "parts": [{"position": {"x": 0, "y": 0, "colspan": 4, "rowspan": 6}, "metadata": {"inputs": [{"name": "resourcegroup", "isoptional": true}, {"name": "id", "value": "[resourcegroup().id]", "isoptional": true}], "type": "extension/hubsextension/parttype/resourcegroupmappinnedpart"}}, {"position": {"x": 4, "y": 0, "rowspan": 3, "colspan": 4}, "metadata": {"inputs": [], "type": "extension[azure]/hubsextension/parttype/markdownpart", "settings": {"content": {"settings": {"content": "__customizations__\n\nuse this dashboard to create and share the operational views of services critical to the application performing. to customize simply pin components to the dashboard and then publish when you"re done. others will see your changes when you publish and share the dashboard.\n\nyou can customize this text too. it supports plain text, __markdown__, and even limited html like images <img width="10" src="https://portal.azure.com/favicon.ico"/> and <a href="https://azure.microsoft.com" target="_blank">links</a> that open in a new tab.\n", "title": "operations", "subtitle": "[resourcegroup().name]"}}}}}]}], "metadata": {"model": {"timerange": {"value": {"relative": {"duration": 24, "timeunit": 1}}, "type": "msportalfx.composition.configuration.valuetypes.timerange"}}}}}
This template creates a scheduled analytics rule
{"scope": "[concat('microsoft.operationalinsights/workspaces/", parameters('existingworkspacename'))]", "type": "microsoft.securityinsights/alertrules", "apiversion": "2021-03-01-preview", "name": "[variables('ruleguid')]", "kind": "scheduled", "properties": {"displayname": "known iridium ip", "description": "iridium command and control ip. identifies a match across various data feeds for ip iocs related to the iridium activity group.", "severity": "high", "enabled": true, "query": "let iplist = dynamic(["154.223.45.38","185.141.207.140","185.234.73.19","216.245.210.106","51.91.48.210","46.255.230.229"]);\n(union isfuzzy=true\n(commonsecuritylog\n| where isnotempty(sourceip) or isnotempty(destinationip)\n| where sourceip in (iplist) or destinationip in (iplist) or message has_any (iplist)\n| extend ipmatch = case(sourceip in (iplist), "sourceip", destinationip in (iplist), "destinationip", "message") \n| summarize starttimeutc = min(timegenerated), endtimeutc = max(timegenerated) by sourceip, destinationip, deviceproduct, deviceaction, message, protocol, sourceport, destinationport, deviceaddress, devicename, ipmatch\n| extend timestamp = starttimeutc, ipcustomentity = case(ipmatch == "sourceip", sourceip, ipmatch == "destinationip", destinationip, "ip in message field") \n),\n(officeactivity\n|extend sourceipaddress = clientip, account = userid\n| where sourceipaddress in (iplist)\n| extend timestamp = timegenerated , ipcustomentity = sourceipaddress , accountcustomentity = account\n),\n(dnsevents \n| extend destinationipaddress = ipaddresses, host = computer\n| where destinationipaddress has_any (iplist) \n| extend timestamp = timegenerated, ipcustomentity = destinationipaddress, hostcustomentity = host\n),\n(imdns \n| extend destinationipaddress = dnsresponsename, host = dvc\n| where destinationipaddress has_any (iplist) \n| extend timestamp = timegenerated, ipcustomentity = srcipaddr, hostcustomentity = host\n),\n(vmconnection \n| where isnotempty(sourceip) or isnotempty(destinationip) \n| where sourceip in (iplist) or destinationip in (iplist) \n| extend ipmatch = case( sourceip in (iplist), "sourceip", destinationip in (iplist), "destinationip", "none") \n| extend timestamp = timegenerated , ipcustomentity = case(ipmatch == "sourceip", sourceip, ipmatch == "destinationip", destinationip, "none"), host = computer\n),\n(event\n| where source == "microsoft-windows-sysmon"\n| where eventid == 3\n| extend evdata = parse_xml(eventdata)\n| extend eventdetail = evdata.dataitem.eventdata.data\n| extend sourceip = eventdetail.[9].["#text"], destinationip = eventdetail.[14].["#text"]\n| where sourceip in (iplist) or destinationip in (iplist) \n| extend ipmatch = case( sourceip in (iplist), "sourceip", destinationip in (iplist), "destinationip", "none") \n| extend timestamp = timegenerated, accountcustomentity = username, hostcustomentity = computer , ipcustomentity = case(ipmatch == "sourceip", sourceip, ipmatch == "destinationip", destinationip, "none")\n),\n(signinlogs\n| where isnotempty(ipaddress)\n| where ipaddress in (iplist)\n| extend timestamp = timegenerated, accountcustomentity = userprincipalname, ipcustomentity = ipaddress\n),\n(aadnoninteractiveusersigninlogs\n| where isnotempty(ipaddress)\n| where ipaddress in (iplist)\n| extend timestamp = timegenerated, accountcustomentity = userprincipalname, ipcustomentity = ipaddress\n),\n(w3ciislog \n| where isnotempty(cip)\n| where cip in (iplist)\n| extend timestamp = timegenerated, ipcustomentity = cip, hostcustomentity = computer, accountcustomentity = csusername\n),\n(azureactivity \n| where isnotempty(calleripaddress)\n| where calleripaddress in (iplist)\n| extend timestamp = timegenerated, ipcustomentity = calleripaddress, accountcustomentity = caller\n),\n(\nawscloudtrail\n| where isnotempty(sourceipaddress)\n| where sourceipaddress in (iplist)\n| extend timestamp = timegenerated, ipcustomentity = sourceipaddress, accountcustomentity = useridentityusername\n),\n(\nazurediagnostics\n| where resourcetype == "azurefirewalls"\n| where category == "azurefirewallapplicationrule"\n| parse msg_s with protocol \"request from \" sourcehost \":\" sourceport \"to \" destinationhost \":\" destinationport \". action:\" action\n| where isnotempty(destinationhost)\n| where destinationhost has_any (iplist) \n| extend destinationip = destinationhost \n| extend ipcustomentity = sourcehost\n),\n(\nazurediagnostics\n| where resourcetype == "azurefirewalls"\n| where category == "azurefirewallnetworkrule"\n| parse msg_s with protocol \"request from \" sourcehost \":\" sourceport \"to \" destinationhost \":\" destinationport \". action:\" action\n| where isnotempty(destinationhost)\n| where destinationhost has_any (iplist) \n| extend destinationip = destinationhost \n| extend ipcustomentity = sourcehost\n)\n)", "queryfrequency": "p1d", "queryperiod": "p1d", "triggeroperator": "greaterthan", "triggerthreshold": 0, "suppressionduration": "pt5h", "suppressionenabled": false, "tactics": ["commandandcontrol"], "alertruletemplatename": "7ee72a9e-2e54-459c-bc8a-8c08a6532a63", "incidentconfiguration": {"createincident": true, "groupingconfiguration": {"enabled": false, "reopenclosedincident": false, "lookbackduration": "pt5h", "matchingmethod": "allentities", "groupbyentities": [], "groupbyalertdetails": [], "groupbycustomdetails": []}}, "eventgroupingsettings": {"aggregationkind": "singlealert"}, "alertdetailsoverride": {"alertdisplaynameformat": "known iridium ip: {{ipcustomentity}}", "alertdescriptionformat": "alert generated at {{timegenerated}}", "alerttacticscolumnname": none, "alertseveritycolumnname": "severity"}, "customdetails": {"group": "aadgroupid"}, "entitymappings": [{"entitytype": "account", "fieldmappings": [{"identifier": "fullname", "columnname": "accountcustomentity"}]}, {"entitytype": "host", "fieldmappings": [{"identifier": "fullname", "columnname": "hostcustomentity"}]}, {"entitytype": "ip", "fieldmappings": [{"identifier": "address", "columnname": "ipcustomentity"}]}]}}
This template creates an automation rule that triggers on incident creation (with certain conditions), executes a playbook and modifies two incident properies
{"type": "microsoft.securityinsights/automationrules", "name": "[variables('automationruleguid')]", "scope": "[concat('microsoft.operationalinsights/workspaces/", parameters('existingworkspacename'))]", "apiversion": "2019-01-01-preview", "properties": {"displayname": "[parameters('automationrulename')]", "order": 2, "triggeringlogic": {"isenabled": true, "expirationtimeutc": none, "triggerson": "incidents", "triggerswhen": "created", "conditions": [{"conditiontype": "property", "conditionproperties": {"propertyname": "incidentrelatedanalyticruleids", "operator": "contains", "propertyvalues": ["[resourceid('microsoft.operationalinsights/workspaces/providers/alertrules",parameters('existingworkspacename'),"microsoft.securityinsights",parameters('existingruleid'))]"]}}, {"conditiontype": "property", "conditionproperties": {"propertyname": "incidentseverity", "operator": "equals", "propertyvalues": ["high"]}}, {"conditiontype": "property", "conditionproperties": {"propertyname": "incidenttactics", "operator": "contains", "propertyvalues": ["initialaccess", "execution"]}}, {"conditiontype": "property", "conditionproperties": {"propertyname": "incidenttitle", "operator": "contains", "propertyvalues": ["urgent"]}}]}, "actions": [{"order": 2, "actiontype": "modifyproperties", "actionconfiguration": {"status": "closed", "classification": "undetermined", "classificationreason": none}}, {"order": 3, "actiontype": "modifyproperties", "actionconfiguration": {"labels": [{"labelname": "tag"}]}}]}}
Performs ETL job on data stored on blob.Also visualize real time data on PowerBI
{"type": "microsoft.datalakestore/accounts", "name": "[parameters('adlaccountname')]", "location": "[parameters('adllocation')]", "apiversion": "2016-11-01", "properties": {"newtier": "consumption", "encryptionstate": "disabled"}}