question

stefanolivebring-1500 avatar image
0 Votes"
stefanolivebring-1500 asked ·

In arm template, how can I fetch privatelink's privateIPAddress ?

Hi

Is it possible to within ARM template fetch the privateIPaddress of a privatelink created in the same template ?

Regards
Stefan

azure-private-link
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

stefanolivebring-1500 avatar image
0 Votes"
stefanolivebring-1500 answered ·

solved it, I added

...
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"name": "privateEndpointDeployment",
"properties": {
"mode": "Incremental",
"parameters": {
"stgNicId": { "value": "[reference(resourceId('Microsoft.Network/privateEndpoints', variables('privateEndpoint').stgPrivateEndpointName), '2019-11-01').networkInterfaces[0].id]" }
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"stgNicId": {
"type": "string"
}
},
"variables": {},
"resources": [],
"outputs": {
"stgNicIP": {
"type": "string",
"value": "[[reference(parameters('stgNicId'), '2019-07-01').ipConfigurations[0].properties.privateIPAddress]"
}
}
}
}
},
...


then i can reference the privateIP using

reference('privateEndpointDeployment', '2015-01-01').outputs.stgNicIP.value

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.