0
votes

According to the resource documentation here.

https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-resource#resourceid

I can pass in the namespace followed by additional names depending on how deep the object is nested inside the parent resource. In my case, I simply want the resource ID for a backend pool within a load balancer so I specify the following:

[resourceId('Microsoft.Network/loadBalancers','myLoadBalancer', 'backendAddressPools', 'myPool')]

This causes the following exception to be generated when deploying the template.

Unable to evaluate template language function 'resourceId': the type 'Microsoft.Network/loadBalancers' requires '1' resource name argument(s)

1

1 Answers

3
votes

it should be:

[resourceId('Microsoft.Network/loadBalancers/backendAddressPools','myLoadBalancer', 'myPool')]

reading: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-resource#resourceid

check the database example