Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterating over a deferred value in a for loop generates an invalid ARM template #2090

Closed
anthony-c-martin opened this issue Mar 31, 2021 · 1 comment · Fixed by #2461
Closed
Assignees
Labels
bug Something isn't working revisit
Projects
Milestone

Comments

@anthony-c-martin
Copy link
Member

Created from discussion #2072

The following doesn't work (gives template function 'reference' is not expected at this location at deploy time):

output snetIds array = [for subnet in vnet.properties.subnets: {
  subName: subnet.name
  subId: subnet.id
}]

Instead, the following must be used:

output snetIds array = [for i in range(0,length(subnets)): {
  subName: vnet.properties.subnets[i].name
  subId: vnet.properties.subnets[i].id
}]
@majastrz
Copy link
Member

This is somewhat related to #2391

@shenglol shenglol added this to the v0.4 milestone Apr 27, 2021
@shenglol shenglol added this to In progress in 0.4 release Apr 27, 2021
shenglol added a commit that referenced this issue Apr 29, 2021
@stephaniezyen stephaniezyen moved this from In progress to In Review in 0.4 release Apr 29, 2021
shenglol added a commit that referenced this issue Apr 29, 2021
…fixes (#2461)

* Fix issue #2391.

* Fix issue #2090 and #1699

* for-loop expression => for-expression
@alex-frankel alex-frankel moved this from In Review to Done in 0.4 release May 3, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working revisit
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants