Let’s say you wanna deploy an ARM template for an API Management service without using a storage account for deployment. In that case you can add all of your ARM template code to the orchestrator file. We can refer to that scenario as nested templates. The alternative is to create separate ARM template files for your version set, named values, policies, products and the API itself and use them as linked templates in your orchestrator file. In other words. You don’t assemble all template files in your orchestrator, you just refer to the linked template files via a so called templateLink.
Let’s look at an example. The first resource you will have to create, is a version set. An orchestrator with a linked template would look like this:
{
"name": "versionSetTemplate",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2018-01-01",
"dependsOn": [],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat(parameters('LinkedTemplatesBaseUrl'), '/alfen-is-tst-apim-apiVersionSets.template.json', parameters('LinkedTemplatesUrlQueryString'))]",
"contentVersion": "1.0.0.0"
}
}
}
Whereas an orchestrator with a nested template would look like this:
{
"name": "TransformerSubstationVersionSet",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2019-05-01",
"dependsOn": [],
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "[concat(parameters('apiManagementName'), '/', parameters('versionSet'))]",
"type": "Microsoft.ApiManagement/service/apiversionsets",
"apiVersion": "2019-01-01",
"properties": {
"displayName": "[parameters('apiName')]",
"versioningScheme": "Segment"
}
}
]
}
}
}