Forum Discussion
ARM Template To create Multiple NSG's associate with existing Subnet
- Nov 17, 2020
Hi!
I've put together a template for you that solves your problem using copy loops for both the NSGs and the subnet association. You can find it here: https://gist.github.com/StefanIvemo/31cda6faa214824b2049a1e98f0e279b
I've created a parameter called NSGs of the type array in the template. Take a look at the example parameter file and adjust it to your needs. All you have to do is add/remove objects to the array and fill in NSGName, SubnetName and your SecurityRules.
The template will first deploy all the NSGs and then do a nested deployment to do the subnet association.
Good luck with your deployment!
Hi!
I've put together a template for you that solves your problem using copy loops for both the NSGs and the subnet association. You can find it here: https://gist.github.com/StefanIvemo/31cda6faa214824b2049a1e98f0e279b
I've created a parameter called NSGs of the type array in the template. Take a look at the example parameter file and adjust it to your needs. All you have to do is add/remove objects to the array and fill in NSGName, SubnetName and your SecurityRules.
The template will first deploy all the NSGs and then do a nested deployment to do the subnet association.
Good luck with your deployment!