Skip to content

Can I loop over existing resources and extract a property? #5009

Answered by alex-frankel
oskbor asked this question in Q&A
Discussion options

You must be logged in to vote

Looks like an issue with our variable replacement logic. ARM has strict rules on when runtime values can be used in variables (and other locations), which is what you are being affected. In Bicep we do some magic to remove the variable in the generated template and "hardcode" the variable value wherever it is used. For some reason that is not happening here. @miqm / @anthony-c-martin -- can you take a look and see if we should convert this to an issue?

The workaround would be to not use a variable and move this code to wherever you plan to consume the variable. For example, if I want to output this value, this seems to work:

var envVars = [
  'BASE_FRONT_END_URL'
  'AZURE_VOLUME_BASE_URL'

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@brwilkinson
Comment options

@brwilkinson
Comment options

@brwilkinson
Comment options

@brwilkinson
Comment options

@oskbor
Comment options

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