ARM Templates Copy Loops | Create multiple instances of resources, properties and variables

Поділитися
Вставка
  • Опубліковано 24 лип 2024
  • With Copy Elements you can deploy multiple instances of your resources or properties, all in a single Resource Manager template.
    In this episode I give you introduction to instance multiplication using copy elements and show you practical examples of applying this practice for resources, properties, parameters, variables and outputs.
    Source code for demos: github.com/MarczakIO/azure4ev...
    In this episode live demo of
    - Deploying multiple Storage Accounts
    - Deploying multiple Storage Accounts using parameters
    - Creating dependencies
    - Deploying multiple child resources
    - Creating array variables using copy element
    - Creating array outputs using copy element
    - Creating resource properties using copy element
    Next steps for you after watching the video
    1. Multiple resources docs
    - docs.microsoft.com/en-us/azur...
    2. Multiple properties docs
    - docs.microsoft.com/en-us/azur...
    3. Multiple variables docs
    - docs.microsoft.com/en-us/azur...
    4. Multiple outputs docs
    - docs.microsoft.com/en-us/azur...
    5. Multiple instances of resource docs
    - docs.microsoft.com/en-us/azur...
    Want to connect?
    - Blog marczak.io/
    - Twitter / marczakio
    - Facebook / marczakio
    - LinkedIn / adam-marczak
    - Site azure4everyone.com
  • Наука та технологія

КОМЕНТАРІ • 44

  • @volfram1
    @volfram1 Рік тому

    Thank you Adam for the content. There are a lot of object-oriented programming concepts here. I don't know about others but those long strings are killing me. When I finish reading them I almost forget what were they doing in the first place.

  • @gajulanavateja678
    @gajulanavateja678 4 роки тому +1

    Thanks a ton for making all these videos, it helps so many folks and students who cannot effort to buy online courses. Thanks again.

  •  2 роки тому

    A big thanks to you for these. Great content with great examples!

  • @stevelee4958
    @stevelee4958 4 роки тому +2

    Thanks so much for sharing this. Really helpful.

  • @muthukumarshanmugasundaram8360
    @muthukumarshanmugasundaram8360 2 роки тому

    Good Video @Adam. Perfectly expalined

  • @Devotionalandhealthylife
    @Devotionalandhealthylife Рік тому

    Great tutorial thankyou for clear explanation adam

  • @TheRockportcity
    @TheRockportcity 3 роки тому

    You are the KING of ARM !!
    Keep up the good work mahn and thank you for taking time out and creating something useful for the community.

  • @vipullende
    @vipullende 3 роки тому

    Thank you so much for the Video Adam, its very helpful.
    Could you please also create a video on creating multiple VM using a ARM template and Loop.

    • @AdamMarczakYT
      @AdamMarczakYT  3 роки тому

      Thanks for the kind words. Unfortunately this scenario is not much different from copying multiple storage account. It is surely more complex because there are more components required for a VM but the technical knowledge required is the same. Since it doesn't require a new skill set I'm not sure if it constitutes a separate video. Thanks for the suggestion though. Keep up the good work!

    • @pkz001
      @pkz001 3 роки тому

      @@AdamMarczakYT Thanks for the video. even i had similar question but i guess i need to learn a bit more and apply the info from this video for multi VM deployment.

  • @nabilgremny9344
    @nabilgremny9344 2 роки тому

    Thank you for this great resource. I have a question about Disaster recovery, what is the best method to replicate all the infrastructure (vnet, subnet, disks, vm, etc ) instead of jus replicating VMs? Thanks a lot

  • @nareshg-vq6gp
    @nareshg-vq6gp Рік тому

    Hi Adam, Really appreciated your video, I have one doubt, how container names comes container1,container2..., we have added the concadination with "Storage",uniquestring, as well right ??

  • @ahmadmasalhags6428
    @ahmadmasalhags6428 Рік тому

    What about nested copy?
    I need to deploy a Pipelines of Azure Data Factory. Each pipeline has its own array of "source endpoints", with different lengths. So not only I need to iterate over the pipelines, I need to iterate over each "source endpoint" it has. Anyway to do this?

  • @pankajiae1978
    @pankajiae1978 2 роки тому

    Good details

  • @songangte29
    @songangte29 4 роки тому

    Thank you so much for this Adam, very helpful. I have a question:
    Instead of using functions to generate names, what if I have a static set of names I already have, like storage-germany, storage-india... storage-singapore .. many names in array? How do i specify these in an array or object?

    • @AdamMarczakYT
      @AdamMarczakYT  4 роки тому

      This was shown as one of the demos in the video. Did you watch it entirely?

  • @zohaibzafar7378
    @zohaibzafar7378 2 роки тому

    Hi,
    Question: i create 2 VMs with a name using instance count and VMs 1 and 2 created,,, fine . but when I run the template again with same VM name it should start the VM name from 3,4 ... as I have already created VMs 1 and 2 in earlier run... please advise?

  • @mrityunjayanaik3617
    @mrityunjayanaik3617 2 роки тому

    I'm trying to generate the ARM template for ADF migration but every time its creating 2 files in which json is randomly split between 2 files withn names ARM_0.json and ARM_1.json. How to create a single file?

  • @humanbot5247
    @humanbot5247 3 роки тому +1

    Amazing ! ! !

  • @nero787
    @nero787 2 роки тому

    Do you have an example like this but with Azure vms?

  • @mooncake4511
    @mooncake4511 3 роки тому +1

    Can I use copy to loop over an array for access policies in keyvaults ?

    • @AdamMarczakYT
      @AdamMarczakYT  3 роки тому

      Yep :)
      stackoverflow.com/questions/53323560/looping-through-values-in-arm-templates

  • @chandrashekhar2461
    @chandrashekhar2461 3 роки тому

    Thank you so much ...how can we create multiple subnets inside Vnet using above?

    • @AdamMarczakYT
      @AdamMarczakYT  3 роки тому

      Create a subnet resource and use copy look to multiply it. It's a bit trickier because you need to generate address spaces properly github.com/Azure/azure-quickstart-templates/blob/master/101-vnet-two-subnets/azuredeploy.json

  • @GustavoMartinezgusmb
    @GustavoMartinezgusmb 3 роки тому

    Hi Adam, great examples. I am trying to get around creating load balancing rules on a MLB, using copy loops for that property (loadBalancingRules). I have a variable (numApplications) and for each application I must create 2 rules (http_access_appx and https_access_appx). With copy loops I am able to create one of the rules for all applications, but having trouble to create both rules, as I cannot use the copy loops multiple times inside the same resource...
    How would you recommend doing this?
    Thanks, and congrats for the great tutorials

    • @AdamMarczakYT
      @AdamMarczakYT  3 роки тому

      Hey, thanks! If you always create only 2 rules then why use copy loops in the first place :) but if you really insist check my response on reddit on similar example www.reddit.com/r/AZURE/comments/fkxlbs/nested_arm_template_with_copy/

    • @GustavoMartinezgusmb
      @GustavoMartinezgusmb 3 роки тому

      @@AdamMarczakYT thanks Adam! I think modulo function gives me an idea of how to solve it, awesome:)
      I have to use loops because the it depends on number of applications. If this number is 20, I am creating 40 loadBalancingRules in one go (20 for http and 20 for https).
      Cheers

  • @morrigandeep1313
    @morrigandeep1313 4 роки тому

    the best explanation as always, sorry but in the min 5:48 the value of the second object need to be value1 instead of value2 right?

    • @AdamMarczakYT
      @AdamMarczakYT  4 роки тому +1

      Correct, a small typo! Good catch :)

  • @LencoTB
    @LencoTB 4 роки тому

    How would one get the storage queue endpoints? I have tried this:
    "storageQueueNames": {
    "type": "array",
    "copy": {
    "count": "[length(parameters('storageQueueNames'))]",
    "input": "[reference(resourceId('Microsoft.Storage/storageAccounts', variables('storage_account_name'), '/default'), copyIndex('copyQueues')).primaryEndpoints.queue]"
    }
    }

    • @LencoTB
      @LencoTB 4 роки тому

      What I meant to say, if I have used your example 04-storage-child-resources.json and created storage queues instead of blobContainers, then how would I ouput these queue endpoint in the outputs section?

    • @AdamMarczakYT
      @AdamMarczakYT  4 роки тому

      Hey, there are few examples here. You are almost done, your resourceid might be incorrect. docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-resource#reference-example

  • @ViktorPonomarov
    @ViktorPonomarov 6 місяців тому

    👍

  • @DureSameen
    @DureSameen 3 роки тому +1

    Very detailed and nice content, do you have a course on Pluralsight or Udemy?

    • @AdamMarczakYT
      @AdamMarczakYT  3 роки тому +2

      No, sorry, all my content is free and available on YT :)

    • @DureSameen
      @DureSameen 3 роки тому

      @@AdamMarczakYT This is simply great, can you please do a video on Azure bicep language. it would be very good help.

  • @gajulanavateja678
    @gajulanavateja678 4 роки тому

    Can you make videos on Azure CDN, please

    • @AdamMarczakYT
      @AdamMarczakYT  4 роки тому +2

      I will definitely cover CDN. But there are so many more common/cool services on the list. Like synapse analytics, api management, log analytics and KQL, cognitive services, etc. But CDN will eventually get here.

  • @abdulthakur5608
    @abdulthakur5608 3 роки тому +1

    feel sad, such amazing video only has 3k view and a video with a girl in bikini would have 3 million view, hahahha, its a joke

  • @shubhamkumar_noob_cs-go_pl581
    @shubhamkumar_noob_cs-go_pl581 11 місяців тому

    Not explained properly at all.