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/bicep/deploy-to-management-group.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,14 @@ title: Use Bicep to deploy resources to management group
3
3
description: Describes how to create a Bicep file that deploys resources at the management group scope.
4
4
ms.topic: how-to
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 09/26/2024
6
+
ms.date: 02/10/2025
7
7
---
8
8
9
9
# Management group deployments with Bicep files
10
10
11
11
This article describes how to set scope with Bicep when deploying to a management group.
12
12
13
-
As your organization matures, you can deploy a Bicep file to create resources at the management group level. For example, you may need to define and assign [policies](../../governance/policy/overview.md) or [Azure role-based access control (Azure RBAC)](../../role-based-access-control/overview.md) for a management group. With management group level templates, you can declaratively apply policies and assign roles at the management group level.
13
+
As your organization matures, you can deploy a Bicep file to create resources at the management group level. For example, you may need to define and assign [policies](../../governance/policy/overview.md) or [Azure role-based access control (Azure RBAC)](../../role-based-access-control/overview.md) for a management group. With management group level templates, you can declaratively apply policies and assign roles at the management group level. For more information, see [Understand scope](../management/overview.md#understand-scope).
14
14
15
15
### Training resources
16
16
@@ -108,17 +108,19 @@ For each deployment name, the location is immutable. You can't create a deployme
108
108
109
109
## Deployment scopes
110
110
111
-
When deploying to a management group, you can deploy resources to:
111
+
In a Bicep file, all resources declared with the [`resource`](./resource-declaration.md) keyword must be deployed at the same scope as the deployment. For a management group deployment, this means all `resource` declarations in the Bicep file must be deployed to the same management group or as a child or extension resource of a resource in the same management group as the deployment.
112
112
113
-
* the target management group from the operation
114
-
* another management group in the tenant
115
-
* subscriptions in the management group
116
-
* resource groups in the management group
117
-
* the tenant for the resource group
113
+
However, this restriction doesn't apply to [`existing`](./existing-resource.md) resources. You can reference existing resources at a different scope than the deployment.
118
114
119
-
An [extension resource](scope-extension-resources.md) can be scoped to a target that is different than the deployment target.
115
+
To deploy resources at multiple scopes within a single deployment, use [modules](./modules.md). Deploying a module triggers a "nested deployment," allowing you to target different scopes. The user deploying the parent Bicep file must have the necessary permissions to initiate deployments at those scopes.
120
116
121
-
The user deploying the template must have access to the specified scope.
117
+
You can deploy a Bicep module from within a management-group scope Bicep file at the following scopes:
118
+
119
+
*[The same management group](#scope-to-management-group)
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/deploy-to-resource-group.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,12 @@ title: Use Bicep to deploy resources to resource groups
3
3
description: Describes how to deploy resources in a Bicep file. It shows how to target more than one resource group.
4
4
ms.topic: how-to
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 09/26/2024
6
+
ms.date: 02/10/2025
7
7
---
8
8
9
9
# Resource group deployments with Bicep files
10
10
11
-
This article describes how to set scope with Bicep when deploying to a resource group.
11
+
This article describes how to set scope with Bicep when deploying to a resource group. For more information, see [Understand scope](../management/overview.md#understand-scope).
12
12
13
13
## Supported resources
14
14
@@ -62,18 +62,19 @@ For more detailed information about deployment commands and options for deployin
62
62
63
63
## Deployment scopes
64
64
65
-
When deploying to a resource group, you can deploy resources to:
65
+
In a Bicep file, all resources declared with the [`resource`](./resource-declaration.md) keyword must be deployed at the same scope as the deployment. For a resource group deployment, this means all `resource` declarations in the Bicep file must be deployed to the same resource group or as a child or extension resource of a resource in the same resource group as the deployment.
66
66
67
-
* the target resource group for the deployment operation
68
-
* other resource groups in the same subscription or other subscriptions
69
-
* any subscription in the tenant
70
-
* the tenant for the resource group
67
+
However, this restriction doesn't apply to [`existing`](./existing-resource.md) resources. You can reference existing resources at a different scope than the deployment.
71
68
72
-
An [extension resource](scope-extension-resources.md) can be scoped to a target that is different than the deployment target.
69
+
To deploy resources at multiple scopes within a single deployment, use [modules](./modules.md). Deploying a module triggers a "nested deployment," allowing you to target different scopes. The user deploying the parent Bicep file must have the necessary permissions to initiate deployments at those scopes.
73
70
74
-
The user deploying the template must have access to the specified scope.
71
+
You can deploy a resource from within a resource-group scope Bicep file at the following scopes:
75
72
76
-
This section shows how to specify different scopes. You can combine these different scopes in a single template.
73
+
*[The same resource group](#scope-to-target-resource-group)
74
+
*[Other resource groups in the same subscription](#scope-to-different-resource-group)
75
+
*[Other resource groups in other subscriptions](#scope-to-different-resource-group)
You can deploy to more than one resource group in a single Bicep file.
229
230
230
231
> [!NOTE]
231
-
> 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.
232
+
> 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 doesn't itself deploy any resources, then you can include up to 800 resource groups in nested or linked deployments.
232
233
233
234
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:
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/deploy-to-subscription.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,14 @@ title: Use Bicep to deploy resources to subscription
3
3
description: Describes how to create a Bicep file that deploys resources to the Azure subscription scope.
4
4
ms.topic: how-to
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 09/26/2024
6
+
ms.date: 02/10/2025
7
7
---
8
8
9
9
# Subscription deployments with Bicep files
10
10
11
11
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 [Azure role-based access control (Azure RBAC)](../../role-based-access-control/overview.md) to your subscription, which applies them across your subscription.
12
12
13
-
This article describes how to set the deployment scope to a subscription in a Bicep file.
13
+
This article describes how to set the deployment scope to a subscription in a Bicep file. For more information, see [Understand scope](../management/overview.md#understand-scope).
14
14
15
15
> [!NOTE]
16
16
> You can deploy to 800 different resource groups in a subscription level deployment.
@@ -146,16 +146,18 @@ For each deployment name, the location is immutable. You can't create a deployme
146
146
147
147
## Deployment scopes
148
148
149
-
When deploying to a subscription, you can deploy resources to:
149
+
In a Bicep file, all resources declared with the [`resource`](./resource-declaration.md) keyword must be deployed at the same scope as the deployment. For a subscription deployment, this means all `resource` declarations in the Bicep file must be deployed to the same subscription or as a child or extension resource of a resource in the same subscription as the deployment.
150
150
151
-
* the target subscription from the operation
152
-
* any subscription in the tenant
153
-
* resource groups within the subscription or other subscriptions
154
-
* the tenant for the subscription
151
+
However, this restriction doesn't apply to [`existing`](./existing-resource.md) resources. You can reference existing resources at a different scope than the deployment.
155
152
156
-
An [extension resource](scope-extension-resources.md) can be scoped to a target that is different than the deployment target.
153
+
To deploy resources at multiple scopes within a single deployment, use [modules](./modules.md). Deploying a module triggers a "nested deployment," allowing you to target different scopes. The user deploying the parent Bicep file must have the necessary permissions to initiate deployments at those scopes.
157
154
158
-
The user deploying the template must have access to the specified scope.
155
+
You can deploy a resource from within a subscription scope Bicep file at the following scopes:
156
+
157
+
*[The same subscription](#scope-to-subscription)
158
+
*[Other subscriptions](#scope-to-subscription)
159
+
*[The resource group](#scope-to-resource-group)
160
+
*[The tenant](#scope-to-tenant)
159
161
160
162
### Scope to subscription
161
163
@@ -165,7 +167,7 @@ To deploy resources to the target subscription, add those resources with the `re
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/deploy-to-tenant.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Use Bicep to deploy resources to tenant
3
3
description: Describes how to deploy resources at the tenant scope in a Bicep file.
4
4
ms.topic: how-to
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 09/26/2024
6
+
ms.date: 02/10/2025
7
7
---
8
8
9
9
# Tenant deployments with Bicep file
@@ -120,18 +120,18 @@ For each deployment name, the location is immutable. You can't create a deployme
120
120
121
121
## Deployment scopes
122
122
123
-
When deploying to a tenant, you can deploy resources to:
123
+
In a Bicep file, all resources declared with the [`resource`](./resource-declaration.md) keyword must be deployed at the same scope as the deployment. For a tenant deployment, this means all `resource` declarations in the Bicep file must be deployed to the same tenant or as a child or extension resource of a resource in the same tenant as the deployment.
124
124
125
-
* the tenant
126
-
* management groups within the tenant
127
-
* subscriptions
128
-
* resource groups
125
+
However, this restriction doesn't apply to [`existing`](./existing-resource.md) resources. You can reference existing resources at a different scope than the deployment.
129
126
130
-
An [extension resource](scope-extension-resources.md) can be scoped to a target that is different than the deployment target.
127
+
To deploy resources at multiple scopes within a single deployment, use [modules](./modules.md). Deploying a module triggers a "nested deployment," allowing you to target different scopes. The user deploying the parent Bicep file must have the necessary permissions to initiate deployments at those scopes.
131
128
132
-
The user deploying the template must have access to the specified scope.
129
+
You can deploy a resource from within a tenant scope Bicep file at the following scopes:
133
130
134
-
This section shows how to specify different scopes. You can combine these different scopes in a single template.
0 commit comments