Skip to content

Loop over created resources #5326

Answered by brwilkinson
abunnyuk asked this question in Q&A
Discussion options

You must be logged in to vote

While it is possible to just pass in X number of resources, it's not very practical to do that.

  • what if you deploy 3 the first time, then you only want to redeploy the third one by itself later on?
  • what if you need to map to different logs or serverfarms?

Another way to think about this is as follows

  • let me know if this seems reasonable for you, or else we can dive deeper into your original scenario with the range()

A few features here:

  • The if() statement for optionally deploying a resource such as logging

There is even another way to approach this which would be as follows:

  • Define and deploy a single WebSite in a Module, then call that module multiples of times from a parent bicep…

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
7 replies
@abunnyuk
Comment options

@brwilkinson
Comment options

@brwilkinson
Comment options

@abunnyuk
Comment options

@brwilkinson
Comment options

Answer selected by brwilkinson
Comment options

You must be logged in to vote
1 reply
@brwilkinson
Comment options

Comment options

You must be logged in to vote
1 reply
@abunnyuk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants