Skip to content

Commit c5035da

Browse files
authored
Merge pull request #90389 from tfitzmac/1002link
fixes MicrosoftDocs/azure-docs#39883
2 parents 0252fc4 + 8aefa16 commit c5035da

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
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

articles/azure-resource-manager/resource-group-template-functions-resource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ Use `'Full'` when you need resource values that aren't part of the properties sc
395395

396396
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.
397397

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).
399399

400400
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.
401401

articles/azure-resource-manager/template-outputs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The following example shows how to set the IP address on a load balancer by retr
5858
}
5959
```
6060

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.
6262

6363
## Get output values
6464

0 commit comments

Comments
 (0)