Description
stringlengths
19
200
IaC
stringlengths
128
8.16k
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}}]}}
Create an Application Gateway
{"apiversion": "2020-07-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2017-06-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"apiversion": "2017-06-01", "name": "[variables('applicationgatewayname')]", "type": "microsoft.network/applicationgateways", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]"], "properties": {"sku": {"name": "[parameters('applicationgatewaysize')]", "tier": "standard", "capacity": "[parameters('capacity')]"}, "gatewayipconfigurations": [{"name": "appgatewayipconfig", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('virtualnetworkname'), variables('subnetname'))]"}}}], "frontendipconfigurations": [{"name": "appgatewayfrontendip", "properties": {"publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname'))]"}}}], "frontendports": [{"name": "appgatewayfrontendport", "properties": {"port": 80}}], "backendaddresspools": [{"name": "appgatewaybackendpool", "properties": {"backendaddresses": [{"ipaddress": "[parameters('backend1')]"}]}}], "backendhttpsettingscollection": [{"name": "appgatewaybackendhttpsettings", "properties": {"port": 80, "protocol": "http", "cookiebasedaffinity": "disabled", "probeenabled": "[parameters('probeenabled')]", "probe": {"id": "[resourceid('microsoft.network/applicationgateways/probes",variables('applicationgatewayname'), "probe1')]"}}}], "httplisteners": [{"name": "appgatewayhttplistener", "properties": {"frontendipconfiguration": {"id": "[resourceid('microsoft.network/applicationgateways/frontendipconfigurations",variables('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports",variables('applicationgatewayname'), "appgatewayfrontendport')]"}, "protocol": "http"}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners",variables('applicationgatewayname'), "appgatewayhttplistener')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",variables('applicationgatewayname'), "appgatewaybackendpool')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}], "probes": [{"name": "probe1", "properties": {"protocol": "[parameters('probeprotocol')]", "path": "[parameters('probepath')]", "host": "[parameters('probehost')]", "interval": "[parameters('probeintervalinseconds')]", "timeout": "[parameters('probetimeoutinseconds')]", "unhealthythreshold": "[parameters('probeunhealthythreshold')]", "minservers": "[parameters('probeminserversavailable')]", "match": {"statuscodes": ["[parameters('healthystatuscodes')]"]}, "pickhostnamefrombackendhttpsettings": "[parameters('probepickhostnamefrombackendhttpsettings')]"}}]}}
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')]"}]}}
Create an Application Gateway
{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"apiversion": "2020-05-01", "name": "[parameters('applicationgatewayname')]", "type": "microsoft.network/applicationgateways", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", parameters('virtualnetworkname'))]"], "properties": {"sku": {"name": "[parameters('applicationgatewaysize')]", "tier": "standard", "capacity": "[parameters('applicationgatewayinstancecount')]"}, "gatewayipconfigurations": [{"name": "appgatewayipconfig", "properties": {"subnet": {"id": "[variables('subnetref')]"}}}], "frontendipconfigurations": [{"name": "appgatewayfrontendip", "properties": {"subnet": {"id": "[variables('subnetref')]"}}}], "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')]"}}}]}}
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 Application Gateway
{"apiversion": "2021-02-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('skuname')]", "tier": "standard", "capacity": "[parameters('capacity')]"}, "sslcertificates": [{"name": "appgatewaysslcert", "properties": {"data": "[parameters('certdata')]", "password": "[parameters('certpassword')]"}}], "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", variables('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports", variables('applicationgatewayname'), "appgatewayfrontendport')]"}, "protocol": "https", "sslcertificate": {"id": "[resourceid('microsoft.network/applicationgateways/sslcertificates", variables('applicationgatewayname'), "appgatewaysslcert')]"}}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners", variables('applicationgatewayname'), "appgatewayhttplistener')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools", variables('applicationgatewayname'), "appgatewaybackendpool')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection", variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}], "sslpolicy": {"policytype": "predefined", "policyname": "appgwsslpolicy20170401"}}}
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"}}
Create an Azure Firewall with Availability Zones
{"name": "[parameters('virtualnetworkname')]", "apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "location": "[parameters('location')]", "tags": {"displayname": "[parameters('virtualnetworkname')]"}, "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetaddressprefix')]"]}, "subnets": [{"name": "[variables('azurefirewallsubnetname')]", "properties": {"addressprefix": "[parameters('azurefirewallsubnetaddressprefix')]"}}]}}{"name": "[concat(parameters('publicipnameprefix'), add(copyindex(), 1))]", "type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-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/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"], "properties": {"ipconfigurations": "[variables('azurefirewallipconfigurations')]", "applicationrulecollections": [{"name": "apprc1", "properties": {"priority": 101, "action": {"type": "allow"}, "rules": [{"name": "apprule1", "protocols": [{"port": 80, "protocoltype": "http"}], "targetfqdns": ["www.microsoft.com"], "sourceaddresses": ["10.0.0.0/24"]}]}}], "networkrulecollections": [{"name": "netrc1", "properties": {"priority": 200, "action": {"type": "allow"}, "rules": [{"name": "netrule1", "protocols": ["tcp"], "sourceaddresses": ["10.0.0.0/24"], "destinationaddresses": ["*"], "destinationports": ["8000-8999"]}]}}]}}
Create an Application Gateway with Public IP
{"apiversion": "2020-05-01", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "dynamic"}}{"apiversion": "2020-05-01", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}]}}{"apiversion": "2020-05-01", "name": "[variables('applicationgatewayname')]", "type": "microsoft.network/applicationgateways", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]"], "properties": {"sku": {"name": "[parameters('skuname')]", "tier": "standard", "capacity": "[parameters('capacity')]"}, "sslcertificates": [{"name": "appgatewaysslcert", "properties": {"data": "[parameters('certdata')]", "password": "[parameters('certpassword')]"}}], "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": 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",variables('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports",variables('applicationgatewayname'), "appgatewayfrontendport')]"}, "protocol": "https", "sslcertificate": {"id": "[resourceid('microsoft.network/applicationgateways/sslcertificates",variables('applicationgatewayname'), "appgatewaysslcert')]"}}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners",variables('applicationgatewayname'), "appgatewayhttplistener')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",variables('applicationgatewayname'), "appgatewaybackendpool')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}]}}
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 Application Gateway
{"apiversion": "2021-02-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('skuname')]", "tier": "standard", "capacity": "[parameters('capacity')]"}, "sslcertificates": [{"name": "appgatewaysslcert", "properties": {"data": "[parameters('certdata')]", "password": "[parameters('certpassword')]"}}], "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",variables('applicationgatewayname'), "appgatewayfrontendip')]"}, "frontendport": {"id": "[resourceid('microsoft.network/applicationgateways/frontendports",variables('applicationgatewayname'), "appgatewayfrontendport')]"}, "protocol": "https", "sslcertificate": {"id": "[resourceid('microsoft.network/applicationgateways/sslcertificates",variables('applicationgatewayname'), "appgatewaysslcert')]"}}}], "requestroutingrules": [{"name": "rule1", "properties": {"ruletype": "basic", "httplistener": {"id": "[resourceid('microsoft.network/applicationgateways/httplisteners",variables('applicationgatewayname'), "appgatewayhttplistener')]"}, "backendaddresspool": {"id": "[resourceid('microsoft.network/applicationgateways/backendaddresspools",variables('applicationgatewayname'), "appgatewaybackendpool')]"}, "backendhttpsettings": {"id": "[resourceid('microsoft.network/applicationgateways/backendhttpsettingscollection",variables('applicationgatewayname'), "appgatewaybackendhttpsettings')]"}}}], "sslpolicy": {"policytype": "custom", "minprotocolversion": "tlsv1_1", "ciphersuites": ["tls_ecdhe_ecdsa_with_aes_128_gcm_sha256", "tls_ecdhe_ecdsa_with_aes_256_gcm_sha384", "tls_ecdhe_ecdsa_with_aes_128_cbc_sha", "tls_ecdhe_ecdsa_with_aes_256_cbc_sha", "tls_ecdhe_ecdsa_with_aes_128_cbc_sha256", "tls_ecdhe_ecdsa_with_aes_256_cbc_sha384", "tls_ecdhe_rsa_with_aes_256_gcm_sha384", "tls_ecdhe_rsa_with_aes_128_gcm_sha256", "tls_ecdhe_rsa_with_aes_128_cbc_sha", "tls_ecdhe_rsa_with_aes_256_cbc_sha", "tls_rsa_with_aes_256_gcm_sha384", "tls_rsa_with_aes_128_gcm_sha256", "tls_rsa_with_aes_256_cbc_sha256", "tls_rsa_with_aes_128_cbc_sha256", "tls_rsa_with_aes_256_cbc_sha", "tls_rsa_with_aes_128_cbc_sha"]}}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2015-06-15", "type": "microsoft.network/virtualnetworks", "name": "[parameters('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('addressprefix')]"]}, "subnets": [{"name": "[parameters('subnetname')]", "properties": {"addressprefix": "[parameters('subnetprefix')]"}}, {"name": "[parameters('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": ["[concat('microsoft.network/publicipaddresses/", parameters('gatewaypublicipname'))]", "[concat('microsoft.network/virtualnetworks/", parameters('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('gatewaysubnetref')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",parameters('gatewaypublicipname'))]"}}, "name": "vnetgatewayconfig"}], "gatewaytype": "[parameters('gatewaytype')]"}}{"apiversion": "2015-06-15", "type": "microsoft.network/connections", "name": "[parameters('connectionname')]", "location": "[parameters('location')]", "dependson": ["[concat('microsoft.network/virtualnetworkgateways/", parameters('gatewayname'))]"], "properties": {"virtualnetworkgateway1": {"id": "[resourceid('microsoft.network/virtualnetworkgateways",parameters('gatewayname'))]"}, "peer": {"id": "[resourceid('microsoft.network/expressroutecircuits",parameters('circuitname'))]"}, "connectiontype": "[parameters('connectiontype')]", "routingweight": "[variables('routingweight')]"}}
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"}]}}]}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('imagesku')]", "version": "[variables('imageversion')]"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('imagesku')]", "version": "[variables('imageversion')]"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'),"/newuserscript')]", "apiversion": "2015-06-15", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmname'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('setup.sh", parameters('_artifactslocationsastoken')))]"], "commandtoexecute": "[concat('sh setup.sh ", parameters('adminusername'))]"}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "name": "[variables('storageaccountname')]", "apiversion": "2021-01-01", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('imagesku')]", "version": "[variables('imageversion')]"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", variables('storageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('imagesku')]", "version": "[variables('imageversion')]"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'),"/newuserscript')]", "apiversion": "2015-06-15", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmname'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('setup.sh", parameters('_artifactslocationsastoken')))]"], "commandtoexecute": "[concat('sh setup.sh ", parameters('adminusername'))]"}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "name": "[variables('storageaccountname')]", "apiversion": "2021-01-01", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2015-06-15", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnslabelprefix')]"}}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2015-06-15", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnslabelprefix')]"}}}{"apiversion": "2015-06-15", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]"}}]}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2015-06-15", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnslabelprefix')]"}}}{"apiversion": "2015-06-15", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]"}}]}}{"apiversion": "2015-06-15", "type": "microsoft.network/networkinterfaces", "name": "[variables('nicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]", "[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname'))]"}, "subnet": {"id": "[variables('subnetref')]"}}}]}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "shared-resources", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "resources that are shared within the infrastructure environment", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('share-resourcesuri')]", "contentversion": "1.0.0.1"}, "parameters": {"resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "tableauasname": {"value": "[variables('vmspec').tableauasname]"}, "masternodeasname": {"value": "[variables('vmspec').masternodeasname]"}, "datanodeasname": {"value": "[variables('vmspec').datanodeasname]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "master-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "cloudera master node that manages the cluster nodes", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/nested/master-node.json')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('masterstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').masternodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "shared-resources", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "resources that are shared within the infrastructure environment", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('share-resourcesuri')]", "contentversion": "1.0.0.1"}, "parameters": {"resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "tableauasname": {"value": "[variables('vmspec').tableauasname]"}, "masternodeasname": {"value": "[variables('vmspec').masternodeasname]"}, "datanodeasname": {"value": "[variables('vmspec').datanodeasname]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "master-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "cloudera master node that manages the cluster nodes", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/nested/master-node.json')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('masterstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').masternodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "data-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "cloudera data nodes or cluster members", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('data-nodeuri')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('workerstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').datanodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "shared-resources", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "resources that are shared within the infrastructure environment", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('share-resourcesuri')]", "contentversion": "1.0.0.1"}, "parameters": {"resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "tableauasname": {"value": "[variables('vmspec').tableauasname]"}, "masternodeasname": {"value": "[variables('vmspec').masternodeasname]"}, "datanodeasname": {"value": "[variables('vmspec').datanodeasname]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "master-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "cloudera master node that manages the cluster nodes", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/nested/master-node.json')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('masterstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').masternodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "data-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "cloudera data nodes or cluster members", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('data-nodeuri')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('workerstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').datanodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "tableau-server", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "tableau server offering from the azure market place", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/nested/tableau-server.json')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('masterstorageaccount')]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "adminusername": {"value": "[parameters('adminusername')]"}, "adminpassword": {"value": "[parameters('adminpassword')]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "shared-resources", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "resources that are shared within the infrastructure environment", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('share-resourcesuri')]", "contentversion": "1.0.0.1"}, "parameters": {"resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "tableauasname": {"value": "[variables('vmspec').tableauasname]"}, "masternodeasname": {"value": "[variables('vmspec').masternodeasname]"}, "datanodeasname": {"value": "[variables('vmspec').datanodeasname]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "master-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "cloudera master node that manages the cluster nodes", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/nested/master-node.json')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('masterstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').masternodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "data-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "cloudera data nodes or cluster members", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('data-nodeuri')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('workerstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').datanodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "tableau-server", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "tableau server offering from the azure market place", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/nested/tableau-server.json')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('masterstorageaccount')]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "adminusername": {"value": "[parameters('adminusername')]"}, "adminpassword": {"value": "[parameters('adminpassword')]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}{"name": "setup-cloudera", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "comments": "scripts and configuration settings that intialize the cloudera cluster environment", "dependson": ["microsoft.resources/deployments/data-node", "microsoft.resources/deployments/master-node"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/nested/setup-cloudera.json')]", "contentversion": "1.0.0.1"}, "parameters": {"resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}, "fqdn": {"value": "[reference('master-node').outputs.fqdn.value]"}, "cmusername": {"value": "[parameters('cmusername')]"}, "cmpassword": {"value": "[parameters('cmpassword')]"}, "company": {"value": "[parameters('company')]"}, "emailaddress": {"value": "[parameters('emailaddress')]"}, "businessphone": {"value": "[parameters('businessphone')]"}, "firstname": {"value": "[parameters('firstname')]"}, "lastname": {"value": "[parameters('lastname')]"}, "jobrole": {"value": "[parameters('jobrole')]"}, "jobfunction": {"value": "[parameters('jobfunction')]"}, "installcdh": {"value": "[variables('installcdh')]"}, "clouderatags": {"value": "[variables('clouderatags')]"}, "tableautags": {"value": "[variables('tableautags')]"}, "quickstarttags": {"value": "[variables('quickstarttags')]"}}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "shared-resources", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('share-resourcesuri')]", "contentversion": "1.0.0.1"}, "parameters": {"resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "masternodeasname": {"value": "[variables('vmspec').masternodeasname]"}, "datanodeasname": {"value": "[variables('vmspec').datanodeasname]"}}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "shared-resources", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('share-resourcesuri')]", "contentversion": "1.0.0.1"}, "parameters": {"resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "masternodeasname": {"value": "[variables('vmspec').masternodeasname]"}, "datanodeasname": {"value": "[variables('vmspec').datanodeasname]"}}}}{"name": "master-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/master-node.json')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('masterstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').masternodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "shared-resources", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('share-resourcesuri')]", "contentversion": "1.0.0.1"}, "parameters": {"resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "masternodeasname": {"value": "[variables('vmspec').masternodeasname]"}, "datanodeasname": {"value": "[variables('vmspec').datanodeasname]"}}}}{"name": "master-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/master-node.json')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('masterstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').masternodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}}}}{"name": "data-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('data-nodeuri')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "templateapiversion": {"value": "[variables('templateapiversion')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('workerstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').datanodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}}}}
This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"name": "shared-resources", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('share-resourcesuri')]", "contentversion": "1.0.0.1"}, "parameters": {"resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "masternodeasname": {"value": "[variables('vmspec').masternodeasname]"}, "datanodeasname": {"value": "[variables('vmspec').datanodeasname]"}}}}{"name": "master-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/master-node.json')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('masterstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').masternodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}}}}{"name": "data-node", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "dependson": ["microsoft.resources/deployments/shared-resources"], "properties": {"mode": "incremental", "templatelink": {"uri": "[variables('data-nodeuri')]", "contentversion": "1.0.0.1"}, "parameters": {"vnetid": {"value": "[variables('vnetid')]"}, "templateapiversion": {"value": "[variables('templateapiversion')]"}, "resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "storageaccount": {"value": "[variables('workerstorageaccount')]"}, "vmcount": {"value": "[variables('clusterspec').datanodecount]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}}}}{"name": "setup-cloudera", "type": "microsoft.resources/deployments", "apiversion": "2015-11-01", "dependson": ["microsoft.resources/deployments/data-node", "microsoft.resources/deployments/master-node"], "properties": {"mode": "incremental", "templatelink": {"uri": "[concat(variables('scriptsuri'), "/setup-cloudera.json')]", "contentversion": "1.0.0.1"}, "parameters": {"resourceapiversion": {"value": "[variables('resourceapiversion')]"}, "dnsnameprefix": {"value": "[parameters('dnsnameprefix')]"}, "scriptsuri": {"value": "[variables('scriptsuri')]"}, "vmspec": {"value": "[variables('vmspec')]"}, "networkspec": {"value": "[variables('networkspec')]"}, "clusterspec": {"value": "[variables('clusterspec')]"}, "fqdn": {"value": "[reference('master-node').outputs.fqdn.value]"}, "cmusername": {"value": "[parameters('cmusername')]"}, "cmpassword": {"value": "[parameters('cmpassword')]"}, "company": {"value": "[parameters('company')]"}, "emailaddress": {"value": "[parameters('emailaddress')]"}, "businessphone": {"value": "[parameters('businessphone')]"}, "firstname": {"value": "[parameters('firstname')]"}, "lastname": {"value": "[parameters('lastname')]"}, "jobrole": {"value": "[parameters('jobrole')]"}, "jobfunction": {"value": "[parameters('jobfunction')]"}, "installcdh": {"value": "[variables('installcdh')]"}}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", parameters('newstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('ubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}, "datadisks": [{"name": "[concat(variables('vmname'),"_datadisk1')]", "disksizegb": "10", "lun": 0, "createoption": "empty"}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", parameters('newstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('ubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}, "datadisks": [{"name": "[concat(variables('vmname'),"_datadisk1')]", "disksizegb": "10", "lun": 0, "createoption": "empty"}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'), "/setupdatadisk')]", "apiversion": "2017-03-30", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmname'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('scripts/setup_data_disk.sh", parameters('_artifactslocationsastoken')))]"], "commandtoexecute": "bash setup_data_disk.sh"}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'), "/neo4jdocker')]", "apiversion": "2017-03-30", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/extensions", variables('vmname'),"setupdatadisk')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "dockerextension", "typehandlerversion": "1.0", "autoupgrademinorversion": true, "settings": {"compose": {"neo4j": {"image": "tpires/neo4j", "ports": ["7474:7474", "7473:7473"], "volumes": ["/datadisk:/var/lib/neo4j/data"]}}}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"type": "microsoft.storage/storageaccounts", "name": "[parameters('newstorageaccountname')]", "apiversion": "2021-01-01", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", parameters('newstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('ubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}, "datadisks": [{"name": "[concat(variables('vmname'),"_datadisk1')]", "disksizegb": "10", "lun": 0, "createoption": "empty"}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", parameters('newstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('ubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}, "datadisks": [{"name": "[concat(variables('vmname'),"_datadisk1')]", "disksizegb": "10", "lun": 0, "createoption": "empty"}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'), "/setupdatadisk')]", "apiversion": "2017-03-30", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmname'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('scripts/setup_data_disk.sh", parameters('_artifactslocationsastoken')))]"], "commandtoexecute": "bash setup_data_disk.sh"}}}
Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/virtualmachines", "name": "[variables('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts/", parameters('newstorageaccountname'))]", "[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "properties": {"hardwareprofile": {"vmsize": "[variables('vmsize')]"}, "osprofile": {"computername": "[variables('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('ubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(variables('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage"}, "datadisks": [{"name": "[concat(variables('vmname'),"_datadisk1')]", "disksizegb": "10", "lun": 0, "createoption": "empty"}]}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'), "/setupdatadisk')]", "apiversion": "2017-03-30", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/", variables('vmname'))]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "customscript", "typehandlerversion": "2.0", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat('scripts/setup_data_disk.sh", parameters('_artifactslocationsastoken')))]"], "commandtoexecute": "bash setup_data_disk.sh"}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(variables('vmname'), "/neo4jdocker')]", "apiversion": "2017-03-30", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines/extensions", variables('vmname'),"setupdatadisk')]"], "properties": {"publisher": "microsoft.azure.extensions", "type": "dockerextension", "typehandlerversion": "1.0", "autoupgrademinorversion": true, "settings": {"compose": {"neo4j": {"image": "tpires/neo4j", "ports": ["7474:7474", "7473:7473"], "volumes": ["/datadisk:/var/lib/neo4j/data"]}}}}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"type": "microsoft.storage/storageaccounts", "name": "[parameters('newstorageaccountname')]", "apiversion": "2021-01-01", "location": "[parameters('location')]", "sku": {"name": "[variables('storageaccounttype')]"}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2015-05-01-preview", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforpublicip')]"}}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2015-05-01-preview", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforpublicip')]"}}}{"apiversion": "2015-05-01-preview", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[variables('nsgid')]"], "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]", "networksecuritygroup": {"id": "[variables('nsgid')]"}}}]}}
Establish connection to a VNET via an ExpressRoute circuit
{"apiversion": "2015-05-01-preview", "type": "microsoft.network/publicipaddresses", "name": "[variables('publicipaddressname')]", "location": "[parameters('location')]", "properties": {"publicipallocationmethod": "[variables('publicipaddresstype')]", "dnssettings": {"domainnamelabel": "[parameters('dnsnameforpublicip')]"}}}{"apiversion": "2015-05-01-preview", "type": "microsoft.network/virtualnetworks", "name": "[variables('virtualnetworkname')]", "location": "[parameters('location')]", "dependson": ["[variables('nsgid')]"], "properties": {"addressspace": {"addressprefixes": ["[variables('addressprefix')]"]}, "subnets": [{"name": "[variables('subnetname')]", "properties": {"addressprefix": "[variables('subnetprefix')]", "networksecuritygroup": {"id": "[variables('nsgid')]"}}}]}}{"apiversion": "2015-05-01-preview", "type": "microsoft.network/networkinterfaces", "name": "[variables('nicname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/publicipaddresses/", variables('publicipaddressname'))]", "[resourceid('microsoft.network/virtualnetworks/", variables('virtualnetworkname'))]"], "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses",variables('publicipaddressname'))]"}, "subnet": {"id": "[variables('subnetref')]"}}}]}}
This module creates a Shared Image Gallery resource with apiVersion 2019-12-01.
{"name": "[parameters('vmname')]", "type": "microsoft.compute/virtualmachines", "location": "[parameters('location')]", "apiversion": "2020-12-01", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]"], "tags": {"displayname": "[parameters('vmname')]"}, "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('vmadminusername')]", "linuxconfiguration": {"disablepasswordauthentication": true, "ssh": {"publickeys": [{"path": "[variables('sshkeypath')]", "keydata": "[parameters('sshkeydata')]"}]}}}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "[parameters('vmubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "manageddisk": {"storageaccounttype": "premium_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]"}]}}, "resources": [{"name": "installneo4j", "type": "extensions", "location": "[parameters('location')]", "apiversion": "2020-12-01", "dependson": ["[resourceid('microsoft.compute/virtualmachines", parameters('vmname'))]"], "tags": {"displayname": "installneo4j"}, "properties": {"publisher": "microsoft.ostcextensions", "type": "customscriptforlinux", "typehandlerversion": "1.4", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat(variables('scriptsfolder'), "install-neo4j.sh", parameters('_artifactslocationsastoken')))]"]}, "protectedsettings": {"commandtoexecute": "[concat('sh install-neo4j.sh ", parameters('neo4jedition'))]"}}}]}
Create a VM from a Windows Image with 4 Empty Data Disks
{"name": "[parameters('vmname')]", "type": "microsoft.compute/virtualmachines", "location": "[parameters('location')]", "apiversion": "2020-12-01", "dependson": ["[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]"], "tags": {"displayname": "[parameters('vmname')]"}, "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('vmadminusername')]", "linuxconfiguration": {"disablepasswordauthentication": true, "ssh": {"publickeys": [{"path": "[variables('sshkeypath')]", "keydata": "[parameters('sshkeydata')]"}]}}}, "storageprofile": {"imagereference": {"publisher": "canonical", "offer": "ubuntuserver", "sku": "[parameters('vmubuntuosversion')]", "version": "latest"}, "osdisk": {"name": "[concat(parameters('vmname'),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "manageddisk": {"storageaccounttype": "premium_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces", variables('networkinterfacename'))]"}]}}, "resources": [{"name": "installneo4j", "type": "extensions", "location": "[parameters('location')]", "apiversion": "2020-12-01", "dependson": ["[resourceid('microsoft.compute/virtualmachines", parameters('vmname'))]"], "tags": {"displayname": "installneo4j"}, "properties": {"publisher": "microsoft.ostcextensions", "type": "customscriptforlinux", "typehandlerversion": "1.4", "autoupgrademinorversion": true, "settings": {"fileuris": ["[uri(parameters('_artifactslocation'), concat(variables('scriptsfolder'), "install-neo4j.sh", parameters('_artifactslocationsastoken')))]"]}, "protectedsettings": {"commandtoexecute": "[concat('sh install-neo4j.sh ", parameters('neo4jedition'))]"}}}]}
Establish connection to a VNET via an ExpressRoute circuit
{"name": "[variables('virtualnetworkname')]", "type": "microsoft.network/virtualnetworks", "location": "[parameters('location')]", "apiversion": "2020-11-01", "dependson": ["[resourceid('microsoft.network/networksecuritygroups/", variables('networksecuritygroupname'))]"], "tags": {"displayname": "[variables('virtualnetworkname')]"}, "properties": {"addressspace": {"addressprefixes": ["[variables('virtualnetworkprefix')]"]}, "subnets": [{"name": "[variables('virtualnetworksubnetname')]", "properties": {"addressprefix": "[variables('virtualnetworksubnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}
Establish connection to a VNET via an ExpressRoute circuit
{"name": "[variables('virtualnetworkname')]", "type": "microsoft.network/virtualnetworks", "location": "[parameters('location')]", "apiversion": "2020-11-01", "dependson": ["[resourceid('microsoft.network/networksecuritygroups/", variables('networksecuritygroupname'))]"], "tags": {"displayname": "[variables('virtualnetworkname')]"}, "properties": {"addressspace": {"addressprefixes": ["[variables('virtualnetworkprefix')]"]}, "subnets": [{"name": "[variables('virtualnetworksubnetname')]", "properties": {"addressprefix": "[variables('virtualnetworksubnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}{"type": "microsoft.network/networksecuritygroups", "name": "[variables('networksecuritygroupname')]", "apiversion": "2020-11-01", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "default-allow-ssh", "properties": {"description": "allow secure shell connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1000, "direction": "inbound"}}, {"name": "neo4j-allow-bolt", "properties": {"description": "allow bolt protocol connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "7687", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1010, "direction": "inbound"}}, {"name": "neo4j-allow-http", "properties": {"description": "allow http connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "7474", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1020, "direction": "inbound"}}, {"name": "neo4j-allow-https", "properties": {"description": "allow https connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "7473", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1030, "direction": "inbound"}}]}}
Establish connection to a VNET via an ExpressRoute circuit
{"name": "[variables('virtualnetworkname')]", "type": "microsoft.network/virtualnetworks", "location": "[parameters('location')]", "apiversion": "2020-11-01", "dependson": ["[resourceid('microsoft.network/networksecuritygroups/", variables('networksecuritygroupname'))]"], "tags": {"displayname": "[variables('virtualnetworkname')]"}, "properties": {"addressspace": {"addressprefixes": ["[variables('virtualnetworkprefix')]"]}, "subnets": [{"name": "[variables('virtualnetworksubnetname')]", "properties": {"addressprefix": "[variables('virtualnetworksubnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}{"type": "microsoft.network/networksecuritygroups", "name": "[variables('networksecuritygroupname')]", "apiversion": "2020-11-01", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "default-allow-ssh", "properties": {"description": "allow secure shell connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1000, "direction": "inbound"}}, {"name": "neo4j-allow-bolt", "properties": {"description": "allow bolt protocol connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "7687", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1010, "direction": "inbound"}}, {"name": "neo4j-allow-http", "properties": {"description": "allow http connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "7474", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1020, "direction": "inbound"}}, {"name": "neo4j-allow-https", "properties": {"description": "allow https connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "7473", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1030, "direction": "inbound"}}]}}{"name": "[variables('networkinterfacename')]", "type": "microsoft.network/networkinterfaces", "location": "[parameters('location')]", "apiversion": "2020-11-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"], "tags": {"displayname": "[variables('networkinterfacename')]"}, "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('networkinterfacesubnetref')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"}}}]}}
Establish connection to a VNET via an ExpressRoute circuit
{"name": "[variables('virtualnetworkname')]", "type": "microsoft.network/virtualnetworks", "location": "[parameters('location')]", "apiversion": "2020-11-01", "dependson": ["[resourceid('microsoft.network/networksecuritygroups/", variables('networksecuritygroupname'))]"], "tags": {"displayname": "[variables('virtualnetworkname')]"}, "properties": {"addressspace": {"addressprefixes": ["[variables('virtualnetworkprefix')]"]}, "subnets": [{"name": "[variables('virtualnetworksubnetname')]", "properties": {"addressprefix": "[variables('virtualnetworksubnetprefix')]", "networksecuritygroup": {"id": "[resourceid('microsoft.network/networksecuritygroups", variables('networksecuritygroupname'))]"}}}]}}{"type": "microsoft.network/networksecuritygroups", "name": "[variables('networksecuritygroupname')]", "apiversion": "2020-11-01", "location": "[parameters('location')]", "properties": {"securityrules": [{"name": "default-allow-ssh", "properties": {"description": "allow secure shell connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "22", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1000, "direction": "inbound"}}, {"name": "neo4j-allow-bolt", "properties": {"description": "allow bolt protocol connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "7687", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1010, "direction": "inbound"}}, {"name": "neo4j-allow-http", "properties": {"description": "allow http connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "7474", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1020, "direction": "inbound"}}, {"name": "neo4j-allow-https", "properties": {"description": "allow https connections", "protocol": "tcp", "sourceportrange": "*", "destinationportrange": "7473", "sourceaddressprefix": "*", "destinationaddressprefix": "*", "access": "allow", "priority": 1030, "direction": "inbound"}}]}}{"name": "[variables('networkinterfacename')]", "type": "microsoft.network/networkinterfaces", "location": "[parameters('location')]", "apiversion": "2020-11-01", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"], "tags": {"displayname": "[variables('networkinterfacename')]"}, "properties": {"ipconfigurations": [{"name": "ipconfig1", "properties": {"privateipallocationmethod": "dynamic", "subnet": {"id": "[variables('networkinterfacesubnetref')]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", variables('publicipaddressname'))]"}}}]}}{"name": "[variables('publicipaddressname')]", "type": "microsoft.network/publicipaddresses", "location": "[parameters('location')]", "apiversion": "2020-11-01", "tags": {"displayname": "[variables('publicipaddressname')]"}, "properties": {"publicipallocationmethod": "dynamic", "dnssettings": {"domainnamelabel": "[parameters('publicipaddressdns')]"}}}
This module creates a storageAccount resource with apiVersion 2021-01-01.
{"name": "[parameters('storageaccountname')]", "type": "microsoft.storage/storageaccounts", "location": "[parameters('location')]", "apiversion": "2015-06-15", "tags": {"displayname": "storageaccount"}, "properties": {"accounttype": "[parameters('storageaccounttype')]"}}
This template creates a Service Bus Namespace and Topic.
{"apiversion": "2015-08-01", "name": "[parameters('servicebusnamespacename')]", "type": "microsoft.servicebus/namespaces", "location": "[variables('location')]", "kind": "messaging", "tags": {"displayname": "servicebus"}, "sku": {"name": "[parameters('servicebussku')]", "tier": "[parameters('servicebussku')]"}}
Application Gateway routing Internet traffic to a virtual network (internal mode) API Management instance which services a web API hosted in an Azure Web App.
{"name": "[parameters('webapplication-hostingplannamename')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "apiversion": "2020-06-01", "tags": {"displayname": "webapplication-hostingplanname"}, "sku": {"name": "[parameters('webapplication-hostingplannamesku')]", "tier": "[parameters('webapplication-hostingplantiersku')]"}, "properties": {"name": "[parameters('webapplication-hostingplannamename')]", "workersize": "[parameters('webapplication-hostingplannameworkersize')]", "numberofworkers": 1}}
Storage Account with Storage Service Encryption and a blob deletion retention policy
{"name": "[parameters('storageaccountname')]", "type": "microsoft.storage/storageaccounts", "location": "[parameters('location')]", "apiversion": "2015-06-15", "tags": {"displayname": "storageaccount"}, "properties": {"accounttype": "[parameters('storageaccounttype')]"}}
Deploy an Azure SQL Server with Auditing enabled to write audit logs to a blob storage
{"apiversion": "2014-04-01", "location": "[parameters('location')]", "name": "[parameters('sqlservername')]", "properties": {"administratorlogin": "[parameters('sqlserveradminlogin')]", "administratorloginpassword": "[parameters('sqlserveradminloginpassword')]", "version": "12.0"}, "resources": [{"name": "allowallwindowsazureips", "type": "firewallrules", "location": "[parameters('location')]", "apiversion": "2014-04-01", "dependson": ["[resourceid('microsoft.sql/servers/", parameters('sqlservername'))]"], "properties": {"startipaddress": "0.0.0.0", "endipaddress": "0.0.0.0"}}, {"name": "[parameters('sql-databasename')]", "type": "databases", "location": "[parameters('location')]", "apiversion": "2014-04-01", "dependson": ["[parameters('sqlservername')]"], "tags": {"displayname": "sql-database"}, "properties": {"collation": "[parameters('sql-databasecollation')]", "edition": "[parameters('sql-databaseedition')]", "maxsizebytes": "1073741824", "requestedserviceobjectivename": "[parameters('sql-databaserequestedserviceobjectivename')]"}}], "tags": {"displayname": "sql-server"}, "type": "microsoft.sql/servers"}