I have an OUTPUTS section in my template:
"outputs": {
"MasterFirstIPConfig": {
"type": "string",
"value": "[reference(variables('masterVM'),'2016-09-01').ipConfigurations[0].properties.privateIPAddress]"
}
}
And it works as expected - I see VM's Private IP.
Next - I'd like to use this IP as an argument to CustomScript
extension, which looks like:
"settings": {
"fileUris": [
"https://utils.blob.core.windows.net/scripts/swarm_master_provision.sh"
],
"commandToExecute": "[concat('bash swarm_master_provision.sh ', reference(variables('masterVM'),'2016-09-01').ipConfigurations[0].properties.privateIPAddress)]"
},
The problem here is that reference()
lead to dependency error:
error: InvalidTemplate : Deployment template validation failed: 'Circular dependency detected on resource: '/subscriptions/0a4f2b9c-***-40b17ef8c3ab/resourceGroups/jm-web-test-var-1/providers/Microsoft.Compute/virtualMachineScaleSets/jm-web-test-var-1-master-vmss'. Please see https://aka.ms/arm-template/#resources for usage details.'.
So question is - how can I pass private IP to the script?
joint
for workers and additional managers via script. But to do it - need to obtain any manager's IP, wich was deployed to master's VMSS and pass it as an argument to theCustomScript
. – setevoy