Skip to content

Commit 3fd012e

Browse files
Merge pull request #242809 from mumian/0623-bicep-fresh-2
Bicep content freshness - 2
2 parents 669d75a + 6cf0486 commit 3fd012e

21 files changed

+82
-78
lines changed

articles/azure-resource-manager/bicep/best-practices.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: johndowns
55
ms.author: jodowns
66
ms.topic: conceptual
77
ms.custom: devx-track-bicep
8-
ms.date: 05/16/2022
8+
ms.date: 06/23/2023
99
---
1010
# Best practices for Bicep
1111

@@ -68,13 +68,13 @@ For more information about Bicep variables, see [Variables in Bicep](variables.m
6868
* Avoid using `name` in a symbolic name. The symbolic name represents the resource, not the resource's name. For example, instead of the following syntax:
6969

7070
```bicep
71-
resource cosmosDBAccountName 'Microsoft.DocumentDB/databaseAccounts@2021-04-15' = {
71+
resource cosmosDBAccountName 'Microsoft.DocumentDB/databaseAccounts@2023-04-15' = {
7272
```
7373

7474
Use:
7575

7676
```bicep
77-
resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2021-04-15' = {
77+
resource cosmosDBAccount 'Microsoft.DocumentDB/databaseAccounts@2023-04-15' = {
7878
```
7979

8080
* Avoid distinguishing variables and parameters by the use of suffixes.

articles/azure-resource-manager/bicep/bicep-functions-date.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
title: Bicep functions - date
33
description: Describes the functions to use in a Bicep file to work with dates.
4-
author: mumian
5-
ms.author: jgao
64
ms.topic: conceptual
75
ms.custom: devx-track-bicep
8-
ms.date: 05/03/2022
6+
ms.date: 06/23/2023
97
---
108

119
# Date functions for Bicep
@@ -67,7 +65,7 @@ var startTime = dateTimeAdd(baseTime, 'PT1H')
6765
6866
...
6967
70-
resource scheduler 'Microsoft.Automation/automationAccounts/schedules@2015-10-31' = {
68+
resource scheduler 'Microsoft.Automation/automationAccounts/schedules@2022-08-08' = {
7169
name: concat(omsAutomationAccountName, '/', scheduleName)
7270
properties: {
7371
description: 'Demo Scheduler'
@@ -220,7 +218,7 @@ The next example shows how to use a value from the function when setting a tag v
220218
param utcShort string = utcNow('d')
221219
param rgName string
222220
223-
resource myRg 'Microsoft.Resources/resourceGroups@2020-10-01' = {
221+
resource myRg 'Microsoft.Resources/resourceGroups@2022-09-01' = {
224222
name: rgName
225223
location: 'westeurope'
226224
tags: {

articles/azure-resource-manager/bicep/compare-template-syntax.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
title: Compare syntax for Azure Resource Manager templates in JSON and Bicep
33
description: Compares Azure Resource Manager templates developed with JSON and Bicep, and shows how to convert between the languages.
4-
author: mumian
5-
ms.author: jgao
64
ms.topic: conceptual
75
ms.custom: devx-track-bicep, devx-track-arm-template
8-
ms.date: 04/26/2022
6+
ms.date: 06/23/2023
97
---
8+
109
# Comparing JSON and Bicep for templates
1110

1211
This article compares Bicep syntax with JSON syntax for Azure Resource Manager templates (ARM templates). In most cases, Bicep provides syntax that is less verbose than the equivalent in JSON.
@@ -135,7 +134,7 @@ targetScope = 'subscription'
135134
To declare a resource:
136135

137136
```bicep
138-
resource virtualMachine 'Microsoft.Compute/virtualMachines@2020-06-01' = {
137+
resource virtualMachine 'Microsoft.Compute/virtualMachines@2023-03-01' = {
139138
...
140139
}
141140
```
@@ -153,7 +152,7 @@ resource virtualMachine 'Microsoft.Compute/virtualMachines@2020-06-01' = {
153152
To conditionally deploy a resource:
154153

155154
```bicep
156-
resource virtualMachine 'Microsoft.Compute/virtualMachines@2020-06-01' = if(deployVM) {
155+
resource virtualMachine 'Microsoft.Compute/virtualMachines@2023-03-01' = if(deployVM) {
157156
...
158157
}
159158
```
@@ -163,7 +162,7 @@ resource virtualMachine 'Microsoft.Compute/virtualMachines@2020-06-01' = if(depl
163162
{
164163
"condition": "[parameters('deployVM')]",
165164
"type": "Microsoft.Compute/virtualMachines",
166-
"apiVersion": "2020-06-01",
165+
"apiVersion": "2023-03-01",
167166
...
168167
}
169168
]
@@ -214,11 +213,11 @@ For Bicep, you can set an explicit dependency but this approach isn't recommende
214213
The following shows a network interface with an implicit dependency on a network security group. It references the network security group with `netSecurityGroup.id`.
215214

216215
```bicep
217-
resource netSecurityGroup 'Microsoft.Network/networkSecurityGroups@2020-06-01' = {
216+
resource netSecurityGroup 'Microsoft.Network/networkSecurityGroups@2022-11-01' = {
218217
...
219218
}
220219
221-
resource nic1 'Microsoft.Network/networkInterfaces@2020-06-01' = {
220+
resource nic1 'Microsoft.Network/networkInterfaces@2022-11-01' = {
222221
name: nic1Name
223222
location: location
224223
properties: {
@@ -255,7 +254,7 @@ storageAccount.properties.primaryEndpoints.blob
255254
To get a property from an existing resource that isn't deployed in the template:
256255

257256
```bicep
258-
resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' existing = {
257+
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' existing = {
259258
name: storageAccountName
260259
}
261260

articles/azure-resource-manager/bicep/contribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: johndowns
66
ms.author: jodowns
77
ms.topic: conceptual
88
ms.custom: devx-track-bicep
9-
ms.date: 03/27/2022
9+
ms.date: 06/23/2023
1010
---
1111

1212
# Contribute to Bicep

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ 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: conceptual
55
ms.custom: devx-track-bicep
6-
ms.date: 11/22/2021
6+
ms.date: 06/23/2023
77
---
88

99
# Management group deployments with Bicep files
@@ -128,7 +128,7 @@ To deploy resources to the target management group, add those resources with the
128128
targetScope = 'managementGroup'
129129
130130
// policy definition created in the management group
131-
resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2019-09-01' = {
131+
resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2021-06-01' = {
132132
...
133133
}
134134
```
@@ -211,7 +211,7 @@ targetScope = 'managementGroup'
211211
212212
param mgName string = 'mg-${uniqueString(newGuid())}'
213213
214-
resource newMG 'Microsoft.Management/managementGroups@2020-05-01' = {
214+
resource newMG 'Microsoft.Management/managementGroups@2021-04-01' = {
215215
scope: tenant()
216216
name: mgName
217217
properties: {}
@@ -227,7 +227,7 @@ targetScope = 'managementGroup'
227227
228228
param mgName string = 'mg-${uniqueString(newGuid())}'
229229
230-
resource newMG 'Microsoft.Management/managementGroups@2020-05-01' = {
230+
resource newMG 'Microsoft.Management/managementGroups@2021-04-01' = {
231231
scope: tenant()
232232
name: mgName
233233
properties: {
@@ -268,7 +268,7 @@ param allowedLocations array = [
268268
'australiacentral'
269269
]
270270
271-
resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2020-09-01' = {
271+
resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2021-06-01' = {
272272
name: 'locationRestriction'
273273
properties: {
274274
policyType: 'Custom'
@@ -288,7 +288,7 @@ resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2020-09-01'
288288
}
289289
}
290290
291-
resource policyAssignment 'Microsoft.Authorization/policyAssignments@2020-09-01' = {
291+
resource policyAssignment 'Microsoft.Authorization/policyAssignments@2022-06-01' = {
292292
name: 'locationAssignment'
293293
properties: {
294294
policyDefinitionId: policyDefinition.id

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ 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. It shows how to create a resource group.
44
ms.topic: conceptual
55
ms.custom: devx-track-bicep
6-
ms.date: 11/22/2021
6+
ms.date: 06/23/2023
77
---
88

99
# Subscription deployments with Bicep files
@@ -165,7 +165,7 @@ To deploy resources to the target subscription, add those resources with the `re
165165
targetScope = 'subscription'
166166
167167
// resource group created in target subscription
168-
resource exampleResource 'Microsoft.Resources/resourceGroups@2020-10-01' = {
168+
resource exampleResource 'Microsoft.Resources/resourceGroups@2022-09-01' = {
169169
...
170170
}
171171
```
@@ -229,7 +229,7 @@ targetScope = 'subscription'
229229
param mgName string = 'mg-${uniqueString(newGuid())}'
230230
231231
// management group created at tenant
232-
resource managementGroup 'Microsoft.Management/managementGroups@2020-05-01' = {
232+
resource managementGroup 'Microsoft.Management/managementGroups@2021-04-01' = {
233233
scope: tenant()
234234
name: mgName
235235
properties: {}
@@ -254,7 +254,7 @@ targetScope='subscription'
254254
param resourceGroupName string
255255
param resourceGroupLocation string
256256
257-
resource newRG 'Microsoft.Resources/resourceGroups@2021-01-01' = {
257+
resource newRG 'Microsoft.Resources/resourceGroups@2022-09-01' = {
258258
name: resourceGroupName
259259
location: resourceGroupLocation
260260
}
@@ -274,7 +274,7 @@ param resourceGroupLocation string
274274
param storageName string
275275
param storageLocation string
276276
277-
resource newRG 'Microsoft.Resources/resourceGroups@2021-01-01' = {
277+
resource newRG 'Microsoft.Resources/resourceGroups@2022-09-01' = {
278278
name: resourceGroupName
279279
location: resourceGroupLocation
280280
}
@@ -295,7 +295,7 @@ The module uses a Bicep file named **storage.bicep** with the following contents
295295
param storageLocation string
296296
param storageName string
297297
298-
resource storageAcct 'Microsoft.Storage/storageAccounts@2019-06-01' = {
298+
resource storageAcct 'Microsoft.Storage/storageAccounts@2022-09-01' = {
299299
name: storageName
300300
location: storageLocation
301301
sku: {
@@ -319,7 +319,7 @@ param policyDefinitionID string
319319
param policyName string
320320
param policyParameters object = {}
321321
322-
resource policyAssign 'Microsoft.Authorization/policyAssignments@2020-09-01' = {
322+
resource policyAssign 'Microsoft.Authorization/policyAssignments@2022-06-01' = {
323323
name: policyName
324324
properties: {
325325
policyDefinitionId: policyDefinitionID
@@ -335,7 +335,7 @@ You can [define](../../governance/policy/concepts/definition-structure.md) and a
335335
```bicep
336336
targetScope = 'subscription'
337337
338-
resource locationPolicy 'Microsoft.Authorization/policyDefinitions@2020-09-01' = {
338+
resource locationPolicy 'Microsoft.Authorization/policyDefinitions@2021-06-01' = {
339339
name: 'locationpolicy'
340340
properties: {
341341
policyType: 'Custom'
@@ -352,7 +352,7 @@ resource locationPolicy 'Microsoft.Authorization/policyDefinitions@2020-09-01' =
352352
}
353353
}
354354
355-
resource locationRestrict 'Microsoft.Authorization/policyAssignments@2020-09-01' = {
355+
resource locationRestrict 'Microsoft.Authorization/policyAssignments@2022-06-01' = {
356356
name: 'allowedLocation'
357357
properties: {
358358
policyDefinitionId: locationPolicy.id
@@ -386,7 +386,7 @@ param roleAssignmentName string = guid(principalId, roleDefinitionId, resourceGr
386386
387387
var roleID = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/${roleDefinitionId}'
388388
389-
resource newResourceGroup 'Microsoft.Resources/resourceGroups@2019-10-01' = {
389+
resource newResourceGroup 'Microsoft.Resources/resourceGroups@2022-09-01' = {
390390
name: resourceGroupName
391391
location: resourceGroupLocation
392392
properties: {}
@@ -411,7 +411,7 @@ module assignRole 'role.bicep' = {
411411
The following example shows the module to apply the lock:
412412

413413
```bicep
414-
resource createRgLock 'Microsoft.Authorization/locks@2016-09-01' = {
414+
resource createRgLock 'Microsoft.Authorization/locks@2020-05-01' = {
415415
name: 'rgLock'
416416
properties: {
417417
level: 'CanNotDelete'
@@ -431,7 +431,7 @@ param roleNameGuid string = newGuid()
431431
432432
param roleDefinitionId string
433433
434-
resource roleNameGuid_resource 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
434+
resource roleNameGuid_resource 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
435435
name: roleNameGuid
436436
properties: {
437437
roleDefinitionId: roleDefinitionId

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

Lines changed: 4 additions & 4 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: conceptual
55
ms.custom: devx-track-bicep
6-
ms.date: 11/22/2021
6+
ms.date: 06/23/2023
77
---
88

99
# Tenant deployments with Bicep file
@@ -141,7 +141,7 @@ Resources defined within the Bicep file are applied to the tenant.
141141
targetScope = 'tenant'
142142
143143
// create resource at tenant
144-
resource mgName_resource 'Microsoft.Management/managementGroups@2020-02-01' = {
144+
resource mgName_resource 'Microsoft.Management/managementGroups@2021-04-01' = {
145145
...
146146
}
147147
```
@@ -203,7 +203,7 @@ The following template creates a management group.
203203
targetScope = 'tenant'
204204
param mgName string = 'mg-${uniqueString(newGuid())}'
205205
206-
resource mgName_resource 'Microsoft.Management/managementGroups@2020-02-01' = {
206+
resource mgName_resource 'Microsoft.Management/managementGroups@2021-04-01' = {
207207
name: mgName
208208
properties: {}
209209
}
@@ -226,7 +226,7 @@ param roleDefinitionId string = '8e3af657-a8ff-443c-a75c-2fe8c4bcb635'
226226
227227
var roleAssignmentName = guid(principalId, roleDefinitionId)
228228
229-
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2020-03-01-preview' = {
229+
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
230230
name: roleAssignmentName
231231
properties: {
232232
roleDefinitionId: tenantResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId)

articles/azure-resource-manager/bicep/existing-resource.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Reference existing resource in Bicep
33
description: Describes how to reference a resource that already exists.
44
ms.topic: conceptual
55
ms.custom: devx-track-bicep
6-
ms.date: 02/04/2022
6+
ms.date: 06/23/2023
77
---
88

99
# Existing resources in Bicep
@@ -17,7 +17,7 @@ The resource isn't redeployed when referenced with the `existing` keyword.
1717
The following example gets an existing storage account in the same resource group as the current deployment. Notice that you provide only the name of the existing resource. The properties are available through the symbolic name.
1818

1919
```bicep
20-
resource stg 'Microsoft.Storage/storageAccounts@2019-06-01' existing = {
20+
resource stg 'Microsoft.Storage/storageAccounts@2022-09-01' existing = {
2121
name: 'examplestorage'
2222
}
2323
@@ -29,7 +29,7 @@ output blobEndpoint string = stg.properties.primaryEndpoints.blob
2929
Set the `scope` property to access a resource in a different scope. The following example references an existing storage account in a different resource group.
3030

3131
```bicep
32-
resource stg 'Microsoft.Storage/storageAccounts@2019-06-01' existing = {
32+
resource stg 'Microsoft.Storage/storageAccounts@2022-09-01' existing = {
3333
name: 'examplestorage'
3434
scope: resourceGroup(exampleRG)
3535
}

0 commit comments

Comments
 (0)