Azure / Azure/bicep

Allow property iteration for runtime properties

Open
#4,666 2 comments 4 reactions 0 assignees View on GitHub
enhancement intermediate language
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

Originally discussed in #4555

---

Today, you cannot provide an array from a runtime reference to a loop like so:

```bicep
resource childDomain 'Microsoft.Network/dnsZones@2018-05-01' = {
name: 'child.${baseDomainName}-domain.io'
location: location
}

resource childDomainDelegation 'Microsoft.Network/dnsZones/NS@2018-05-01' = {
name: '${baseDomainName}-domain.io/child'
properties: {
// *** not allowed since childDomain.properties.nameServers is a runtime reference ***
NSRecords: [for dnsServer in childDomain.properties.nameServers: {
nsdname: dnsServer
}]
}
}
```

But it sure would be nice if you could! Otherwise, you need to hack around this limitation with modules as discussed in the referenced issue.

Contributor guide

Open the contributing guide

Research direction

Start with the runtime property and loop behavior shown in this issue, then read the workaround discussed in #4555. Define how childDomain.properties.nameServers can be iterated in the NSRecords expression; the work is done when the shown expression is accepted and produces the expected DNS delegation records.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, devtools, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.