Skip to content

Commit c8525a3

Browse files
committed
add more information for deployment scopes
1 parent 5de26ac commit c8525a3

File tree

4 files changed

+47
-40
lines changed

4 files changed

+47
-40
lines changed

articles/azure-resource-manager/bicep/deploy-to-management-group.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ title: Use Bicep to deploy resources to management group
33
description: Describes how to create a Bicep file that deploys resources at the management group scope.
44
ms.topic: how-to
55
ms.custom: devx-track-bicep
6-
ms.date: 09/26/2024
6+
ms.date: 02/10/2025
77
---
88

99
# Management group deployments with Bicep files
1010

1111
This article describes how to set scope with Bicep when deploying to a management group.
1212

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

1515
### Training resources
1616

@@ -108,17 +108,21 @@ For each deployment name, the location is immutable. You can't create a deployme
108108

109109
## Deployment scopes
110110

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

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 does not apply to [`existing`](./existing-resource.md) resources — you can reference existing resources at a different scope than the deployment.
118114

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

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)
120+
* [Other management groups](#scope-to-management-group)
121+
* [The subscription](#scope-to-subscription)
122+
* [The resource group](#scope-to-resource-group)
123+
* [The tenant](#scope-to-tenant)
124+
125+
// TODO add a note about exceptions to the "same resoure group rule" in the management-group equivalent of this doc - we permit tenant-level resource PUTs from mg-level deployments
122126

123127
### Scope to management group
124128

@@ -128,7 +132,7 @@ To deploy resources to the target management group, add those resources with the
128132
targetScope = 'managementGroup'
129133
130134
// policy definition created in the management group
131-
resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2023-04-01' = {
135+
resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2025-01-01' = {
132136
...
133137
}
134138
```

articles/azure-resource-manager/bicep/deploy-to-resource-group.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ title: Use Bicep to deploy resources to resource groups
33
description: Describes how to deploy resources in a Bicep file. It shows how to target more than one resource group.
44
ms.topic: how-to
55
ms.custom: devx-track-bicep
6-
ms.date: 09/26/2024
6+
ms.date: 02/10/2025
77
---
88

99
# Resource group deployments with Bicep files
1010

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

1313
## Supported resources
1414

@@ -62,18 +62,19 @@ For more detailed information about deployment commands and options for deployin
6262

6363
## Deployment scopes
6464

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

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 does not apply to [`existing`](./existing-resource.md) resources — you can reference existing resources at a different scope than the deployment.
7168

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

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:
7572

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)
76+
* [The subscription](#scope-to-subscription)
77+
* [The tenant](#scope-to-tenant)
7778

7879
### Scope to target resource group
7980

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ title: Use Bicep to deploy resources to subscription
33
description: Describes how to create a Bicep file that deploys resources to the Azure subscription scope.
44
ms.topic: how-to
55
ms.custom: devx-track-bicep
6-
ms.date: 09/26/2024
6+
ms.date: 02/10/2025
77
---
88

99
# Subscription deployments with Bicep files
1010

1111
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.
1212

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

1515
> [!NOTE]
1616
> 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
146146

147147
## Deployment scopes
148148

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

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 does not apply to [`existing`](./existing-resource.md) resources — you can reference existing resources at a different scope than the deployment.
155152

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

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](#score-to-subscription)
159+
* [The resource group](#scope-to-resource-group)
160+
* [The tenant](#scope-to-tenant)
159161

160162
### Scope to subscription
161163

@@ -165,7 +167,7 @@ To deploy resources to the target subscription, add those resources with the `re
165167
targetScope = 'subscription'
166168
167169
// resource group created in target subscription
168-
resource exampleResource 'Microsoft.Resources/resourceGroups@2024-03-01' = {
170+
resource exampleResource 'Microsoft.Resources/resourceGroups@2024-11-01' = {
169171
...
170172
}
171173
```

articles/azure-resource-manager/bicep/deploy-to-tenant.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Use Bicep to deploy resources to tenant
33
description: Describes how to deploy resources at the tenant scope in a Bicep file.
44
ms.topic: how-to
55
ms.custom: devx-track-bicep
6-
ms.date: 09/26/2024
6+
ms.date: 02/10/2025
77
---
88

99
# Tenant deployments with Bicep file
@@ -120,18 +120,18 @@ For each deployment name, the location is immutable. You can't create a deployme
120120

121121
## Deployment scopes
122122

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

125-
* the tenant
126-
* management groups within the tenant
127-
* subscriptions
128-
* resource groups
125+
However, this restriction does not apply to [`existing`](./existing-resource.md) resources — you can reference existing resources at a different scope than the deployment.
129126

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

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:
133130

134-
This section shows how to specify different scopes. You can combine these different scopes in a single template.
131+
* [The tenant](#scope-to-tenant)
132+
* [The management group](#scope-to-management-group)
133+
* [The subscription](#scope-to-subscription)
134+
* [The resource group](#scope-to-resource-group)
135135

136136
### Scope to tenant
137137

0 commit comments

Comments
 (0)