Skip to content

Commit fc7df1c

Browse files
authored
Merge pull request #115547 from tfitzmac/0518rglimit
update cross rg limit
2 parents 011d981 + eaeb777 commit fc7df1c

File tree

3 files changed

+24
-197
lines changed

3 files changed

+24
-197
lines changed

articles/azure-resource-manager/templates/cross-resource-group-deployment.md

Lines changed: 12 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -2,113 +2,29 @@
22
title: Deploy resources cross subscription & resource group
33
description: Shows how to target more than one Azure subscription and resource group during deployment.
44
ms.topic: conceptual
5-
ms.date: 12/09/2019
5+
ms.date: 05/18/2020
66
---
77

8-
# Deploy Azure resources to more than one subscription or resource group
8+
# Deploy Azure resources across subscriptions or resource groups
99

10-
Typically, you deploy all the resources in your template to a single [resource group](../management/overview.md). However, there are scenarios where you want to deploy a set of resources together but place them in different resource groups or subscriptions. For example, you may want to deploy the backup virtual machine for Azure Site Recovery to a separate resource group and location. Resource Manager enables you to use nested templates to target more than one subscription and resource group.
10+
Resource Manager enables you to deploy to more than one resource group in a single deployment. You use nested templates to specify resource groups that are different than the resource group in the deployment operation. The resource groups can exist in different subscriptions.
1111

1212
> [!NOTE]
13-
> You can deploy to only five resource groups in a single deployment. Typically, this limitation means you can deploy to one resource group specified for the parent template, and up to four resource groups in nested or linked deployments. However, if your parent template contains only nested or linked templates and does not itself deploy any resources, then you can include up to five resource groups in nested or linked deployments.
13+
> You can deploy to **800 resource groups** in a single deployment. Typically, this limitation means you can deploy to one resource group specified for the parent template, and up to 799 resource groups in nested or linked deployments. However, if your parent template contains only nested or linked templates and does not itself deploy any resources, then you can include up to 800 resource groups in nested or linked deployments.
1414
1515
## Specify subscription and resource group
1616

17-
To target a different resource group or subscription, use a [nested or linked template](linked-templates.md). The `Microsoft.Resources/deployments` resource type provides parameters for `subscriptionId` and `resourceGroup`, which enable you to specify the subscription and resource group for the nested deployment. If you don't specify the subscription ID or resource group, the subscription and resource group from the parent template is used. All the resource groups must exist before running the deployment.
17+
To target a resource group that is different than the one for parent template, use a [nested or linked template](linked-templates.md). Within the deployment resource type, specify values for the subscription ID and resource group that you want the nested template to deploy to.
1818

19-
The account you use to deploy the template must have permissions to deploy to the specified subscription ID. If the specified subscription exists in a different Azure Active Directory tenant, you must [add guest users from another directory](../../active-directory/active-directory-b2b-what-is-azure-ad-b2b.md).
19+
:::code language="json" source="~/resourcemanager-templates/azure-resource-manager/crosssubscription.json" range="38-43" highlight="5-6":::
2020

21-
To specify a different resource group and subscription, use:
21+
If you don't specify the subscription ID or resource group, the subscription and resource group from the parent template are used. All the resource groups must exist before running the deployment.
2222

23-
```json
24-
"resources": [
25-
{
26-
"apiVersion": "2017-05-10",
27-
"name": "nestedTemplate",
28-
"type": "Microsoft.Resources/deployments",
29-
"resourceGroup": "[parameters('secondResourceGroup')]",
30-
"subscriptionId": "[parameters('secondSubscriptionID')]",
31-
...
32-
}
33-
]
34-
```
23+
The account that deploys the template must have permission to deploy to the specified subscription ID. If the specified subscription exists in a different Azure Active Directory tenant, you must [add guest users from another directory](../../active-directory/active-directory-b2b-what-is-azure-ad-b2b.md).
3524

36-
If your resource groups are in the same subscription, you can remove the **subscriptionId** value.
37-
38-
The following example deploys two storage accounts. The first storage account is deployed to the resource group specified during deployment. The second storage account is deployed to the resource group specified in the `secondResourceGroup` and `secondSubscriptionID` parameters:
39-
40-
```json
41-
{
42-
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
43-
"contentVersion": "1.0.0.0",
44-
"parameters": {
45-
"storagePrefix": {
46-
"type": "string",
47-
"maxLength": 11
48-
},
49-
"secondResourceGroup": {
50-
"type": "string"
51-
},
52-
"secondSubscriptionID": {
53-
"type": "string",
54-
"defaultValue": ""
55-
},
56-
"secondStorageLocation": {
57-
"type": "string",
58-
"defaultValue": "[resourceGroup().location]"
59-
}
60-
},
61-
"variables": {
62-
"firstStorageName": "[concat(parameters('storagePrefix'), uniqueString(resourceGroup().id))]",
63-
"secondStorageName": "[concat(parameters('storagePrefix'), uniqueString(parameters('secondSubscriptionID'), parameters('secondResourceGroup')))]"
64-
},
65-
"resources": [
66-
{
67-
"type": "Microsoft.Storage/storageAccounts",
68-
"apiVersion": "2017-06-01",
69-
"name": "[variables('firstStorageName')]",
70-
"location": "[resourceGroup().location]",
71-
"sku":{
72-
"name": "Standard_LRS"
73-
},
74-
"kind": "Storage",
75-
"properties": {
76-
}
77-
},
78-
{
79-
"type": "Microsoft.Resources/deployments",
80-
"apiVersion": "2017-05-10",
81-
"name": "nestedTemplate",
82-
"resourceGroup": "[parameters('secondResourceGroup')]",
83-
"subscriptionId": "[parameters('secondSubscriptionID')]",
84-
"properties": {
85-
"mode": "Incremental",
86-
"template": {
87-
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
88-
"contentVersion": "1.0.0.0",
89-
"parameters": {},
90-
"variables": {},
91-
"resources": [
92-
{
93-
"type": "Microsoft.Storage/storageAccounts",
94-
"apiVersion": "2017-06-01",
95-
"name": "[variables('secondStorageName')]",
96-
"location": "[parameters('secondStorageLocation')]",
97-
"sku":{
98-
"name": "Standard_LRS"
99-
},
100-
"kind": "Storage",
101-
"properties": {
102-
}
103-
}
104-
]
105-
},
106-
"parameters": {}
107-
}
108-
}
109-
]
110-
}
111-
```
25+
The following example deploys two storage accounts. The first storage account is deployed to the resource group specified in the deployment operation. The second storage account is deployed to the resource group specified in the `secondResourceGroup` and `secondSubscriptionID` parameters:
26+
27+
:::code language="json" source="~/resourcemanager-templates/azure-resource-manager/crosssubscription.json":::
11228

11329
If you set `resourceGroup` to the name of a resource group that doesn't exist, the deployment fails.
11430

@@ -216,99 +132,7 @@ The following [example template](https://github.com/Azure/azure-docs-json-sample
216132
* nested template with inner scope
217133
* linked template
218134

219-
```json
220-
{
221-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
222-
"contentVersion": "1.0.0.0",
223-
"parameters": {},
224-
"variables": {},
225-
"resources": [
226-
{
227-
"type": "Microsoft.Resources/deployments",
228-
"apiVersion": "2017-05-10",
229-
"name": "defaultScopeTemplate",
230-
"resourceGroup": "inlineGroup",
231-
"properties": {
232-
"mode": "Incremental",
233-
"template": {
234-
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
235-
"contentVersion": "1.0.0.0",
236-
"parameters": {},
237-
"variables": {},
238-
"resources": [
239-
],
240-
"outputs": {
241-
"resourceGroupOutput": {
242-
"type": "string",
243-
"value": "[resourceGroup().name]"
244-
}
245-
}
246-
},
247-
"parameters": {}
248-
}
249-
},
250-
{
251-
"type": "Microsoft.Resources/deployments",
252-
"apiVersion": "2017-05-10",
253-
"name": "innerScopeTemplate",
254-
"resourceGroup": "inlineGroup",
255-
"properties": {
256-
"expressionEvaluationOptions": {
257-
"scope": "inner"
258-
},
259-
"mode": "Incremental",
260-
"template": {
261-
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
262-
"contentVersion": "1.0.0.0",
263-
"parameters": {},
264-
"variables": {},
265-
"resources": [
266-
],
267-
"outputs": {
268-
"resourceGroupOutput": {
269-
"type": "string",
270-
"value": "[resourceGroup().name]"
271-
}
272-
}
273-
},
274-
"parameters": {}
275-
}
276-
},
277-
{
278-
"type": "Microsoft.Resources/deployments",
279-
"apiVersion": "2017-05-10",
280-
"name": "linkedTemplate",
281-
"resourceGroup": "linkedGroup",
282-
"properties": {
283-
"mode": "Incremental",
284-
"templateLink": {
285-
"contentVersion": "1.0.0.0",
286-
"uri": "https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/azure-resource-manager/resourceGroupName.json"
287-
},
288-
"parameters": {}
289-
}
290-
}
291-
],
292-
"outputs": {
293-
"parentRG": {
294-
"type": "string",
295-
"value": "[concat('Parent resource group is ', resourceGroup().name)]"
296-
},
297-
"defaultScopeRG": {
298-
"type": "string",
299-
"value": "[concat('Default scope resource group is ', reference('defaultScopeTemplate').outputs.resourceGroupOutput.value)]"
300-
},
301-
"innerScopeRG": {
302-
"type": "string",
303-
"value": "[concat('Inner scope resource group is ', reference('innerScopeTemplate').outputs.resourceGroupOutput.value)]"
304-
},
305-
"linkedRG": {
306-
"type": "string",
307-
"value": "[concat('Linked resource group is ', reference('linkedTemplate').outputs.resourceGroupOutput.value)]"
308-
}
309-
}
310-
}
311-
```
135+
:::code language="json" source="~/resourcemanager-templates/azure-resource-manager/crossresourcegroupproperties.json":::
312136

313137
To test the preceding template and see the results, use PowerShell or Azure CLI.
314138

articles/azure-resource-manager/templates/deploy-to-subscription.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
title: Deploy resources to subscription
33
description: Describes how to create a resource group in an Azure Resource Manager template. It also shows how to deploy resources at the Azure subscription scope.
44
ms.topic: conceptual
5-
ms.date: 05/07/2020
5+
ms.date: 05/18/2020
66
---
77

88
# Create resource groups and resources at the subscription level
99

10-
To simplify the management of resources in your Azure subscription, you can define and assign [policies](../../governance/policy/overview.md) or [role-based access controls](../../role-based-access-control/overview.md) across the subscription. With subscription level templates, you declaratively apply policies and assign roles at the subscription. You can also create resource groups and deploy resources.
10+
To simplify the management of resources, you can deploy resources at the level of your Azure subscription. For example, you can deploy [policies](../../governance/policy/overview.md) and [role-based access controls](../../role-based-access-control/overview.md) to your subscription, and those resources are applied across your subscription. You can also create resource groups and deploy resources to those resource groups.
11+
12+
> [!NOTE]
13+
> You can deploy to 800 different resource groups in a subscription level deployment.
1114
1215
To deploy templates at the subscription level, use Azure CLI, PowerShell, or REST API. The Azure portal doesn't support deployment in the subscription level.
1316

@@ -125,7 +128,7 @@ The following template creates an empty resource group.
125128
"resources": [
126129
{
127130
"type": "Microsoft.Resources/resourceGroups",
128-
"apiVersion": "2018-05-01",
131+
"apiVersion": "2019-10-01",
129132
"name": "[parameters('rgName')]",
130133
"location": "[parameters('rgLocation')]",
131134
"properties": {}
@@ -156,7 +159,7 @@ Use the [copy element](copy-resources.md) with resource groups to create more th
156159
"resources": [
157160
{
158161
"type": "Microsoft.Resources/resourceGroups",
159-
"apiVersion": "2018-05-01",
162+
"apiVersion": "2019-10-01",
160163
"location": "[parameters('rgLocation')]",
161164
"name": "[concat(parameters('rgNamePrefix'), copyIndex())]",
162165
"copy": {
@@ -174,7 +177,7 @@ For information about resource iteration, see [Deploy more than one instance of
174177

175178
## Resource group and resources
176179

177-
To create the resource group and deploy resources to it, use a nested template. The nested template defines the resources to deploy to the resource group. Set the nested template as dependent on the resource group to make sure the resource group exists before deploying the resources.
180+
To create the resource group and deploy resources to it, use a nested template. The nested template defines the resources to deploy to the resource group. Set the nested template as dependent on the resource group to make sure the resource group exists before deploying the resources. You can deploy to up to 800 resource groups.
178181

179182
The following example creates a resource group, and deploys a storage account to the resource group.
180183

@@ -200,14 +203,14 @@ The following example creates a resource group, and deploys a storage account to
200203
"resources": [
201204
{
202205
"type": "Microsoft.Resources/resourceGroups",
203-
"apiVersion": "2018-05-01",
206+
"apiVersion": "2019-10-01",
204207
"location": "[parameters('rgLocation')]",
205208
"name": "[parameters('rgName')]",
206209
"properties": {}
207210
},
208211
{
209212
"type": "Microsoft.Resources/deployments",
210-
"apiVersion": "2018-05-01",
213+
"apiVersion": "2019-10-01",
211214
"name": "storageDeployment",
212215
"resourceGroup": "[parameters('rgName')]",
213216
"dependsOn": [
@@ -223,7 +226,7 @@ The following example creates a resource group, and deploys a storage account to
223226
"resources": [
224227
{
225228
"type": "Microsoft.Storage/storageAccounts",
226-
"apiVersion": "2017-10-01",
229+
"apiVersion": "2019-06-01",
227230
"name": "[variables('storageName')]",
228231
"location": "[parameters('rgLocation')]",
229232
"sku": {

articles/azure-resource-manager/templates/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
href: deploy-to-management-group.md
237237
- name: Tenant
238238
href: deploy-to-tenant.md
239-
- name: Multiple resource groups or subscriptions
239+
- name: Cross resource group
240240
href: cross-resource-group-deployment.md
241241
- name: Provide parameters
242242
items:

0 commit comments

Comments
 (0)