Parameter value based on an Environment Variable, as an Array #13898
              
  
  Closed
              
          
                  
                    
                      wk7804
                    
                  
                
                  started this conversation in
                Authoring Help
              
            Replies: 1 comment 1 reply
-
| Apparently the solution was so obvious that I complete overlooked it :-{ Defining the environment variable like this: Then adding this: Finally looping over the result did exactly what I needed. | 
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to define an environment variable whose value would be treated as an array when processing my Bicep template.
I am using 'az deployment sub create' command that is executed by a Bash script that is defining and exporting environment variables .
I am also using a .bicepparam file where the parameter values are all being provided by readEnvironmentVariable().
In my specific case, I have 1 or more IP Address Prefixes where each need to be used in a separate outbound NSG Rule.
If I was defining the array directly in the .bicepparam file, it might look like this:
I would then loop through these prefixes, using each in a separate rule:
What I am struggling with is how to provide a value that can be treated as an array when in the .biccepparm file I have this:
I started with the approach below, and tried several variations, none of which result in an array containing each prefix as an individual entry:
Put another way, the question could be: "How can I parse a multi-value string into an array with Bicep?".
Any suggestions would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions