Skip to content

Commit ac4c784

Browse files
committed
change cross scope deployments
1 parent 5fe033b commit ac4c784

12 files changed

+46
-25
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5078,6 +5078,11 @@
50785078
"redirect_url": "/azure/azure-resource-manager/templates/template-syntax",
50795079
"redirect_document_id": false
50805080
},
5081+
{
5082+
"source_path": "articles/azure-resource-manager/templates/cross-resource-group-deployment.md",
5083+
"redirect_url": "/azure/azure-resource-manager/templates/cross-scope-deployment",
5084+
"redirect_document_id": false
5085+
},
50815086
{
50825087
"source_path": "articles/azure-resource-manager/templates/use-vs-code-to-create-template.md",
50835088
"redirect_url": "/azure/azure-resource-manager/templates/quickstart-create-templates-use-visual-studio-code",

articles/automation/automation-enable-changes-from-browse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.custom: mvc
1010

1111
This article describes how you can enable the [Change Tracking and Inventory](change-tracking.md) feature for VMs by browsing the Azure portal. To enable Azure VMs at scale, you must enable an existing VM using Change Tracking and Inventory.
1212

13-
The number of resource groups that you can use for managing your VMs is limited by the [Resource Manager deployment limits](../azure-resource-manager/templates/cross-resource-group-deployment.md). Resource Manager deployments, not to be confused with update deployments, are limited to five resource groups per deployment. Two of these resource groups are reserved to configure the Log Analytics workspace, Automation account, and related resources. This leaves you with three resource groups to select for management by Change Tracking and Inventory. This limit only applies to simultaneous setup, not the number of resource groups that can be managed by an Automation feature.
13+
The number of resource groups that you can use for managing your VMs is limited by the [Resource Manager deployment limits](../azure-resource-manager/templates/cross-scope-deployment.md). Resource Manager deployments, not to be confused with update deployments, are limited to five resource groups per deployment. Two of these resource groups are reserved to configure the Log Analytics workspace, Automation account, and related resources. This leaves you with three resource groups to select for management by Change Tracking and Inventory. This limit only applies to simultaneous setup, not the number of resource groups that can be managed by an Automation feature.
1414

1515
> [!NOTE]
1616
> When enabling Change Tracking and Inventory, only certain regions are supported for linking a Log Analytics workspace and an Automation Account. For a list of the supported mapping pairs, see [Region mapping for Automation Account and Log Analytics workspace](how-to/region-mappings.md).

articles/automation/automation-onboard-solutions-from-browse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.custom: mvc
1010

1111
This article describes how you can enable the [Update Management](automation-update-management.md) feature for VMs by browsing the Azure portal. To enable Azure VMs at scale, you must enable an existing VM using Update Management.
1212

13-
The number of resource groups that you can use for managing your VMs is limited by the [Resource Manager deployment limits](../azure-resource-manager/templates/cross-resource-group-deployment.md). Resource Manager deployments, not to be confused with Update deployments, are limited to five resource groups per deployment. Two of these resource groups are reserved to configure the Log Analytics workspace, Automation account, and related resources. This leaves you with three resource groups to select for management by Update Management. This limit only applies to simultaneous setup, not the number of resource groups that can be managed by an Automation feature.
13+
The number of resource groups that you can use for managing your VMs is limited by the [Resource Manager deployment limits](../azure-resource-manager/templates/cross-scope-deployment.md). Resource Manager deployments, not to be confused with Update deployments, are limited to five resource groups per deployment. Two of these resource groups are reserved to configure the Log Analytics workspace, Automation account, and related resources. This leaves you with three resource groups to select for management by Update Management. This limit only applies to simultaneous setup, not the number of resource groups that can be managed by an Automation feature.
1414

1515
> [!NOTE]
1616
> When enabling Update Management, only certain regions are supported for linking a Log Analytics workspace and an Automation Account. For a list of the supported mapping pairs, see [Region mapping for Automation Account and Log Analytics workspace](how-to/region-mappings.md).

articles/azure-resource-manager/management/manage-resources-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ You can create a resource group and deploy resources to the group. For more info
5454

5555
## Deploy resources to multiple subscriptions or resource groups
5656

57-
Typically, you deploy all the resources in your template to a single resource group. However, there are scenarios where you want to deploy a set of resources together but place them in different resource groups or subscriptions. For more information, see [Deploy Azure resources to multiple subscriptions or resource groups](../templates/cross-resource-group-deployment.md).
57+
Typically, you deploy all the resources in your template to a single resource group. However, there are scenarios where you want to deploy a set of resources together but place them in different resource groups or subscriptions. For more information, see [Deploy Azure resources to multiple subscriptions or resource groups](../templates/cross-scope-deployment.md).
5858

5959
## Delete resources
6060

articles/azure-resource-manager/management/manage-resources-powershell.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ You can create a resource group and deploy resources to the group. For more info
5757

5858
## Deploy resources to multiple subscriptions or resource groups
5959

60-
Typically, you deploy all the resources in your template to a single resource group. However, there are scenarios where you want to deploy a set of resources together but place them in different resource groups or subscriptions. For more information, see [Deploy Azure resources to multiple subscriptions or resource groups](../templates/cross-resource-group-deployment.md).
60+
Typically, you deploy all the resources in your template to a single resource group. However, there are scenarios where you want to deploy a set of resources together but place them in different resource groups or subscriptions. For more information, see [Deploy Azure resources to multiple subscriptions or resource groups](../templates/cross-scope-deployment.md).
6161

6262
## Delete resources
6363

articles/azure-resource-manager/templates/common-deployment-errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ If you're looking for information about an error code and that information isn't
7272
| SubnetsNotInSameVnet | A virtual machine can only have one virtual network. When deploying several NICs, make sure they belong to the same virtual network. | [Multiple NICs](../../virtual-machines/windows/multiple-nics.md) |
7373
| SubscriptionNotRegistered | When deploying network resources, the Microsoft.Network resource provider is automatically registered in the subscription. Sometimes, the automatic registration doesn't complete in time. To avoid this intermittent error, register the Microsoft.Network resource provider before deployment. | [Resolve registration](error-register-resource-provider.md) |
7474
| TemplateResourceCircularDependency | Remove unnecessary dependencies. | [Resolve circular dependencies](error-invalid-template.md#circular-dependency) |
75-
| TooManyTargetResourceGroups | Reduce number of resource groups for a single deployment. | [Cross resource group deployment](cross-resource-group-deployment.md) |
75+
| TooManyTargetResourceGroups | Reduce number of resource groups for a single deployment. | [Cross scope deployment](cross-scope-deployment.md) |
7676

7777
## Find error code
7878

articles/azure-resource-manager/templates/complete-mode-deletion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The resource types marked with **Yes** are deleted when the type isn't in the te
1313

1414
The resource types marked with **No** aren't automatically deleted when not in the template; however, they're deleted if the parent resource is deleted. For a full description of the behavior, see [Azure Resource Manager deployment modes](deployment-modes.md).
1515

16-
If you deploy to [more than one resource group in a template](cross-resource-group-deployment.md), resources in the resource group specified in the deployment operation are eligible to be deleted. Resources in the secondary resource groups aren't deleted.
16+
If you deploy to [more than one resource group in a template](cross-scope-deployment.md), resources in the resource group specified in the deployment operation are eligible to be deleted. Resources in the secondary resource groups aren't deleted.
1717

1818
Jump to a resource provider namespace:
1919
> [!div class="op_single_selector"]

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

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
---
2-
title: Deploy resources cross subscription & resource group
3-
description: Shows how to target more than one Azure subscription and resource group during deployment.
2+
title: Deploy resources across scopes
3+
description: Shows how to target more than one scope during a deployment. The scope can be a tenant, management groups, subscriptions, and resource groups.
44
ms.topic: conceptual
5-
ms.date: 05/18/2020
5+
ms.date: 07/28/2020
66
---
77

8-
# Deploy Azure resources across subscriptions or resource groups
8+
# Deploy Azure resources across scopes
99

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.
10+
With Azure Resource Manager templates (ARM templates), you can deploy to more than one scope in a single deployment. The available scopes are a tenant, management groups, subscriptions, and resource groups. For example, you can deploy resources to one resource group, and in the same template deploy resources to another resource group. Or, you can deploy resources to a management group and also deploy resources to a resource group within that management group.
1111

12-
> [!NOTE]
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.
12+
You use [nested or linked templates](linked-templates.md) to specify scopes that are different than the primary scope for the deployment operation.
13+
14+
## Available scopes
1415

15-
## Specify subscription and resource group
16+
The scope that you use for the deployment operation determines which other scopes are available. You can deploy to the [tenant](deploy-to-tenant.md), [management group](deploy-to-management-group.md), [subscription](deploy-to-subscription), or [resource group](deploy-powershell.md). From the primary deployment level, you can't go up levels in the hierarchy. For example, if you deploy to a subscription, you can't step up a level to deploy resources to a management group. However, you can deploy to the management group and step down levels to deploy to a subscription or resource group.
1617

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.
18+
For every scope, the user deploying the template must have the required permissions to create resources.
19+
20+
## Cross resource groups
21+
22+
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. The resource groups can exist in different subscriptions.
1823

1924
:::code language="json" source="~/resourcemanager-templates/azure-resource-manager/crosssubscription.json" range="38-43" highlight="5-6":::
2025

2126
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.
2227

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/b2b/what-is-b2b.md).
28+
> [!NOTE]
29+
> 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.
2430
2531
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:
2632

@@ -114,9 +120,17 @@ az deployment group create \
114120

115121
---
116122

117-
## Use functions
123+
## Cross subscription, management group, and tenant
124+
125+
When specifying different scopes for subscription, management group and tenant level deployments, you use nested deployments like the example for resource groups. The properties that you use for specifying scope can differ. Those scenarios are covered in the articles about the levels of deployments. For more information, see:
126+
127+
* [Create resource groups and resources at the subscription level](deploy-to-subscription.md)
128+
* [Create resources at the management group level](deploy-to-management-group.md)
129+
* [Create resources at the tenant level](deploy-to-tenant.md)
118130

119-
The [resourceGroup()](template-functions-resource.md#resourcegroup) and [subscription()](template-functions-resource.md#subscription) functions resolve differently based on how you specify the template. When you link to an external template, the functions always resolve to the scope for that template. When you nest a template within a parent template, use the `expressionEvaluationOptions` property to specify whether the functions resolve to the resource group and subscription for the parent template or the nested template. Set the property to `inner` to resolve to the scope for the nested template. Set the property to `outer` to resolve to the scope of the parent template.
131+
## How functions resolve in scopes
132+
133+
When you deploy to more than one scope, the [resourceGroup()](template-functions-resource.md#resourcegroup) and [subscription()](template-functions-resource.md#subscription) functions resolve differently based on how you specify the template. When you link to an external template, the functions always resolve to the scope for that template. When you nest a template within a parent template, use the `expressionEvaluationOptions` property to specify whether the functions resolve to the resource group and subscription for the parent template or the nested template. Set the property to `inner` to resolve to the scope for the nested template. Set the property to `outer` to resolve to the scope of the parent template.
120134

121135
The following table shows whether the functions resolve to the parent or embedded resource group and subscription.
122136

@@ -197,6 +211,8 @@ The output from the preceding example is:
197211

198212
---
199213

214+
215+
200216
## Next steps
201217

202218
* To understand how to define parameters in your template, see [Understand the structure and syntax of Azure Resource Manager templates](template-syntax.md).

articles/azure-resource-manager/templates/deployment-modes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If your template includes a resource that isn't deployed because [condition](con
2323

2424
Be careful using complete mode with [copy loops](copy-resources.md). Any resources that aren't specified in the template after resolving the copy loop are deleted.
2525

26-
If you deploy to [more than one resource group in a template](cross-resource-group-deployment.md), resources in the resource group specified in the deployment operation are eligible to be deleted. Resources in the secondary resource groups aren't deleted.
26+
If you deploy to [more than one resource group in a template](cross-scope-deployment.md), resources in the resource group specified in the deployment operation are eligible to be deleted. Resources in the secondary resource groups aren't deleted.
2727

2828
There are some differences in how resource types handle complete mode deletions. Parent resources are automatically deleted when not in a template that's deployed in complete mode. Some child resources aren't automatically deleted when not in the template. However, these child resources are deleted if the parent resource is deleted.
2929

articles/azure-resource-manager/templates/error-invalid-template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Double check the allowed values in the template, and provide one during deployme
124124

125125
## Solution 4 - Too many target resource groups
126126

127-
You may see this error in earlier deployments because you were limited to five target resource groups in a single deployment. In May 2020, that limit was increased to 800 resource groups. For more information, see [Deploy Azure resources to more than one subscription or resource group](cross-resource-group-deployment.md).
127+
You may see this error in earlier deployments because you were limited to five target resource groups in a single deployment. In May 2020, that limit was increased to 800 resource groups. For more information, see [Deploy Azure resources to more than one subscription or resource group](cross-scope-deployment.md).
128128

129129
<a id="circular-dependency"></a>
130130

0 commit comments

Comments
 (0)