how to point azure resources from another resource group in azure ARM template
If you want to use any existing azure resource in ARM template which is in different resource group then yes that is possible and its quite simple.
Why? – well this is required in may cases but as an example (shown in below screenshot) we might want to deploy few vm+ vm scale set with ARM but want to use vnet / subnet which is already configured in another resource group.
By default we refer other resources as below:
resourceId(‘Microsoft.Network/virtualNetworks’,parameters(‘virtualNetworkName’))]
and when we execute ARM it try to find the resource in same resource group where we have triggered the deployment. but if we want to use resource from another RG then just replace the above line with additional value which is resource group name as below:
[resourceId(parameters(‘vNetResourceGroup’),’Microsoft.Network/virtualNetworks’,parameters(‘virtualNetworkName’))]
Comments are closed.