Skip to content

Commit eeedd67

Browse files
Merge pull request #280613 from mumian/0711-merge-repo2
update api versions and remove the sample repo - batch 2
2 parents 631a61a + 6022ef0 commit eeedd67

9 files changed

+42
-42
lines changed

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

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

99
# Comparing JSON and Bicep for templates
@@ -134,7 +134,7 @@ targetScope = 'subscription'
134134
To declare a resource:
135135

136136
```bicep
137-
resource virtualMachine 'Microsoft.Compute/virtualMachines@2023-03-01' = {
137+
resource virtualMachine 'Microsoft.Compute/virtualMachines@2024-03-01' = {
138138
...
139139
}
140140
```
@@ -143,7 +143,7 @@ resource virtualMachine 'Microsoft.Compute/virtualMachines@2023-03-01' = {
143143
"resources": [
144144
{
145145
"type": "Microsoft.Compute/virtualMachines",
146-
"apiVersion": "2020-06-01",
146+
"apiVersion": "2024-03-01",
147147
...
148148
}
149149
]
@@ -152,7 +152,7 @@ resource virtualMachine 'Microsoft.Compute/virtualMachines@2023-03-01' = {
152152
To conditionally deploy a resource:
153153

154154
```bicep
155-
resource virtualMachine 'Microsoft.Compute/virtualMachines@2023-03-01' = if(deployVM) {
155+
resource virtualMachine 'Microsoft.Compute/virtualMachines@2024-03-01' = if(deployVM) {
156156
...
157157
}
158158
```
@@ -162,7 +162,7 @@ resource virtualMachine 'Microsoft.Compute/virtualMachines@2023-03-01' = if(depl
162162
{
163163
"condition": "[parameters('deployVM')]",
164164
"type": "Microsoft.Compute/virtualMachines",
165-
"apiVersion": "2023-03-01",
165+
"apiVersion": "2024-03-01",
166166
...
167167
}
168168
]
@@ -213,11 +213,11 @@ For Bicep, you can set an explicit dependency but this approach isn't recommende
213213
The following shows a network interface with an implicit dependency on a network security group. It references the network security group with `netSecurityGroup.id`.
214214

215215
```bicep
216-
resource netSecurityGroup 'Microsoft.Network/networkSecurityGroups@2022-11-01' = {
216+
resource netSecurityGroup 'Microsoft.Network/networkSecurityGroups@2023-11-01' = {
217217
...
218218
}
219219
220-
resource nic1 'Microsoft.Network/networkInterfaces@2022-11-01' = {
220+
resource nic1 'Microsoft.Network/networkInterfaces@2023-11-01' = {
221221
name: nic1Name
222222
location: location
223223
properties: {
@@ -254,7 +254,7 @@ storageAccount.properties.primaryEndpoints.blob
254254
To get a property from an existing resource that isn't deployed in the template:
255255

256256
```bicep
257-
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' existing = {
257+
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-04-01' existing = {
258258
name: storageAccountName
259259
}
260260

articles/azure-resource-manager/bicep/conditional-resource-deployment.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Conditional deployment with Bicep
33
description: Describes how to conditionally deploy a resource in Bicep.
44
ms.topic: conceptual
55
ms.custom: devx-track-bicep
6-
ms.date: 03/20/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Conditional deployments in Bicep with the if expression
@@ -24,7 +24,7 @@ In Bicep, you can conditionally deploy a resource by passing in a parameter that
2424
```bicep
2525
param deployZone bool
2626
27-
resource dnsZone 'Microsoft.Network/dnszones@2018-05-01' = if (deployZone) {
27+
resource dnsZone 'Microsoft.Network/dnsZones@2023-07-01-preview' = if (deployZone) {
2828
name: 'myZone'
2929
location: 'global'
3030
}
@@ -56,7 +56,7 @@ param location string = resourceGroup().location
5656
])
5757
param newOrExisting string = 'new'
5858
59-
resource saNew 'Microsoft.Storage/storageAccounts@2022-09-01' = if (newOrExisting == 'new') {
59+
resource saNew 'Microsoft.Storage/storageAccounts@2023-04-01' = if (newOrExisting == 'new') {
6060
name: storageAccountName
6161
location: location
6262
sku: {
@@ -65,7 +65,7 @@ resource saNew 'Microsoft.Storage/storageAccounts@2022-09-01' = if (newOrExistin
6565
kind: 'StorageV2'
6666
}
6767
68-
resource saExisting 'Microsoft.Storage/storageAccounts@2022-09-01' existing = if (newOrExisting == 'existing') {
68+
resource saExisting 'Microsoft.Storage/storageAccounts@2023-04-01' existing = if (newOrExisting == 'existing') {
6969
name: storageAccountName
7070
}
7171
@@ -88,7 +88,7 @@ param vmName string
8888
param location string
8989
param logAnalytics string = ''
9090
91-
resource vmName_omsOnboarding 'Microsoft.Compute/virtualMachines/extensions@2023-03-01' = if (!empty(logAnalytics)) {
91+
resource vmName_omsOnboarding 'Microsoft.Compute/virtualMachines/extensions@2024-03-01' = if (!empty(logAnalytics)) {
9292
name: '${vmName}/omsOnboarding'
9393
location: location
9494
properties: {

articles/azure-resource-manager/bicep/create-resource-group.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ targetScope='subscription'
2222
param resourceGroupName string
2323
param resourceGroupLocation string
2424
25-
resource newRG 'Microsoft.Resources/resourceGroups@2022-09-01' = {
25+
resource newRG 'Microsoft.Resources/resourceGroups@2024-03-01' = {
2626
name: resourceGroupName
2727
location: resourceGroupLocation
2828
}
@@ -65,7 +65,7 @@ param resourceGroupLocation string
6565
param storageName string
6666
param storageLocation string
6767
68-
resource newRG 'Microsoft.Resources/resourceGroups@2022-09-01' = {
68+
resource newRG 'Microsoft.Resources/resourceGroups@2024-03-01' = {
6969
name: resourceGroupName
7070
location: resourceGroupLocation
7171
}
@@ -86,7 +86,7 @@ The module uses a Bicep file named **storage.bicep** with the following contents
8686
param storageLocation string
8787
param storageName string
8888
89-
resource storageAcct 'Microsoft.Storage/storageAccounts@2022-09-01' = {
89+
resource storageAcct 'Microsoft.Storage/storageAccounts@2023-04-01' = {
9090
name: storageName
9191
location: storageLocation
9292
sku: {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ param storageAccountType string = 'Standard_LRS'
106106
@description('Location for all resources.')
107107
param location string = resourceGroup().location
108108
109-
var storageAccountName_var = 'store${uniqueString(resourceGroup().id)}'
109+
var storageAccountName = 'store${uniqueString(resourceGroup().id)}'
110110
111-
resource storageAccountName 'Microsoft.Storage/storageAccounts@2019-06-01' = {
112-
name: storageAccountName_var
111+
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-04-01' = {
112+
name: storageAccountName
113113
location: location
114114
sku: {
115115
name: storageAccountType
@@ -118,7 +118,7 @@ resource storageAccountName 'Microsoft.Storage/storageAccounts@2019-06-01' = {
118118
properties: {}
119119
}
120120
121-
output storageAccountName string = storageAccountName_var
121+
output storageAccountName string = storageAccountName
122122
```
123123

124124
The decompiled file works, but it has some names that you might want to change. The variable `var storageAccountName_var` has an unusual naming convention. Let's change it to:
@@ -152,7 +152,7 @@ param location string = resourceGroup().location
152152
153153
var uniqueStorageName = 'store${uniqueString(resourceGroup().id)}'
154154
155-
resource exampleStorage 'Microsoft.Storage/storageAccounts@2019-06-01' = {
155+
resource exampleStorage 'Microsoft.Storage/storageAccounts@2023-04-01' = {
156156
name: uniqueStorageName
157157
location: location
158158
sku: {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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@2021-06-01' = {
131+
resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2023-04-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@2021-04-01' = {
214+
resource newMG 'Microsoft.Management/managementGroups@2023-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@2021-04-01' = {
230+
resource newMG 'Microsoft.Management/managementGroups@2023-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@2021-06-01' = {
271+
resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2023-04-01' = {
272272
name: 'locationRestriction'
273273
properties: {
274274
policyType: 'Custom'
@@ -288,7 +288,7 @@ resource policyDefinition 'Microsoft.Authorization/policyDefinitions@2021-06-01'
288288
}
289289
}
290290
291-
resource policyAssignment 'Microsoft.Authorization/policyAssignments@2022-06-01' = {
291+
resource policyAssignment 'Microsoft.Authorization/policyAssignments@2024-04-01' = {
292292
name: 'locationAssignment'
293293
properties: {
294294
policyDefinitionId: policyDefinition.id

articles/azure-resource-manager/bicep/deploy-to-resource-group.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 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: 03/20/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Resource group deployments with Bicep files
@@ -81,7 +81,7 @@ To deploy resources to the target resource group, add those resources to the Bic
8181

8282
```bicep
8383
// resource deployed to target resource group
84-
resource exampleResource 'Microsoft.Storage/storageAccounts@2019-06-01' = {
84+
resource exampleResource 'Microsoft.Storage/storageAccounts@2023-04-01' = {
8585
...
8686
}
8787
```
@@ -172,7 +172,7 @@ Instead of using a module, you can set the scope to `tenant()` for some resource
172172
param mgName string = 'mg-${uniqueString(newGuid())}'
173173
174174
// ManagementGroup deployed at tenant
175-
resource managementGroup 'Microsoft.Management/managementGroups@2020-05-01' = {
175+
resource managementGroup 'Microsoft.Management/managementGroups@2023-04-01' = {
176176
scope: tenant()
177177
name: mgName
178178
properties: {}
@@ -235,7 +235,7 @@ Both modules use the same Bicep file named **storage.bicep**.
235235
param storageLocation string
236236
param storageName string
237237
238-
resource storageAcct 'Microsoft.Storage/storageAccounts@2019-06-01' = {
238+
resource storageAcct 'Microsoft.Storage/storageAccounts@2023-04-01' = {
239239
name: storageName
240240
location: storageLocation
241241
sku: {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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@2022-09-01' = {
168+
resource exampleResource 'Microsoft.Resources/resourceGroups@2024-03-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@2021-04-01' = {
232+
resource managementGroup 'Microsoft.Management/managementGroups@2023-04-01' = {
233233
scope: tenant()
234234
name: mgName
235235
properties: {}
@@ -257,7 +257,7 @@ param policyDefinitionID string
257257
param policyName string
258258
param policyParameters object = {}
259259
260-
resource policyAssign 'Microsoft.Authorization/policyAssignments@2022-06-01' = {
260+
resource policyAssign 'Microsoft.Authorization/policyAssignments@2024-04-01' = {
261261
name: policyName
262262
properties: {
263263
policyDefinitionId: policyDefinitionID
@@ -273,7 +273,7 @@ You can [define](../../governance/policy/concepts/definition-structure.md) and a
273273
```bicep
274274
targetScope = 'subscription'
275275
276-
resource locationPolicy 'Microsoft.Authorization/policyDefinitions@2021-06-01' = {
276+
resource locationPolicy 'Microsoft.Authorization/policyDefinitions@2023-04-01' = {
277277
name: 'locationpolicy'
278278
properties: {
279279
policyType: 'Custom'
@@ -290,7 +290,7 @@ resource locationPolicy 'Microsoft.Authorization/policyDefinitions@2021-06-01' =
290290
}
291291
}
292292
293-
resource locationRestrict 'Microsoft.Authorization/policyAssignments@2022-06-01' = {
293+
resource locationRestrict 'Microsoft.Authorization/policyAssignments@2024-04-01' = {
294294
name: 'allowedLocation'
295295
properties: {
296296
policyDefinitionId: locationPolicy.id
@@ -324,7 +324,7 @@ param roleAssignmentName string = guid(principalId, roleDefinitionId, resourceGr
324324
325325
var roleID = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/${roleDefinitionId}'
326326
327-
resource newResourceGroup 'Microsoft.Resources/resourceGroups@2022-09-01' = {
327+
resource newResourceGroup 'Microsoft.Resources/resourceGroups@2024-03-01' = {
328328
name: resourceGroupName
329329
location: resourceGroupLocation
330330
properties: {}

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

Lines changed: 3 additions & 3 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: 06/23/2023
6+
ms.date: 07/11/2024
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@2021-04-01' = {
144+
resource mgName_resource 'Microsoft.Management/managementGroups@2023-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@2021-04-01' = {
206+
resource mgName_resource 'Microsoft.Management/managementGroups@2023-04-01' = {
207207
name: mgName
208208
properties: {}
209209
}

articles/azure-resource-manager/bicep/deployment-script-bicep-configure-dev.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Configure development environment for deployment scripts in Bicep | Microsoft Docs
33
description: Configure development environment for deployment scripts in Bicep.
44
ms.topic: how-to
5-
ms.date: 12/13/2023
5+
ms.date: 07/11/2024
66
ms.custom: devx-track-azurepowershell, devx-track-azurecli, devx-track-bicep
77
ms.devlang: azurecli
88
---
@@ -237,7 +237,7 @@ var fileShareName = '${projectName}share'
237237
var containerGroupName = '${projectName}cg'
238238
var containerName = '${projectName}container'
239239

240-
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
240+
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-04-01' = {
241241
name: storageAccountName
242242
location: location
243243
sku: {
@@ -249,7 +249,7 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
249249
}
250250
}
251251

252-
resource fileshare 'Microsoft.Storage/storageAccounts/fileServices/shares@2023-01-01' = {
252+
resource fileshare 'Microsoft.Storage/storageAccounts/fileServices/shares@2023-04-01' = {
253253
name: '${storageAccountName}/default/${fileShareName}'
254254
dependsOn: [
255255
storageAccount

0 commit comments

Comments
 (0)