{"id":308,"date":"2019-11-09T15:57:21","date_gmt":"2019-11-09T15:57:21","guid":{"rendered":"https:\/\/iddles.co.uk\/?p=308"},"modified":"2019-11-11T21:28:31","modified_gmt":"2019-11-11T21:28:31","slug":"azure-arm-concepts","status":"publish","type":"post","link":"https:\/\/iddles.co.uk\/index.php\/2019\/11\/09\/azure-arm-concepts\/","title":{"rendered":"Azure ARM concepts"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">For those who don&#8217;t know ARM, this is Azure Resource Manager.  It is  used for everything in Azure to submit changes, additions and deletions  to Azure infrastructure.  These are all made via a common API which  takes the changes, validates, queues and reports on any change.    Regardless of if you use the Azure Portal, Cloud Shell, API, PowerShell  or other tools they all use ARM. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Lets take a look.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First of all visit <a href=\"http:\/\/portal.azure.com\">portal.azure.com<\/a> and authenticate to your subscription. Next click in the master search box at the top and type &#8216;Activity&#8217; and select the <strong>Activity Log<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"280\" src=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-1024x280.png\" alt=\"\" class=\"wp-image-318\" srcset=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-1024x280.png 1024w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-300x82.png 300w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-768x210.png 768w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-676x185.png 676w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image.png 1695w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You may then need to change your filter applied to see jobs or tasks that have occured. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"420\" src=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-1-1024x420.png\" alt=\"\" class=\"wp-image-319\" srcset=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-1-1024x420.png 1024w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-1-300x123.png 300w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-1-768x315.png 768w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-1-676x277.png 676w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Each item can be examined an a JSON representation of the job and actions can be seen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For any deployment a set of files are required for deployment.  When using the Azure Portal, these are created by the web pages and then used to deploy as a Job by Azure Resource Manager.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can see this just before you hit deploy<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1012\" height=\"800\" src=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-7.png\" alt=\"\" class=\"wp-image-329\" srcset=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-7.png 1012w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-7-300x237.png 300w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-7-768x607.png 768w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-7-676x534.png 676w\" sizes=\"auto, (max-width: 1012px) 100vw, 1012px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then at the bottom select the &#8216;download template and parameters&#8217; link<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"170\" src=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-5.png\" alt=\"\" class=\"wp-image-327\" srcset=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-5.png 755w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-5-300x68.png 300w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-5-676x152.png 676w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This will display a template page (ill do another post on this) however for now select <strong>download<\/strong>.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"721\" src=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-6-1024x721.png\" alt=\"\" class=\"wp-image-328\" srcset=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-6-1024x721.png 1024w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-6-300x211.png 300w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-6-768x541.png 768w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-6-676x476.png 676w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> This will download a ZIP file to your local machine.   Save and Open it.  From an example I deployed the following files were created<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-3.png\" alt=\"\" class=\"wp-image-323\" width=\"223\" height=\"203\" srcset=\"https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-3.png 358w, https:\/\/iddles.co.uk\/wp-content\/uploads\/2019\/11\/image-3-300x273.png 300w\" sizes=\"auto, (max-width: 223px) 100vw, 223px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The key files are the <strong>parameters.json<\/strong> and <strong>template.json<\/strong> files.  These are mandatory.  The others are scripts and helpers to run the deployment task.  (.PS1 for PowerShell\/CloudShell, .sh for Bash, .rb for Ruby deployments etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All of the settings for the deployment are contained within the  <strong>parameters.json<\/strong> file.  Open it up with a suitable editor such as vsCode or Notepad++<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"$schema\": \"https:\/\/schema.management.azure.com\/schemas\/2015-01-01\/deploymentParameters.json#\",\n    \"contentVersion\": \"1.0.0.0\",\n    \"parameters\": {\n        \"vmName\": {\n            \"value\": \"azlab2000-fw-asa\"\n        },\n        \"softwareVersion\": {\n            \"value\": \"910.1.11\"\n        },\n        \"adminUsername\": {\n            \"value\": \"fwadmin\"\n        },\n        \"adminPassword\": {\n            \"value\": null\n        },\n        \"authenticationType\": {\n            \"value\": \"password\"\n        },\n        \"vmSize\": {\n            \"value\": \"Standard_D3_v2\"\n        },\n        \"location\": {\n            \"value\": \"centralus\"\n        },\n        \"storageAccountName\": {\n            \"value\": \"azlab2000fwasa\"\n        },\n        \"storageAccountType\": {\n            \"value\": \"Standard_LRS\"\n        },\n        \"storageAccountNewOrExisting\": {\n            \"value\": \"new\"\n        },\n        \"storageAccountRG\": {\n            \"value\": \"rg-firewalltest-asa\"\n        },\n        \"publicIPAddressName\": {\n            \"value\": \"azlab2000fwasa\"\n        },\n        \"publicIPDnsLabel\": {\n            \"value\": \"azlab2000fwasa\"\n        },\n        \"publicIPNewOrExisting\": {\n            \"value\": \"new\"\n        },\n        \"publicIPRG\": {\n            \"value\": \"rg-firewalltest-asa\"\n        },\n        \"publicIPAllocationMethod\": {\n            \"value\": \"Dynamic\"\n        },\n        \"publicIPsku\": {\n            \"value\": \"Basic\"\n        },\n        \"virtualNetworkName\": {\n            \"value\": \"vn-firewalltest\"\n        },\n        \"virtualNetworkAddressPrefixes\": {\n            \"value\": [\n                \"172.16.32.0\/20\"\n            ]\n        },\n        \"virtualNetworkNewOrExisting\": {\n            \"value\": \"existing\"\n        },\n        \"virtualNetworkRG\": {\n            \"value\": \"rg-firewalltest-common\"\n        },\n        \"Subnet1Name\": {\n            \"value\": \"sn-172.16.32.0_MGT\"\n        },\n        \"Subnet1Prefix\": {\n            \"value\": \"172.16.32.0\/24\"\n        },\n        \"Subnet2Name\": {\n            \"value\": \"sn-172.16.33.0_WAN\"\n        },\n        \"Subnet2Prefix\": {\n            \"value\": \"172.16.33.0\/24\"\n        },\n        \"Subnet3Name\": {\n            \"value\": \"sn-172.16.34.0_LAN\"\n        },\n        \"Subnet3Prefix\": {\n            \"value\": \"172.16.34.0\/24\"\n        },\n        \"Subnet4Name\": {\n            \"value\": \"sn-172.16.35.0_DMZ\"\n        },\n        \"Subnet4Prefix\": {\n            \"value\": \"172.16.35.0\/24\"\n        },\n        \"subnet1StartAddress\": {\n            \"value\": \"172.16.32.4\"\n        },\n        \"subnet2StartAddress\": {\n            \"value\": \"172.16.33.4\"\n        },\n        \"subnet3StartAddress\": {\n            \"value\": \"172.16.34.4\"\n        },\n        \"subnet4StartAddress\": {\n            \"value\": \"172.16.35.4\"\n        }\n    }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see, variables are well named and obvious and being is JSON format its easy to check its well formatted.  Values can be changed and as long as they validate against your exisiting constructs (for instance subnets and vNets) then it should be OK<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now open <strong>template.json<\/strong> <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n    \"$schema\": \"https:\/\/schema.management.azure.com\/schemas\/2015-01-01\/deploymentTemplate.json#\",\n    \"contentVersion\": \"1.0.0.0\",\n    \"parameters\": {\n        \"location\": {\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Deployment location\"\n            }\n        },\n        \"virtualNetworkName\": {\n            \"defaultValue\": \"ASAv_Network\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Virtual Network name\"\n            }\n        },\n        \"virtualNetworkRG\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Identifies whether to use new or existing Storage Account\"\n            }\n        },\n        \"virtualNetworkAddressPrefixes\": {\n            \"defaultValue\": \"\",\n            \"type\": \"array\",\n            \"metadata\": {\n                \"description\": \"Virtual Network Address prefixes\"\n            }\n        },\n        \"virtualNetworkNewOrExisting\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Identifies whether to use new or existing Virtual Network\"\n            }\n        },\n        \"Subnet1Prefix\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 1 Prefix\"\n            }\n        },\n        \"Subnet1Name\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 1 Name\"\n            }\n        },\n        \"subnet1StartAddress\": {\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 1 Starting IP Address\"\n            }\n        },\n        \"Subnet2Prefix\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 2 Prefix\"\n            }\n        },\n        \"Subnet2Name\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 2 Name\"\n            }\n        },\n        \"subnet2StartAddress\": {\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 2 Starting IP Address\"\n            }\n        },\n        \"Subnet3Prefix\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 3 Prefix\"\n            }\n        },\n        \"Subnet3Name\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 3 Name\"\n            }\n        },\n        \"subnet3StartAddress\": {\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 3 Starting IP Address\"\n            }\n        },\n        \"Subnet4Prefix\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 4 Prefix\"\n            }\n        },\n        \"Subnet4Name\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 4 Name\"\n            }\n        },\n        \"subnet4StartAddress\": {\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Subnet 4 Starting IP Address\"\n            }\n        },\n        \"adminUsername\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Username for the Virtual Machine.\"\n            }\n        },\n        \"adminPassword\": {\n            \"defaultValue\": \"\",\n            \"type\": \"securestring\",\n            \"metadata\": {\n                \"description\": \"Password for the Virtual Machine.\"\n            }\n        },\n        \"sshPublicKey\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"SSH Key for the virtual machines\"\n            }\n        },\n        \"authenticationType\": {\n            \"defaultValue\": \"\",\n            \"allowedValues\": [\n                \"password\",\n                \"sshPublicKey\"\n            ],\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Authentication Type to chose for the Virtual Machines\"\n            }\n        },\n        \"vmName\": {\n            \"defaultValue\": \"ASAv\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Name for the Virtual Machine.\"\n            }\n        },\n        \"softwareVersion\": {\n            \"type\": \"string\",\n            \"defaultValue\": \"910.1.11\",\n            \"allowedValues\": [\n                \"910.1.11\",\n                \"910.1.0\",\n                \"99.2.18\",\n                \"99.1.6\"\n            ],\n            \"metadata\": {\n                \"description\": \"Software version to deploy.\"\n            }\n        },\n        \"storageAccountName\": {\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Unique Name for Storage Account where the Virtual Machine's disks and\/or diagnostic files will be placed.\"\n            }\n        },\n        \"storageAccountType\": {\n            \"defaultValue\": \"Standard_LRS\",\n            \"allowedValues\": [\n                \"Standard_LRS\"\n            ],\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"The type of storage account created.\"\n            }\n        },\n        \"storageAccountNewOrExisting\": {\n            \"type\": \"string\",\n            \"defaultValue\": \"new\",\n            \"allowedValues\": [\n                \"new\",\n                \"existing\"\n            ],\n            \"metadata\": {\n                \"description\": \"Identifies whether to use new or existing Storage Account\"\n            }\n        },\n        \"storageAccountRG\": {\n            \"type\": \"string\",\n            \"defaultValue\": \"[resourceGroup().name]\",\n            \"metadata\": {\n                \"description\": \"Resource Group containing existing storage account\"\n            }\n        },\n        \"publicIPAddressName\": {\n            \"defaultValue\": \"\",\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Name of the Public IP Address\"\n            }\n        },\n        \"publicIPDnsLabel\": {\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Unique DNS Prefix for the Public IP used to access the Virtual Machine.\"\n            }\n        },\n        \"publicIPNewOrExisting\": {\n            \"defaultValue\": \"new\",\n            \"allowedValues\": [\n                \"new\",\n                \"existing\"\n            ],\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Indicates whether the Public IP is new or existing\"\n            }\n        },\n        \"publicIPRG\": {\n            \"type\": \"string\",\n            \"defaultValue\": \"[resourceGroup().name]\",\n            \"metadata\": {\n                \"description\": \"Resource Group of the public IP\"\n            }\n        },\n        \"publicIPAllocationMethod\": {\n            \"defaultValue\": \"Static\",\n            \"type\": \"string\",\n            \"allowedValues\": [\n                \"Dynamic\",\n                \"Static\"\n            ],\n            \"metadata\": {\n                \"description\": \"Select Dynamic or Static as the type of public IP.\"\n            }\n        },\n        \"publicIPsku\": {\n            \"type\": \"string\",\n            \"defaultValue\": \"Basic\",\n            \"allowedValues\": [\n                \"Basic\",\n                \"Standard\"\n            ],\n            \"metadata\": {\n                \"description\": \"Indicates whether the public IP will be of Basic SKU or Standard SKU\"\n            }\n        },\n        \"vmSize\": {\n            \"defaultValue\": \"Standard_D3_v2\",\n            \"allowedValues\": [\n                \"Standard_D3\",\n                \"Standard_D3_v2\"\n            ],\n            \"type\": \"string\",\n            \"metadata\": {\n                \"description\": \"Size of the Virtual Machine\"\n            }\n        }\n    },\n    \"variables\": {\n        \"imagePublisher\": \"cisco\",\n        \"imageOffer\": \"cisco-asav\",\n        \"imageSKU\": \"asav-azure-byol\",\n        \"softwareVersion\": \"[parameters('softwareVersion')]\",\n        \"OSDiskName\": \"[concat(parameters('vmName'),'-disk')]\",\n        \"vnetID\": \"[resourceId(parameters('virtualNetworkRG'),'Microsoft.Network\/virtualNetworks', parameters('virtualNetworkName'))]\",\n        \"subnet1Ref\": \"[concat(variables('vnetID'),'\/subnets\/', parameters('Subnet1Name'))]\",\n        \"subnet2Ref\": \"[concat(variables('vnetID'),'\/subnets\/', parameters('Subnet2Name'))]\",\n        \"subnet3Ref\": \"[concat(variables('vnetID'),'\/subnets\/', parameters('Subnet3Name'))]\",\n        \"subnet4Ref\": \"[concat(variables('vnetID'),'\/subnets\/', parameters('Subnet4Name'))]\",\n        \"routeTable1Name\": \"[concat(parameters('Subnet1Name'),'-ASAv-RouteTable')]\",\n        \"routeTable2Name\": \"[concat(parameters('Subnet2Name'),'-ASAv-RouteTable')]\",\n        \"routeTable3Name\": \"[concat(parameters('Subnet3Name'),'-ASAv-RouteTable')]\",\n        \"routeTable4Name\": \"[concat(parameters('Subnet4Name'),'-ASAv-RouteTable')]\",\n        \"routeTable1Id\": \"[resourceId(parameters('virtualNetworkRG'),'Microsoft.Network\/routeTables',variables('routeTable1Name'))]\",\n        \"routeTable2Id\": \"[resourceId(parameters('virtualNetworkRG'),'Microsoft.Network\/routeTables',variables('routeTable2Name'))]\",\n        \"routeTable3Id\": \"[resourceId(parameters('virtualNetworkRG'),'Microsoft.Network\/routeTables',variables('routeTable3Name'))]\",\n        \"routeTable4Id\": \"[resourceId(parameters('virtualNetworkRG'),'Microsoft.Network\/routeTables',variables('routeTable4Name'))]\",\n        \"nsgname\": \"[concat(parameters('vmName'),'-SecurityGroup')]\",\n        \"sshKeyPath\": \"[concat('\/home\/',parameters('adminUsername'),'\/.ssh\/authorized_keys')]\",\n        \"osProfilesshPublicKey\": {\n            \"computername\": \"[parameters('vmName')]\",\n            \"adminUsername\": \"[parameters('adminUsername')]\",\n            \"linuxConfiguration\": {\n                \"disablePasswordAuthentication\": \"true\",\n                \"ssh\": {\n                    \"publicKeys\": [\n                        {\n                            \"path\": \"[variables('sshKeyPath')]\",\n                            \"keyData\": \"[parameters('sshPublicKey')]\"\n                        }\n                    ]\n                }\n            }\n        },\n        \"osProfilepassword\": {\n            \"computername\": \"[parameters('vmName')]\",\n            \"adminUsername\": \"[parameters('adminUsername')]\",\n            \"adminPassword\": \"[parameters('adminPassword')]\"\n        }\n    },\n    \"resources\": [\n        {\n            \"apiVersion\": \"2018-02-01\",\n            \"name\": \"pid-5d91b9f4-27ad-53ca-bd33-de577ae21ef8\",\n            \"type\": \"Microsoft.Resources\/deployments\",\n            \"properties\": {\n                \"mode\": \"Incremental\",\n                \"template\": {\n                    \"$schema\": \"https:\/\/schema.management.azure.com\/schemas\/2015-01-01\/deploymentTemplate.json#\",\n                    \"contentVersion\": \"1.0.0.0\",\n                    \"resources\": []\n                }\n            }\n        },\n        {\n            \"name\": \"[parameters('storageAccountName')]\",\n            \"type\": \"Microsoft.Storage\/storageAccounts\",\n            \"apiVersion\": \"2018-02-01\",\n            \"condition\": \"[equals(parameters('storageAccountNewOrExisting'),'new')]\",\n            \"sku\": {\n                \"name\": \"[parameters('storageAccountType')]\"\n            },\n            \"kind\": \"Storage\",\n            \"location\": \"[parameters('location')]\",\n            \"properties\": {}\n        },\n        {\n            \"name\": \"[parameters('publicIPAddressName')]\",\n            \"type\": \"Microsoft.Network\/publicIPAddresses\",\n            \"apiVersion\": \"2017-10-01\",\n            \"condition\": \"[equals(parameters('publicIPNewOrExisting'),'new')]\",\n            \"location\": \"[parameters('location')]\",\n            \"sku\": {\n                \"name\": \"[parameters('publicIPsku')]\"\n            },\n            \"properties\": {\n                \"publicIPAllocationMethod\": \"[parameters('publicIPAllocationMethod')]\",\n                \"dnsSettings\": {\n                    \"domainNameLabel\": \"[parameters('publicIPDnsLabel')]\"\n                },\n                \"idleTimeoutInMinutes\": 30\n            }\n        },\n        {\n            \"name\": \"[variables('nsgname')]\",\n            \"type\": \"Microsoft.Network\/networkSecurityGroups\",\n            \"apiVersion\": \"2018-08-01\",\n            \"location\": \"[parameters('location')]\",\n            \"properties\": {\n                \"securityRules\": [\n                    {\n                        \"name\": \"SSH-Rule\",\n                        \"properties\": {\n                            \"description\": \"Allow SSH\",\n                            \"protocol\": \"Tcp\",\n                            \"sourcePortRange\": \"*\",\n                            \"destinationPortRange\": \"22\",\n                            \"sourceAddressPrefix\": \"*\",\n                            \"destinationAddressPrefix\": \"*\",\n                            \"access\": \"Allow\",\n                            \"priority\": 100,\n                            \"direction\": \"Inbound\"\n                        }\n                    },\n                    {\n                        \"name\": \"UDP-Rule1\",\n                        \"properties\": {\n                            \"description\": \"Allow UDP\",\n                            \"protocol\": \"Udp\",\n                            \"sourcePortRange\": \"*\",\n                            \"destinationPortRange\": \"500\",\n                            \"sourceAddressPrefix\": \"*\",\n                            \"destinationAddressPrefix\": \"*\",\n                            \"access\": \"Allow\",\n                            \"priority\": 101,\n                            \"direction\": \"Inbound\"\n                        }\n                    },\n                    {\n                        \"name\": \"UDP-Rule2\",\n                        \"properties\": {\n                            \"description\": \"Allow UDP\",\n                            \"protocol\": \"Udp\",\n                            \"sourcePortRange\": \"*\",\n                            \"destinationPortRange\": \"4500\",\n                            \"sourceAddressPrefix\": \"*\",\n                            \"destinationAddressPrefix\": \"*\",\n                            \"access\": \"Allow\",\n                            \"priority\": 102,\n                            \"direction\": \"Inbound\"\n                        }\n                    }\n                ]\n            }\n        },\n        {\n            \"name\": \"[variables('routeTable1Name')]\",\n            \"type\": \"Microsoft.Network\/routeTables\",\n            \"condition\": \"[equals(parameters('virtualNetworkNewOrExisting'),'new')]\",\n            \"apiVersion\": \"2018-08-01\",\n            \"location\": \"[parameters('location')]\",\n            \"properties\": {\n                \"routes\": []\n            }\n        },\n        {\n            \"name\": \"[variables('routeTable2Name')]\",\n            \"type\": \"Microsoft.Network\/routeTables\",\n            \"condition\": \"[equals(parameters('virtualNetworkNewOrExisting'),'new')]\",\n            \"apiVersion\": \"2018-08-01\",\n            \"location\": \"[parameters('location')]\",\n            \"properties\": {\n                \"routes\": []\n            }\n        },\n        {\n            \"name\": \"[variables('routeTable3Name')]\",\n            \"type\": \"Microsoft.Network\/routeTables\",\n            \"condition\": \"[equals(parameters('virtualNetworkNewOrExisting'),'new')]\",\n            \"apiVersion\": \"2018-08-01\",\n            \"location\": \"[parameters('location')]\",\n            \"properties\": {\n                \"routes\": []\n            }\n        },\n        {\n            \"name\": \"[variables('routeTable4Name')]\",\n            \"type\": \"Microsoft.Network\/routeTables\",\n            \"condition\": \"[equals(parameters('virtualNetworkNewOrExisting'),'new')]\",\n            \"apiVersion\": \"2018-08-01\",\n            \"location\": \"[parameters('location')]\",\n            \"properties\": {\n                \"routes\": []\n            }\n        },\n        {\n            \"name\": \"[parameters('virtualNetworkName')]\",\n            \"type\": \"Microsoft.Network\/virtualNetworks\",\n            \"apiVersion\": \"2018-08-01\",\n            \"condition\": \"[equals(parameters('virtualNetworkNewOrExisting'),'new')]\",\n            \"location\": \"[parameters('location')]\",\n            \"dependsOn\": [\n                \"[concat('Microsoft.Network\/routeTables\/', variables('routeTable1Name'))]\",\n                \"[concat('Microsoft.Network\/routeTables\/', variables('routeTable2Name'))]\",\n                \"[concat('Microsoft.Network\/routeTables\/', variables('routeTable3Name'))]\",\n                \"[concat('Microsoft.Network\/routeTables\/', variables('routeTable4Name'))]\"\n            ],\n            \"properties\": {\n                \"addressSpace\": {\n                    \"addressPrefixes\": \"[parameters('virtualNetworkAddressPrefixes')]\"\n                },\n                \"subnets\": [\n                    {\n                        \"name\": \"[parameters('Subnet1Name')]\",\n                        \"properties\": {\n                            \"addressPrefix\": \"[parameters('Subnet1Prefix')]\",\n                            \"routeTable\": {\n                                \"id\": \"[variables('routeTable1Id')]\"\n                            }\n                        }\n                    },\n                    {\n                        \"name\": \"[parameters('Subnet2Name')]\",\n                        \"properties\": {\n                            \"addressPrefix\": \"[parameters('Subnet2Prefix')]\",\n                            \"routeTable\": {\n                                \"id\": \"[variables('routeTable2Id')]\"\n                            }\n                        }\n                    },\n                    {\n                        \"name\": \"[parameters('Subnet3Name')]\",\n                        \"properties\": {\n                            \"addressPrefix\": \"[parameters('Subnet3Prefix')]\",\n                            \"routeTable\": {\n                                \"id\": \"[variables('routeTable3Id')]\"\n                            }\n                        }\n                    },\n                    {\n                        \"name\": \"[parameters('Subnet4Name')]\",\n                        \"properties\": {\n                            \"addressPrefix\": \"[parameters('Subnet4Prefix')]\",\n                            \"routeTable\": {\n                                \"id\": \"[variables('routeTable4Id')]\"\n                            }\n                        }\n                    }\n                ]\n            }\n        },\n        {\n            \"name\": \"[concat(parameters('vmName'),'-Nic0')]\",\n            \"type\": \"Microsoft.Network\/networkInterfaces\",\n            \"apiVersion\": \"2018-08-01\",\n            \"location\": \"[parameters('location')]\",\n            \"dependsOn\": [\n                \"[concat('Microsoft.Network\/virtualNetworks\/', parameters('virtualNetworkName'))]\",\n                \"[concat('Microsoft.Network\/networkSecurityGroups\/',variables('nsgname'))]\",\n                \"[concat('Microsoft.Network\/publicIPAddresses\/', parameters('publicIPAddressName'))]\"\n            ],\n            \"properties\": {\n                \"ipConfigurations\": [\n                    {\n                        \"name\": \"ipconfig1\",\n                        \"properties\": {\n                            \"privateIPAllocationMethod\": \"Static\",\n                            \"privateIPAddress\": \"[parameters('subnet1StartAddress')]\",\n                            \"subnet\": {\n                                \"id\": \"[variables('subnet1Ref')]\"\n                            },\n                            \"publicIPAddress\": {\n                                \"id\": \"[resourceId(parameters('publicIPRG'),'Microsoft.Network\/publicIPAddresses',parameters('publicIPAddressName'))]\"\n                            }\n                        }\n                    }\n                ],\n                \"networkSecurityGroup\": {\n                    \"id\": \"[resourceId('Microsoft.Network\/networkSecurityGroups', variables('nsgname'))]\"\n                },\n                \"enableIPForwarding\": true\n            }\n        },\n        {\n            \"name\": \"[concat(parameters('vmName'),'-Nic1')]\",\n            \"type\": \"Microsoft.Network\/networkInterfaces\",\n            \"apiVersion\": \"2018-08-01\",\n            \"location\": \"[parameters('location')]\",\n            \"dependsOn\": [\n                \"[concat('Microsoft.Network\/virtualNetworks\/', parameters('virtualNetworkName'))]\"\n            ],\n            \"properties\": {\n                \"ipConfigurations\": [\n                    {\n                        \"name\": \"ipconfig1\",\n                        \"properties\": {\n                            \"privateIPAllocationMethod\": \"Static\",\n                            \"privateIPAddress\": \"[parameters('subnet2StartAddress')]\",\n                            \"subnet\": {\n                                \"id\": \"[variables('subnet2Ref')]\"\n                            }\n                        }\n                    }\n                ],\n                \"enableIPForwarding\": true\n            }\n        },\n        {\n            \"name\": \"[concat(parameters('vmName'),'-Nic2')]\",\n            \"type\": \"Microsoft.Network\/networkInterfaces\",\n            \"apiVersion\": \"2018-08-01\",\n            \"location\": \"[parameters('location')]\",\n            \"dependsOn\": [\n                \"[concat('Microsoft.Network\/virtualNetworks\/', parameters('virtualNetworkName'))]\"\n            ],\n            \"properties\": {\n                \"ipConfigurations\": [\n                    {\n                        \"name\": \"ipconfig1\",\n                        \"properties\": {\n                            \"privateIPAllocationMethod\": \"Static\",\n                            \"privateIPAddress\": \"[parameters('subnet3StartAddress')]\",\n                            \"subnet\": {\n                                \"id\": \"[variables('subnet3Ref')]\"\n                            }\n                        }\n                    }\n                ],\n                \"enableIPForwarding\": true\n            }\n        },\n        {\n            \"name\": \"[concat(parameters('vmName'),'-Nic3')]\",\n            \"type\": \"Microsoft.Network\/networkInterfaces\",\n            \"apiVersion\": \"2018-08-01\",\n            \"location\": \"[parameters('location')]\",\n            \"dependsOn\": [\n                \"[concat('Microsoft.Network\/virtualNetworks\/', parameters('virtualNetworkName'))]\"\n            ],\n            \"properties\": {\n                \"ipConfigurations\": [\n                    {\n                        \"name\": \"ipconfig1\",\n                        \"properties\": {\n                            \"privateIPAllocationMethod\": \"Static\",\n                            \"privateIPAddress\": \"[parameters('subnet4StartAddress')]\",\n                            \"subnet\": {\n                                \"id\": \"[variables('subnet4Ref')]\"\n                            }\n                        }\n                    }\n                ],\n                \"enableIPForwarding\": true\n            }\n        },\n        {\n            \"name\": \"[parameters('vmName')]\",\n            \"type\": \"Microsoft.Compute\/virtualMachines\",\n            \"apiVersion\": \"2018-06-01\",\n            \"location\": \"[parameters('location')]\",\n            \"dependsOn\": [\n                \"[concat('Microsoft.Storage\/storageAccounts\/', parameters('storageAccountName'))]\",\n                \"[concat('Microsoft.Network\/networkInterfaces\/',parameters('vmName'),'-Nic0')]\",\n                \"[concat('Microsoft.Network\/networkInterfaces\/',parameters('vmName'),'-Nic1')]\",\n                \"[concat('Microsoft.Network\/networkInterfaces\/',parameters('vmName'),'-Nic2')]\",\n                \"[concat('Microsoft.Network\/networkInterfaces\/',parameters('vmName'),'-Nic3')]\"\n            ],\n            \"plan\": {\n                \"name\": \"asav-azure-byol\",\n                \"publisher\": \"cisco\",\n                \"product\": \"cisco-asav\"\n            },\n            \"properties\": {\n                \"hardwareProfile\": {\n                    \"vmSize\": \"[parameters('vmSize')]\"\n                },\n                \"osProfile\": \"[if(equals(parameters('authenticationType'),'password'), variables('osProfilepassword'), variables('osProfilesshPublicKey'))]\",\n                \"storageProfile\": {\n                    \"imageReference\": {\n                        \"publisher\": \"[variables('imagePublisher')]\",\n                        \"offer\": \"[variables('imageOffer')]\",\n                        \"sku\": \"[variables('imageSKU')]\",\n                        \"version\": \"[variables('softwareVersion')]\"\n                    },\n                    \"osDisk\": {\n                        \"name\": \"[variables('OSDiskName')]\",\n                        \"vhd\": {\n                            \"uri\": \"[concat(reference(resourceId(parameters('storageAccountRG'),'Microsoft.Storage\/storageAccounts\/', parameters('storageAccountName')), '2018-02-01').primaryEndpoints.blob,'vhds\/', variables('OSDiskName'), '.vhd')]\"\n                        },\n                        \"caching\": \"ReadWrite\",\n                        \"createOption\": \"FromImage\",\n                        \"diskSizeGB\": 9\n                    }\n                },\n                \"networkProfile\": {\n                    \"networkInterfaces\": [\n                        {\n                            \"properties\": {\n                                \"primary\": true\n                            },\n                            \"id\": \"[resourceId('Microsoft.Network\/networkInterfaces', concat(parameters('vmName'),'-Nic0'))]\"\n                        },\n                        {\n                            \"properties\": {\n                                \"primary\": false\n                            },\n                            \"id\": \"[resourceId('Microsoft.Network\/networkInterfaces', concat(parameters('vmName'),'-Nic1'))]\"\n                        },\n                        {\n                            \"properties\": {\n                                \"primary\": false\n                            },\n                            \"id\": \"[resourceId('Microsoft.Network\/networkInterfaces', concat(parameters('vmName'),'-Nic2'))]\"\n                        },\n                        {\n                            \"properties\": {\n                                \"primary\": false\n                            },\n                            \"id\": \"[resourceId('Microsoft.Network\/networkInterfaces', concat(parameters('vmName'),'-Nic3'))]\"\n                        }\n                    ]\n                },\n                \"diagnosticsProfile\": {\n                    \"bootDiagnostics\": {\n                        \"enabled\": true,\n                        \"storageuri\": \"[reference(resourceId(parameters('storageAccountRG'), 'Microsoft.Storage\/storageAccounts\/', parameters('storageAccountName')), '2018-02-01').primaryEndpoints.blob]\"\n                    }\n                }\n            }\n        }\n    ]\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This file takes the parameters.json file&#8217;s values and uses them to create Azure components.   The <strong>parameters.json<\/strong> being the ingredients and the <strong>template.json<\/strong> being the cook book if you like !<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This can be deployed using an authenticated Powershell session thus:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#Assumes files are in current path\nNew-AzResourceGroupDeployment -Name TestASAdeploy -ResourceGroupName test_ASA01_Deployment -TemplateFile template.json `-TemplateParameterFile parameters.json<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will then deploy to a new Resource Group using the parameters and template file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Follow my next post in the series about removing Public IP address from Azure deployments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For those who don&#8217;t know ARM, this is Azure Resource Manager. It is used for everything in Azure to submit changes, additions and deletions to Azure infrastructure. These are all made via a common API which takes the changes, validates, queues and reports on any change. Regardless of if you use the Azure Portal, Cloud [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[71,68,73,82],"tags":[],"class_list":["post-308","post","type-post","status-publish","format-standard","hentry","category-azure","category-cloud","category-microsoft","category-powershell","post-preview"],"_links":{"self":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=308"}],"version-history":[{"count":10,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":346,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/308\/revisions\/346"}],"wp:attachment":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}