I have an Azure blueprint, which deploys an Azure ACR Cluster. Creating the cluster also triggers creating of the publicIPAddresses of the cluster. I need to get the Resource Id of that IP to be able to automate assigning a DNS/A record to that IP.
I thought about this output record in the artifact, which creates ACR Cluster:
"outputs": {
"IPAddress": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))).id]"
},
}
, which as I thought could help me dynamically get that Resource ID, but it doesn't seem to be working. Can somebody point, what am I doing wrong?
Thank you!
Try adding 'Full' to your reference() function call, which instructs the call to return all properties, including the id.
see: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-resource?tabs=json#reference