This articles assume you have a good working knowledge of ARM linked templates.
Background: I am deploying a SQL Server resource arm template through a linked template. I want to get the values of the output of this linked template to pass into as values into properties of the azure website resource in the main arm template.
In the main arm template, I am trying to deploy an Azure web site and reference the certain property values of the deployed sql server resource. I need the sql server FQDN to configure the web site connection string. I assume the sql server resource is deployed as this web site has set a dependsOn dependency this sql server resource.
My wrong assumption was that I was thinking that I can possibly reference as follows:
Error upon deployment,
Invalid Template … Deployment template validation failed: ‘The resource referenced in output is not defined in the template
In the linked template output, return the values that is needed in the main template needs to make reference to the output of the linked template.
The proper approach is as follows:
For further background readings
- Template Reference Function
- Get Values From Linked Template
- My demo github repo of linked arm templates