You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/resource-group-linked-templates.md
+23-15Lines changed: 23 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ description: Describes how to use linked templates in an Azure Resource Manager
4
4
author: tfitzmac
5
5
ms.service: azure-resource-manager
6
6
ms.topic: conceptual
7
-
ms.date: 07/17/2019
7
+
ms.date: 10/02/2019
8
8
ms.author: tomfitz
9
9
---
10
10
# Using linked and nested templates when deploying Azure resources
11
11
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.
13
13
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.
15
15
16
16
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.
17
17
@@ -21,7 +21,7 @@ For a tutorial, see [Tutorial: create linked Azure Resource Manager templates](.
21
21
> For linked or nested templates, you can only use [Incremental](deployment-modes.md) deployment mode.
22
22
>
23
23
24
-
## Link or nest a template
24
+
## Deployments resource
25
25
26
26
To link to another template, add a **deployments** resource to your main template.
27
27
@@ -41,7 +41,7 @@ To link to another template, add a **deployments** resource to your main templat
41
41
42
42
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.
43
43
44
-
###Nested template
44
+
## Nested template
45
45
46
46
To nest the template within the main template, use the **template** property and specify the template syntax.
47
47
@@ -88,9 +88,17 @@ To nest the template within the main template, use the **template** property and
88
88
89
89
The nested template requires the [same properties](resource-group-authoring-templates.md) as a standard template.
90
90
91
-
### External template and external parameters
91
+
## External template
92
92
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:
94
102
95
103
```json
96
104
"resources": [
@@ -99,27 +107,27 @@ To link to an external template and parameter file, use **templateLink** and **p
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.
117
125
118
-
### External template and inline parameters
126
+
### Inline parameters
119
127
120
128
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.
121
129
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.
123
131
124
132
```json
125
133
"resources": [
@@ -263,7 +271,7 @@ The main template deploys the linked template and gets the returned value. Notic
263
271
}
264
272
```
265
273
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.
267
275
268
276
The following example shows a template that deploys a public IP address and returns the resource ID:
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/resource-group-template-functions-resource.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -395,7 +395,7 @@ Use `'Full'` when you need resource values that aren't part of the properties sc
395
395
396
396
The reference function can only be used in the properties of a resource definition and the outputs section of a template or deployment. When used with [property iteration](resource-group-create-multiple.md#property-iteration), you can use the reference function for `input` because the expression is assigned to the resource property. You can't use it with `count` because the count must be determined before the reference function is resolved.
397
397
398
-
You can't use the reference function in the outputs of a [nested template](resource-group-linked-templates.md#nested-template) to return a resource you've deployed in the nested template. Instead, use a [linked template](resource-group-linked-templates.md#external-template-and-external-parameters).
398
+
You can't use the reference function in the outputs of a [nested template](resource-group-linked-templates.md#nested-template) to return a resource you've deployed in the nested template. Instead, use a [linked template](resource-group-linked-templates.md#external-template).
399
399
400
400
If you use the **reference** function in a resource that is conditionally deployed, the function is evaluated even if the resource isn't deployed. You get an error if the **reference** function refers to a resource that doesn't exist. Use the **if** function to make sure the function is only evaluated when the resource is being deployed. See the [if function](resource-group-template-functions-logical.md#if) for a sample template that uses if and reference with a conditionally deployed resource.
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/template-outputs.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ The following example shows how to set the IP address on a load balancer by retr
58
58
}
59
59
```
60
60
61
-
You can't use the `reference` function in the outputs section of a [nested template](resource-group-linked-templates.md#link-or-nest-a-template). To return the values for a deployed resource in a nested template, convert your nested template to a linked template.
61
+
You can't use the `reference` function in the outputs section of a [nested template](resource-group-linked-templates.md#nested-template). To return the values for a deployed resource in a nested template, convert your nested template to a linked template.
0 commit comments