Key Vault IPRules - Can't Convert CSV String to Right Format #8444
-
I've been working on a Bicep template that is deploying a function app with a corresponding key vault and app configuration store. One problem that is arising is in the IPRules property under networkACls for the Key Vault. The goal is to take the possibleOutboundIpAddresses from the function app and apply those IPs to the Key Vault ACL As per the resource requirements, the IPRules takes an array of multiple JSON objects with a single key-value pair for each IP address. But, I have tried multiple ways to get Bicep to not generate a type error while still getting the compiled ARM template to deploy successfully. See a sample below for what this would be if I statically configured the object.
So, what I am trying to do is something along this line The functionApp.properties.possibleOutboundIpAddresses has a value of say '1.1.1.1,2.2.2.2' in CSV format. I am trying to use string manipulation to convert the CSV into an array format with JSON objects, see a sample below
But, this particular value generates the following warning in VS Code: 'The property "ipRules" expected a value of type "IPRule[] | null" but the provided value is of type "string". If this is an inaccuracy in the documentation, please report it to the Bicep Team.' So, I thought this was the scenario where an any() function might help, but when I use this:
I get this type of error when the template deploys: New-AzResourceGroupDeployment: ...The deployment 'template' failed with error(s). Showing 1 out of 1 error(s). Is this as simple as needing the Bicep team to address the type mismatch (at #784) or is there a syntax solution to this? Thank you for any help someone can give. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There is a split and join methods. Are you able to split the string on the comma |
Beta Was this translation helpful? Give feedback.
-
Answer
|
Beta Was this translation helpful? Give feedback.
Answer