Skip to content

Commit 12d6a76

Browse files
committed
fixes MicrosoftDocs/azure-docs#39883
1 parent a305533 commit 12d6a76

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

articles/azure-resource-manager/resource-group-linked-templates.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ description: Describes how to use linked templates in an Azure Resource Manager
44
author: tfitzmac
55
ms.service: azure-resource-manager
66
ms.topic: conceptual
7-
ms.date: 07/17/2019
7+
ms.date: 10/02/2019
88
ms.author: tomfitz
99
---
1010
# Using linked and nested templates when deploying Azure resources
1111

12-
To deploy your solution, you can use either a single template or a main template with many related templates. The related template can be either a separate file that is linked to from the main template, or a template that is nested within the main template.
12+
To deploy your solution, you can use either a single template or a main template with many related templates. The related templates can either be separate files that are linked to from the main template, or templates that are nested within the main template.
1313

14-
For small to medium solutions, a single template is easier to understand and maintain. You can see all the resources and values in a single file. For advanced scenarios, linked templates enable you to break down the solution into targeted components, and reuse templates.
14+
For small to medium solutions, a single template is easier to understand and maintain. You can see all the resources and values in a single file. For advanced scenarios, linked templates enable you to break down the solution into targeted components. You can easily reuse these templates for other scenarios.
1515

1616
When using linked templates, you create a main template that receives the parameter values during deployment. The main template contains all the linked templates and passes values to those templates as needed.
1717

@@ -21,7 +21,7 @@ For a tutorial, see [Tutorial: create linked Azure Resource Manager templates](.
2121
> For linked or nested templates, you can only use [Incremental](deployment-modes.md) deployment mode.
2222
>
2323
24-
## Link or nest a template
24+
## Deployments resource
2525

2626
To link to another template, add a **deployments** resource to your main template.
2727

@@ -41,7 +41,7 @@ To link to another template, add a **deployments** resource to your main templat
4141

4242
The properties you provide for the deployment resource vary based on whether you're linking to an external template or nesting an inline template in the main template.
4343

44-
### Nested template
44+
## Nested template
4545

4646
To nest the template within the main template, use the **template** property and specify the template syntax.
4747

@@ -88,9 +88,17 @@ To nest the template within the main template, use the **template** property and
8888
8989
The nested template requires the [same properties](resource-group-authoring-templates.md) as a standard template.
9090
91-
### External template and external parameters
91+
## External template
9292
93-
To link to an external template and parameter file, use **templateLink** and **parametersLink**. When linking to a template, the Resource Manager service must be able to access it. You can't specify a local file or a file that is only available on your local network. You can only provide a URI value that includes either **http** or **https**. One option is to place your linked template in a storage account, and use the URI for that item.
93+
To link to an external template, use the **templateLink** property. You can't specify a local file or a file that is only available on your local network. You can only provide a URI value that includes either **http** or **https**. Resource Manager must be able to access the template.
94+
95+
One option is to place your linked template in a storage account, and use the URI for that item.
96+
97+
You can provide the parameters for your external template either in an external file or inline.
98+
99+
### External parameters
100+
101+
When providing an external parameter file, use the **parametersLink** property:
94102
95103
```json
96104
"resources": [
@@ -99,27 +107,27 @@ To link to an external template and parameter file, use **templateLink** and **p
99107
"apiVersion": "2018-05-01",
100108
"name": "linkedTemplate",
101109
"properties": {
102-
"mode": "Incremental",
103-
"templateLink": {
110+
"mode": "Incremental",
111+
"templateLink": {
104112
"uri":"https://mystorageaccount.blob.core.windows.net/AzureTemplates/newStorageAccount.json",
105113
"contentVersion":"1.0.0.0"
106-
},
107-
"parametersLink": {
114+
},
115+
"parametersLink": {
108116
"uri":"https://mystorageaccount.blob.core.windows.net/AzureTemplates/newStorageAccount.parameters.json",
109117
"contentVersion":"1.0.0.0"
110-
}
118+
}
111119
}
112120
}
113121
]
114122
```
115123
116124
You don't have to provide the `contentVersion` property for the template or parameters. If you don't provide a content version value, the current version of the template is deployed. If you provide a value for content version, it must match the version in the linked template; otherwise, the deployment fails with an error.
117125

118-
### External template and inline parameters
126+
### Inline parameters
119127

120128
Or, you can provide the parameter inline. You can't use both inline parameters and a link to a parameter file. The deployment fails with an error when both `parametersLink` and `parameters` are specified.
121129

122-
To pass a value from the main template to the linked template, use **parameters**.
130+
To pass a value from the main template to the linked template, use the **parameters** property.
123131

124132
```json
125133
"resources": [
@@ -263,7 +271,7 @@ The main template deploys the linked template and gets the returned value. Notic
263271
}
264272
```
265273

266-
Like other resource types, you can set dependencies between the linked template and other resources. Therefore, when other resources require an output value from the linked template, make sure the linked template is deployed before them. Or, when the linked template relies on other resources, make sure other resources are deployed before the linked template.
274+
Like other resource types, you can set dependencies between the linked template and other resources. When other resources require an output value from the linked template, make sure the linked template is deployed before them. Or, when the linked template relies on other resources, make sure other resources are deployed before the linked template.
267275

268276
The following example shows a template that deploys a public IP address and returns the resource ID:
269277

0 commit comments

Comments
 (0)