I am deploying Vms to Azure with an ARM template. In my parameters file I have:
"nodePrivateIps": {
"value": [
{ "IpAddress": "10.0.10.1" },
{ "IpAddress": "10.0.10.2" },
{ "IpAddress": "10.0.10.3" }
]
},
I am able to use this array in the template with:
"privateIPAddress": "[parameters('nodePrivateIps')[copyIndex()].IpAddress]",
Problem is now I need to pass that same array to my powershell script by using a CustomScriptExtension but it doesn't seem to like the array parameter.
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.4",
"settings": {
"fileUris": [
"[concat(parameters('_artifactsLocation'),'/SolrCloudSetup.ps1', parameters('_artifactsLocationSasToken'))]"
],
"commandToExecute": "[concat('powershell.exe -ExecutionPolicy Unrestricted -Command .\\SolrCloudSetup.ps1 ', parameters('nodePrivateIps'))]"
}
}
This is my powershell script parameter that's currently expecting an array. I can easily change that to comma separated string if I get the ARM to cooperate.
# SolrCloudSetup.ps1 -----------------------
param (
[array] [Parameter(Mandatory=$true)] $solrNodeIps
)
Is there a way to convert this array parameter into a comma separated string so that I can pass it through the CustomScriptExtension to my powershell script?