Dynamic ARM Templates with Copy Variable

Published 02-01-2021 05:03 AM 1,406 Views
Microsoft

 

Intro

Brad Watts here to talk about how we can elevate our ARM Templates to the next level using the “copy” option within our variables. When you’re starting your journey on building ARM Templates we make them more dynamic by adding Parameters to the templates. When we start building our library of templates to be used in our organization this works great for most resources but not all. For instance, creating a VM you can typically simply use Parameters and Variables. But what about an Application Gateway? You may have one Application Gateway with two backend pools and another with five backend pools. Simple Parameters and Variables aren’t flexible enough to handle this. That is where we can introduce the “copy” command in our template. 

 

What is the Copy Command? 

The Copy command simply allows me to create a variable with multiple values in an array. More importantly it allows you to dynamically create this variable instead of having to know the length of your variable ahead of time. 

 

Define multiple instances of a variable - Azure Resource Manager | Microsoft Docs 

 

How to Use the Copy Command 

Before we jump into the gritty details I want to give you a high level view of how we can utilize the copy command to make our template more dynamic. In the scenario we will walk through we will have 3 key pieces. A Parameter, variable, and resource. 

  • Parameter: this will be an array and is how we pass in the data that is needed to build our JSON array in the Copy Command. 
  • Variable: this is where we have the copy command and our variable will output a dynamic array based on the Parameter that is passed in 
  • Resource: in the resource block of the arm template you will be using the Variable in place of a JSON array 

Scenario 

This was really confusing to me when I first started looking at it so let’s walk through a real example. An Application Gateway can have multiple Backend Address Pools and the format for this section is: 

 

 

 

 

"backendAddressPools": [ 
  { 
    "name": "DisplayName",
    "properties": { 
        "backendAddresses": [ 
            "fqdn":  “server1.fqdn.com
        ]
    } 
  } 
] 

 

 

 

 

We don’t know how many items will be in the backendAddressPool (JSON array) so our goal is to create a nested template that can be used to create any Application Gateway no matter how many backendAddressesPools it has.  

 

Parameter 

First we need a Parameter that allows you to pass in the backendAddresses. We can pass them in an Array, but we need two values (DisplayName and FQDN). So, each value in the array we’ll use a delimitator. For instance, below I used “|” as the delimitator. 

 

**Note** For simplicity I kept the backendAddresses to a single fqdn 

 

Our nested template would have a Parameter named “backendPool”  

 

 

 

 

"backendAddresses": { 
  "type": "array" 
} 

 

 

 

 

If we look at this from the parent template, below is an example of how to pass in the values with 2 backend pools. Each element in the array is delaminated by the “|” with first item being the name and the second item being the fqdn: 

 

 

 

 

"backendAddresses": { 
  "value": [ 
    "Pool1|10.10.10.11", 
    “Pool2|10.10.10.12” 
  ]
} 

 

 

 

 

Variable 

Now we need to dynamically create the JSON array using the Copy Command. Lets look at the JSON for this: 

 

 

 

 

"variables": { 
  "copy": [ 
    { 
      "name": "backendAddressPools",
      "count": "[length(parameters('backendAddresses'))]",
      "input": { 
        "name": "[split(parameters('backendAddresses')[copyIndex('backendAddressPools')],'|')[0]]",
        "properties": { 
          "backendAddresses": [ 
            "fqdn": "[split(parameters('backendAddresses')[copyIndex('backendAddressPools')],'|')[1]]" 
          ]
        } 
      } 
    } 
  ] 
} 

 

 

 

 

Now let’s dissect this: 

 

  • name: This is the name of the variable that we can reference later in the template. 
  • count: This dynamically creates an array, so we need to know how many times to iterate though. In this example we are passing in an array with 2 values so that’s how many times we need to iterate through. 
  • Input: This is a single element in the JSON array that will be created. You can see that this is formatted just like a single object in the backendAddressPool element in an Application Gateway. We have two dynamic properties in this section: 
  • name: We split the parameter by the delimiter and grab the first item. So in our example it’ll be Pool1 the first time and Pool2 the second ("Pool1|10.10.10.11") 
  • fqdn: We split the parameter by the delimiter and grab the second item. So in our example it’ll be 10.10.10.11 the first time and 10.10.10.12 the second ("Pool1|10.10.10.11") 

 

So, from our example the result for the backendAddressPools variable would be: 

 

 

 

 

[ 
  { 
    "name": "Pool1", 
    "properties": { 
      "backendAddresses": [ 
        { 
          "fqdn": “10.10.10.11” 
        } 
      ] 
    } 
  }, 
  { 
    "name": "Pool2", 
    "properties": { 
      "backendAddresses": [ 
        { 
          "fqdn": “10.10.10.12” 
        } 
      ] 
    } 
  } 
] 

 

 

 

 

 

Resource 

We now have an array created using the copy command within our variables. We need to put this to use within the actual resource creation. The good news is this is the simple part. You simply use this variable in place of the JSON array in the resource. So, for our Application Gateway it would look like this: 

 

 

 

 

{ 
  "name": "[parameters('applicationGatewayName')]", 
  "type": "Microsoft.Network/applicationGateways", 
  "apiVersion": "2019-09-01", 
  "dependsOn": [], 
  "location": "[resourceGroup().location]", 
  "zones": "[parameters('zones')]", 
  "properties": { 
    ...... 
    "backendAddressPools": "[variables('backendAddressPools')]", 
    ...... 
  } 
} 

 

 

 

 

Putting it All Together 

I always think it’s good to see a complete example to hopefully tie everything together. For an example of a more dynamic way to create an Application Gateway take a look at this template: 

 

CSANestedTemplates/AppGWHTTPSListenerKV.json at main · microsoft/CSANestedTemplates (github.com) 

 

And then here is an example of a parent template that calls this as one of the nested templates: 

 

CSAAKSDeployments/2-Tier-AppGW-AKS.json at main · microsoft/CSAAKSDeployments (github.com) 

 

Summary 

This first time I saw the Copy command used in a variable I had no idea what they were doing. However, after I understood how to use it, it opened a whole new way of creating dynamic ARM Templates. Hopefully, you see the power in this command in the example I gave with the Application Gateway. It’s a great tool to have in your ARM Template toolbelt! 

%3CLINGO-SUB%20id%3D%22lingo-sub-2104631%22%20slang%3D%22en-US%22%3EDynamic%20ARM%20Templates%20with%20Copy%20Variable%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2104631%22%20slang%3D%22en-US%22%3E%3CH2%20id%3D%22toc-hId-1823924056%22%20id%3D%22toc-hId--528837679%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--728232905%22%20id%3D%22toc-hId-1958675154%22%3EIntro%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EBrad%20Watts%20here%20to%20talk%20about%20how%20we%20can%20elevate%20our%20ARM%20Templates%20to%20the%20next%20level%20using%20the%20%E2%80%9Ccopy%E2%80%9D%20option%20within%20our%20variables.%20When%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eyou%E2%80%99re%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bstarting%20your%20journey%20on%20building%20ARM%26nbsp%3BTemplates%26nbsp%3Bwe%20make%20them%20more%20dynamic%20by%20adding%20Parameters%20to%20the%20templates.%20When%20we%20start%20building%20our%20library%20of%20templates%20to%20be%20used%20in%20our%20organization%20this%20works%26nbsp%3Bgreat%26nbsp%3Bfor%20most%20resources%20but%20not%20all.%20For%20instance%2C%20creating%20a%20VM%20you%20can%20typically%20simply%20use%20Parameters%20and%20Variables.%20But%20what%20about%26nbsp%3Ban%20Application%26nbsp%3BGateway%3F%20You%20may%20have%20one%20Application%20Gateway%20with%20two%20backend%20pools%20and%20another%20with%20five%20backend%20pools.%20Simple%20Parameters%20and%20Variables%20aren%E2%80%99t%20flexible%20enough%20to%20handle%20this.%20That%20is%20where%20we%20can%20introduce%20the%20%E2%80%9Ccopy%E2%80%9D%20command%20in%20our%20template.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20aria-level%3D%222%22%20id%3D%22toc-hId-1014577430%22%20id%3D%22toc-hId-151220691%22%3E%3CSPAN%20data-contrast%3D%22none%22%3EWhat%20is%26nbsp%3Bthe%20Copy%26nbsp%3BCommand%3F%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThe%20Copy%20command%20simply%20allows%20me%20to%20create%20a%20variable%20with%20multiple%20values%20in%20an%20array.%20More%20importantly%20it%20allows%20you%20to%20dynamically%20create%20this%20variable%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Einstead%20of%20having%20to%20know%20the%20length%20of%20your%20variable%20ahead%20of%20time.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-resource-manager%2Ftemplates%2Fcopy-variables%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSPAN%20data-contrast%3D%22none%22%3EDefine%20multiple%20instances%20of%20a%20variable%20-%20Azure%20Resource%20Manager%20%7C%20Microsoft%20Docs%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20aria-level%3D%222%22%20id%3D%22toc-hId--1537579531%22%20id%3D%22toc-hId--1656233772%22%3E%3CSPAN%20data-contrast%3D%22none%22%3EHow%20to%20Use%26nbsp%3Bthe%20Copy%26nbsp%3BCommand%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EBefore%20we%20jump%20into%20the%20gritty%26nbsp%3Bdetails%26nbsp%3BI%20want%20to%20give%20you%20a%26nbsp%3Bhigh%20level%26nbsp%3Bview%20of%20how%20we%20can%20utilize%20the%20copy%20command%20to%20make%20our%20template%20more%20dynamic.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIn%20the%20scenario%20we%20will%20walk%26nbsp%3Bthrough%20we%20will%20have%26nbsp%3B3%20key%20pieces.%20A%20Parameter%2C%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Evariable%2C%20and%20resource.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20data-leveltext%3D%22%EF%82%B7%22%20data-font%3D%22Symbol%22%20data-listid%3D%223%22%20aria-setsize%3D%22-1%22%20data-aria-posinset%3D%221%22%20data-aria-level%3D%221%22%3E%3CSPAN%20data-contrast%3D%22auto%22%3EParameter%3A%20this%20will%20be%20an%20array%20and%20is%20how%20we%20pass%20in%20the%20data%20that%20is%20needed%20to%20build%20our%20JSON%20array%20in%20the%20Copy%20Command.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20data-leveltext%3D%22%EF%82%B7%22%20data-font%3D%22Symbol%22%20data-listid%3D%223%22%20aria-setsize%3D%22-1%22%20data-aria-posinset%3D%222%22%20data-aria-level%3D%221%22%3E%3CSPAN%20data-contrast%3D%22auto%22%3EVariable%3A%20this%20is%20where%20we%20have%20the%20copy%26nbsp%3Bcommand%26nbsp%3Band%20our%20variable%20will%20output%20a%20dynamic%20array%20based%20on%20the%20Parameter%20that%20is%20passed%20in%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CUL%3E%0A%3CLI%20data-leveltext%3D%22%EF%82%B7%22%20data-font%3D%22Symbol%22%20data-listid%3D%223%22%20aria-setsize%3D%22-1%22%20data-aria-posinset%3D%221%22%20data-aria-level%3D%221%22%3E%3CSPAN%20data-contrast%3D%22auto%22%3EResource%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ein%20the%20resource%20block%20of%20the%20arm%26nbsp%3Btemplate%26nbsp%3Byou%20will%20be%20using%20the%20Variable%20in%20place%20of%20a%20JSON%20array%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20aria-level%3D%222%22%20id%3D%22toc-hId-205230804%22%20id%3D%22toc-hId-831279061%22%3E%3CSPAN%20data-contrast%3D%22none%22%3EScenario%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThis%20was%20really%20confusing%20to%20me%20when%20I%20first%20started%20looking%20at%20it%20so%20let%E2%80%99s%20walk%20through%20a%20real%20example.%20An%20Application%20Gateway%20can%20have%20multiple%20Backend%20Address%20Pools%20and%20the%20format%20for%20this%20section%20is%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%22backendAddressPools%22%3A%20%5B%26nbsp%3B%0A%20%20%7B%26nbsp%3B%0A%20%20%20%20%22name%22%3A%20%22DisplayName%22%2C%0A%20%20%20%20%22properties%22%3A%20%7B%26nbsp%3B%0A%20%20%20%20%20%20%20%20%22backendAddresses%22%3A%20%5B%26nbsp%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22fqdn%22%3A%20%26nbsp%3B%E2%80%9Cserver1.fqdn.com%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%7D%26nbsp%3B%0A%20%20%7D%26nbsp%3B%0A%5D%26nbsp%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EWe%20don%E2%80%99t%20know%20how%20many%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eitems%20will%20be%20in%20the%26nbsp%3BbackendAddressPool%26nbsp%3B(JSON%20array)%20so%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eour%20goal%20is%20to%20create%20a%20nested%20template%20that%20can%20be%20used%20to%20create%20any%20Application%20Gateway%20no%20matter%20how%20many%26nbsp%3BbackendAddresses%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EPools%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bit%20has.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20aria-level%3D%222%22%20id%3D%22toc-hId-1948041139%22%20id%3D%22toc-hId--976175402%22%3E%3CSPAN%20data-contrast%3D%22none%22%3EParameter%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EFirst%26nbsp%3Bwe%20need%20a%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EParameter%20that%20allows%20you%20to%20pass%20in%20the%26nbsp%3BbackendAddresses%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%20We%20can%20pass%20them%20in%20an%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EArray%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bbut%20we%20need%20two%20values%20(DisplayName%20and%20FQDN).%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3ESo%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Beach%20value%20in%20the%20array%20we%E2%80%99ll%20use%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Ba%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Edelimitator%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%20For%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Einstance%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bbelow%20I%20used%20%E2%80%9C%7C%E2%80%9D%20as%20the%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Edelimitator%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CI%3E%3CSPAN%20data-contrast%3D%22auto%22%3E**Note**%20For%20simplicity%20I%20kept%20the%26nbsp%3BbackendAddresses%26nbsp%3Bto%20a%20single%26nbsp%3Bfqdn%3C%2FSPAN%3E%3C%2FI%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EOur%20nested%20template%20would%20have%20a%20Parameter%20named%20%E2%80%9CbackendPool%E2%80%9D%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%22backendAddresses%22%3A%20%7B%26nbsp%3B%0A%20%20%22type%22%3A%20%22array%22%26nbsp%3B%0A%7D%26nbsp%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EIf%20we%20look%20at%20this%20from%20the%20parent%20template%2C%20below%20is%20an%20example%20of%20how%20to%20pass%20in%20the%20values%20with%202%20backend%20pools%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%20Each%20element%20in%20the%20array%20is%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Edelaminated%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bby%20the%20%E2%80%9C%7C%E2%80%9D%20with%20first%20item%20being%20the%20name%20and%20the%20second%20item%20being%20the%26nbsp%3Bfqdn%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%22backendAddresses%22%3A%20%7B%26nbsp%3B%0A%20%20%22value%22%3A%20%5B%26nbsp%3B%0A%26nbsp%3B%20%20%20%22Pool1%7C10.10.10.11%22%2C%26nbsp%3B%0A%20%20%20%20%E2%80%9CPool2%7C10.10.10.12%E2%80%9D%26nbsp%3B%0A%20%20%5D%0A%7D%26nbsp%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20aria-level%3D%222%22%20id%3D%22toc-hId--604115822%22%20id%3D%22toc-hId-1511337431%22%3E%3CSPAN%20data-contrast%3D%22none%22%3EVariable%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ENow%20we%20need%20to%20dynamically%20create%20the%20JSON%20array%20using%20the%20Copy%20Command.%26nbsp%3BLets%26nbsp%3Blook%20at%20the%20JSON%20for%20this%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%22variables%22%3A%20%7B%26nbsp%3B%0A%20%20%22copy%22%3A%20%5B%26nbsp%3B%0A%20%20%26nbsp%3B%26nbsp%3B%7B%26nbsp%3B%0A%20%20%20%20%20%20%22name%22%3A%20%22backendAddressPools%22%2C%0A%20%20%20%20%20%20%22count%22%3A%20%22%5Blength(parameters('backendAddresses'))%5D%22%2C%0A%20%20%20%20%20%20%22input%22%3A%20%7B%26nbsp%3B%0A%20%20%20%20%20%20%20%20%22name%22%3A%20%22%5Bsplit(parameters('backendAddresses')%5BcopyIndex('backendAddressPools')%5D%2C'%7C')%5B0%5D%5D%22%2C%0A%20%20%20%20%20%20%20%20%22properties%22%3A%20%7B%26nbsp%3B%0A%20%20%20%20%20%20%20%20%20%20%22backendAddresses%22%3A%20%5B%26nbsp%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22fqdn%22%3A%20%22%5Bsplit(parameters('backendAddresses')%5BcopyIndex('backendAddressPools')%5D%2C'%7C')%5B1%5D%5D%22%26nbsp%3B%0A%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20%7D%26nbsp%3B%0A%20%20%20%20%20%20%7D%26nbsp%3B%0A%20%20%20%20%7D%26nbsp%3B%0A%20%20%5D%26nbsp%3B%0A%7D%26nbsp%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ENow%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Elet%E2%80%99s%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bdissect%20this%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20data-leveltext%3D%22%EF%82%B7%22%20data-font%3D%22Symbol%22%20data-listid%3D%222%22%20aria-setsize%3D%22-1%22%20data-aria-posinset%3D%221%22%20data-aria-level%3D%221%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3En%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eame%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThis%20is%20the%20name%20of%20the%20variable%20that%20we%20can%20reference%20later%20in%20the%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Etemplate.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20data-leveltext%3D%22%EF%82%B7%22%20data-font%3D%22Symbol%22%20data-listid%3D%222%22%20aria-setsize%3D%22-1%22%20data-aria-posinset%3D%222%22%20data-aria-level%3D%221%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ec%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eount%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThis%20dynamically%20creates%20an%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Earray%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bso%20we%20need%20to%20know%20how%20many%20times%20to%20iterate%20though.%20In%20this%20example%20we%20are%20passing%20in%20an%20array%20with%202%20values%20so%20that%E2%80%99s%20how%20many%20times%20we%20need%20to%20iterate%20through.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20data-leveltext%3D%22%EF%82%B7%22%20data-font%3D%22Symbol%22%20data-listid%3D%222%22%20aria-setsize%3D%22-1%22%20data-aria-posinset%3D%223%22%20data-aria-level%3D%221%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3EInput%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThis%20is%20a%20single%20element%20in%20the%20JSON%20array%20that%20will%20be%20created%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E.%20You%20can%20see%20that%20this%20is%20formatted%20just%20like%20a%20single%20object%20in%20the%26nbsp%3BbackendAddressPool%26nbsp%3Belement%20in%20an%20Application%20Gateway.%20We%20have%20two%20dynamic%20properties%20in%20this%20section%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CUL%3E%0A%3CLI%20data-leveltext%3D%22o%22%20data-font%3D%22Courier%20New%22%20data-listid%3D%222%22%20aria-setsize%3D%22-1%22%20data-aria-posinset%3D%221%22%20data-aria-level%3D%222%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3Ename%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3BWe%20split%20the%20parameter%20by%20the%20delimiter%20and%20grab%20the%20first%20item.%26nbsp%3BSo%26nbsp%3Bin%20our%20example%20it%E2%80%99ll%20be%20Pool1%20the%20first%20time%20and%20Pool2%20the%20second%20(%22%3C%2FSPAN%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3EPool1%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%7C10.10.10.11%22)%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%20data-leveltext%3D%22o%22%20data-font%3D%22Courier%20New%22%20data-listid%3D%222%22%20aria-setsize%3D%22-1%22%20data-aria-posinset%3D%222%22%20data-aria-level%3D%222%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3Efqdn%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3BWe%20split%20the%20parameter%20by%20the%20delimiter%20and%20grab%20the%20second%20item.%26nbsp%3BSo%26nbsp%3Bin%20our%20example%20it%E2%80%99ll%20be%2010.10.10.11%20the%20first%20time%20and%2010.10.10.12%20the%20second%20(%22%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EPool1%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%7C%3C%2FSPAN%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3E10.10.10.11%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%22)%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B134233279%26quot%3B%3Atrue%2C%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3ESo%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bfrom%20our%20example%20the%20result%20for%20the%26nbsp%3BbackendAddressPools%26nbsp%3Bvariable%20would%20be%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%5B%26nbsp%3B%0A%20%20%7B%26nbsp%3B%0A%20%20%20%20%22name%22%3A%20%22Pool1%22%2C%26nbsp%3B%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22properties%22%3A%20%7B%26nbsp%3B%0A%20%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22backendAddresses%22%3A%20%5B%26nbsp%3B%0A%20%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%26nbsp%3B%0A%20%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22fqdn%22%3A%20%E2%80%9C10.10.10.11%E2%80%9D%26nbsp%3B%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%26nbsp%3B%0A%20%20%20%20%20%20%5D%26nbsp%3B%0A%20%20%20%20%7D%26nbsp%3B%0A%20%20%7D%2C%26nbsp%3B%0A%20%20%7B%26nbsp%3B%0A%20%20%20%20%22name%22%3A%20%22Pool2%22%2C%26nbsp%3B%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22properties%22%3A%20%7B%26nbsp%3B%0A%20%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22backendAddresses%22%3A%20%5B%26nbsp%3B%0A%20%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%26nbsp%3B%0A%20%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22fqdn%22%3A%20%E2%80%9C10.10.10.12%E2%80%9D%26nbsp%3B%0A%20%20%20%20%20%20%20%20%7D%26nbsp%3B%0A%20%20%20%20%20%20%5D%26nbsp%3B%0A%20%20%20%20%7D%26nbsp%3B%0A%20%20%7D%26nbsp%3B%0A%5D%26nbsp%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20aria-level%3D%222%22%20id%3D%22toc-hId-1138694513%22%20id%3D%22toc-hId--296117032%22%3E%3CSPAN%20data-contrast%3D%22none%22%3EResource%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EWe%20now%20have%20a%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3En%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Barray%20created%20using%20the%20copy%20command%20within%20our%20variables.%20We%20need%20to%20put%20this%20to%20use%20within%20the%20actual%20resource%20creation.%20The%20good%20news%20is%20this%20is%20the%20simple%20part.%20You%20simply%20use%20this%20variable%20in%20place%20of%20the%20JSON%20array%20in%20the%20resource.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3ESo%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Bfor%20our%20Application%20Gateway%20it%20would%20look%20like%20this%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%26nbsp%3B%0A%20%20%22name%22%3A%20%22%5Bparameters('applicationGatewayName')%5D%22%2C%26nbsp%3B%0A%20%20%22type%22%3A%20%22Microsoft.Network%2FapplicationGateways%22%2C%26nbsp%3B%0A%20%20%22apiVersion%22%3A%20%222019-09-01%22%2C%26nbsp%3B%0A%20%20%22dependsOn%22%3A%20%5B%5D%2C%26nbsp%3B%0A%20%20%22location%22%3A%20%22%5BresourceGroup().location%5D%22%2C%26nbsp%3B%0A%20%20%22zones%22%3A%20%22%5Bparameters('zones')%5D%22%2C%26nbsp%3B%0A%20%20%22properties%22%3A%20%7B%26nbsp%3B%0A%20%20%20%20......%26nbsp%3B%0A%20%20%20%20%22backendAddressPools%22%3A%20%22%5Bvariables('backendAddressPools')%5D%22%2C%26nbsp%3B%0A%20%20%20%20......%26nbsp%3B%0A%20%20%7D%26nbsp%3B%0A%7D%26nbsp%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A240%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20aria-level%3D%222%22%20id%3D%22toc-hId--1413462448%22%20id%3D%22toc-hId--2103571495%22%3E%3CSPAN%20data-contrast%3D%22none%22%3EPutting%20it%20All%20Together%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EI%20always%20think%20it%E2%80%99s%20good%20to%20see%20a%20complete%20example%20to%20hopefully%20tie%20everything%20together.%20For%20an%20example%20of%20a%20more%20dynamic%20way%20to%20create%20an%20Application%20Gateway%26nbsp%3Btake%20a%20look%26nbsp%3Bat%20this%20template%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FCSANestedTemplates%2Fblob%2Fmain%2FTemplates%2FAppGWHTTPSListenerKV.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSPAN%20data-contrast%3D%22none%22%3ECSANestedTemplates%2FAppGWHTTPSListenerKV.json%20at%20main%20%C2%B7%20microsoft%2FCSANestedTemplates%20(github.com)%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EAnd%20then%20here%20is%20an%20example%20of%20a%20parent%20template%20that%20calls%20this%20as%20one%20of%20the%20nested%20templates%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FCSAAKSDeployments%2Fblob%2Fmain%2F2-Tier-AppGW-AKS.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSPAN%20data-contrast%3D%22none%22%3ECSAAKSDeployments%2F2-Tier-AppGW-AKS.json%20at%20main%20%C2%B7%20microsoft%2FCSAAKSDeployments%20(github.com)%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20aria-level%3D%222%22%20id%3D%22toc-hId-329347887%22%20id%3D%22toc-hId-383941338%22%3E%3CSPAN%20data-contrast%3D%22none%22%3ESummary%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22auto%22%3EThis%20first%20time%20I%20saw%20the%20Copy%20command%20used%20in%20a%20variable%20I%20had%20no%20idea%20what%20they%20were%20doing.%20However%2C%20after%20I%20understood%20how%20to%20use%20it%2C%20it%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3Eopened%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Ba%20whole%20new%20way%20of%20creating%20dynamic%20ARM%20Templates.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3EHopefully%2C%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22auto%22%3E%26nbsp%3Byou%20see%20the%20power%20in%20this%20command%20in%20the%20example%20I%20gave%20with%20the%20Application%20Gateway.%20It%E2%80%99s%20a%20great%20tool%20to%20have%20in%20your%20ARM%20Template%20toolbelt!%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2104631%22%20slang%3D%22en-US%22%3E%3CP%3ETake%20your%20ARM%20Templates%20to%20the%20next%20level%20utilizing%20the%20copy%20variable%20to%20make%20them%20more%20dynamic.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2104631%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Ebradwatts%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Feb 01 2021 05:32 AM
Updated by: