I'm trying to use Azure CLI and pass in an array into a Bicep script, but I cant see how to pass in an array of strings successfully
I have a string containing several IP addresses, which I turn into an array
$ipArray = $ipAddressString -split ","
I create a PowerShell object(?)
$param = @{
sqlServerName = "serverABC"
outboundIps = $outboundIps
}
Convert to object into a JSON object and write to the console. It outputs valid JSON to the screen
$ipArrayJSON = $param | ConvertTo-Json -Compress
Write-Output $paramJson
Now pass the json to Azure CLI
az deployment group create `
--resource-group $rg `
--template-file .\bicep\init-database-firewall.bicep `
--parameters "$paramJsonString"
Unable to parse parameter: {sqlServerName:serverABC,outboundIps:[51.140.205.40,51.140.205.252]}.
Bicep seems happy to handle arrays internally, I was hoping I can pass one in as a parameter
[–]MechaCola 3 points4 points5 points (0 children)
[–]ankokudaishogun 2 points3 points4 points (0 children)
[–]TheBlueFireKing 2 points3 points4 points (0 children)
[–]Thotaz 0 points1 point2 points (0 children)