Skip to content

concat NSG rules #5883

Answered by brwilkinson
dampfhamm3r asked this question in Q&A
Feb 5, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

There is a sample here, that uses a lookup table and also union that allows two, or more sets of nsg rules to be merged.

Some are defaults in the same file, others may come from parameters etc.

https://github.com/brwilkinson/AzureDeploymentFramework/blob/main/ADF/bicep/NSG.bicep#L291

Both of these are optional i.e. default rules or from the param file or other place.

var NSGInfo = [for (subnet, index) in subnetInfo: {
  match: ((Global.CN == '.') || contains(Global.CN, subnet.name))
  subnetNSGParam: contains(subnet, 'securityRules') ? subnet.securityRules : []
  subnetNSGDefault: contains(NSGDefault, subnet.name) ? NSGDefault[subnet.name] : []
}]

Essentially if they exist they are used, …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dampfhamm3r
Comment options

@brwilkinson
Comment options

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