bicep
bicep copied to clipboard
Support nested and runtime for-loops by generating `lambda()` instead of `copy` properties
Once #7083 has been merged and is fully supported in the Deployment engine, it should be possible to codegen an alternative to "copy", using map(). This should allow us to relax the limitation that property copy loops cannot be nested, and must be calculated at deploy time.
For example, both nested and runtime are currently blocked in the following sample:
resource foo 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
name: 'foo'
}
var nested = [for item in range(0, 10): {
array: [for item2 in range(0, 10): item2]
}]
var runtime = [for item in items(foo.properties.secondaryEndpoints): {
endpointType: item.key
}]
Related: #6863, #4555, #7273
Any idea when this might be enabled? We really see a need for nested loops in our work
We need nested loops as well.