2
2
title : Bicep functions - scopes
3
3
description : Describes the functions to use in a Bicep file to retrieve values about deployment scopes.
4
4
ms.topic : conceptual
5
- ms.date : 10/18 /2021
5
+ ms.date : 11/23 /2021
6
6
---
7
7
8
8
# Scope functions for Bicep
@@ -13,14 +13,12 @@ This article describes the Bicep functions for getting scope values.
13
13
14
14
` managementGroup() `
15
15
16
+ Returns an object with properties from the management group in the current deployment.
17
+
16
18
` managementGroup(identifier) `
17
19
18
20
Returns an object used for setting the scope to a management group.
19
21
20
- Or
21
-
22
- Returns an object with properties from the management group in the current deployment.
23
-
24
22
Namespace: [ az] ( bicep-functions.md#namespaces-for-functions ) .
25
23
26
24
### Remarks
@@ -46,7 +44,7 @@ The following example sets the scope for a module to a management group.
46
44
``` bicep
47
45
param managementGroupIdentifier string
48
46
49
- module 'module .bicep' = {
47
+ module 'mgModule .bicep' = {
50
48
name: 'deployToMG'
51
49
scope: managementGroup(managementGroupIdentifier)
52
50
}
@@ -115,15 +113,15 @@ output newManagementGroup string = mgName
115
113
116
114
` resourceGroup() `
117
115
118
- ` resourceGroup(resourceGroupName) `
116
+ Returns an object that represents the current resource group.
119
117
120
- ` resourceGroup(subscriptionId, resourceGroupName) `
118
+ ` resourceGroup(resourceGroupName) `
121
119
122
- Returns an object used for setting the scope to a resource group.
120
+ And
123
121
124
- Or
122
+ ` resourceGroup(subscriptionId, resourceGroupName) `
125
123
126
- Returns an object that represents the current resource group.
124
+ Return an object used for setting the scope to a resource group.
127
125
128
126
Namespace: [ az] ( bicep-functions.md#namespaces-for-functions ) .
129
127
@@ -172,7 +170,7 @@ The following example scopes a module to a resource group.
172
170
``` bicep
173
171
param resourceGroupName string
174
172
175
- module exampleModule 'module .bicep' = {
173
+ module exampleModule 'rgModule .bicep' = {
176
174
name: 'exampleModule'
177
175
scope: resourceGroup(resourceGroupName)
178
176
}
@@ -210,14 +208,12 @@ You can also use the resourceGroup function to apply tags from the resource grou
210
208
211
209
` subscription() `
212
210
211
+ Returns details about the subscription for the current deployment.
212
+
213
213
` subscription(subscriptionId) `
214
214
215
215
Returns an object used for setting the scope to a subscription.
216
216
217
- Or
218
-
219
- Returns details about the subscription for the current deployment.
220
-
221
217
Namespace: [ az] ( bicep-functions.md#namespaces-for-functions ) .
222
218
223
219
### Remarks
@@ -254,7 +250,7 @@ When used for getting details about the subscription, the function returns the f
254
250
The following example scopes a module to the subscription.
255
251
256
252
``` bicep
257
- module exampleModule 'module .bicep' = {
253
+ module exampleModule 'subModule .bicep' = {
258
254
name: 'deployToSub'
259
255
scope: subscription()
260
256
}
@@ -291,7 +287,7 @@ An object used for setting the `scope` property on a [module](modules.md#set-mod
291
287
The following example shows a module deployed to the tenant.
292
288
293
289
``` bicep
294
- module exampleModule 'module .bicep' = {
290
+ module exampleModule 'tenantModule .bicep' = {
295
291
name: 'deployToTenant'
296
292
scope: tenant()
297
293
}
0 commit comments