Skip to content

Commit 66e477d

Browse files
authored
Merge pull request #280637 from mumian/0711-merge-repo-linter
update api versions and remove the sample repo
2 parents d4fc919 + 1e2cb3d commit 66e477d

22 files changed

+104
-105
lines changed

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: 06/23/2023
6+
ms.date: 07/11/2024
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@2022-09-01' existing = {
20+
resource stg 'Microsoft.Storage/storageAccounts@2023-04-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@2022-09-01' existing = {
32+
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' existing = {
3333
name: 'examplestorage'
3434
scope: resourceGroup(exampleRG)
3535
}

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Bicep file structure and syntax
33
description: Describes the structure and properties of a Bicep file using declarative syntax.
44
ms.topic: conceptual
55
ms.custom: devx-track-bicep
6-
ms.date: 06/03/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Understand the structure and syntax of Bicep files
@@ -61,7 +61,7 @@ param location string = resourceGroup().location
6161
6262
var uniqueStorageName = '${storagePrefix}${uniqueString(resourceGroup().id)}'
6363
64-
resource stg 'Microsoft.Storage/storageAccounts@2022-09-01' = {
64+
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
6565
name: uniqueStorageName
6666
location: location
6767
sku: {
@@ -118,7 +118,7 @@ param storageAccountConfig storageAccountConfigType = {
118118
sku: 'Standard_LRS'
119119
}
120120
121-
resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
121+
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-04-01' = {
122122
name: storageAccountConfig.name
123123
location: location
124124
sku: {
@@ -189,7 +189,7 @@ var uniqueStorageName = '${storagePrefix}${uniqueString(resourceGroup().id)}'
189189
Apply this variable wherever you need the complex expression.
190190

191191
```bicep
192-
resource stg 'Microsoft.Storage/storageAccounts@2019-04-01' = {
192+
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
193193
name: uniqueStorageName
194194
```
195195

@@ -202,7 +202,7 @@ Use the `resource` keyword to define a resource to deploy. Your resource declara
202202
The resource declaration includes the resource type and API version. Within the body of the resource declaration, include properties that are specific to the resource type.
203203

204204
```bicep
205-
resource stg 'Microsoft.Storage/storageAccounts@2019-06-01' = {
205+
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
206206
name: uniqueStorageName
207207
location: location
208208
sku: {
@@ -255,7 +255,7 @@ By default, resources are deployed in parallel. When you add the `batchSize(int)
255255

256256
```bicep
257257
@batchSize(3)
258-
resource storageAccountResources 'Microsoft.Storage/storageAccounts@2019-06-01' = [for storageName in storageAccounts: {
258+
resource storageAccountResources 'Microsoft.Storage/storageAccounts@2023-04-01' = [for storageName in storageAccounts: {
259259
...
260260
}]
261261
```
@@ -305,7 +305,7 @@ You can add a resource or module to your Bicep file that is conditionally deploy
305305
```bicep
306306
param deployZone bool
307307
308-
resource dnsZone 'Microsoft.Network/dnszones@2018-05-01' = if (deployZone) {
308+
resource dnsZone 'Microsoft.Network/dnsZones@2023-07-01-preview' = if (deployZone) {
309309
name: 'myZone'
310310
location: 'global'
311311
}
@@ -320,15 +320,15 @@ Spaces and tabs are ignored when authoring Bicep files.
320320
Bicep is newline sensitive. For example:
321321

322322
```bicep
323-
resource sa 'Microsoft.Storage/storageAccounts@2019-06-01' = if (newOrExisting == 'new') {
323+
resource sa 'Microsoft.Storage/storageAccounts@2023-04-01' = if (newOrExisting == 'new') {
324324
...
325325
}
326326
```
327327

328328
Can't be written as:
329329

330330
```bicep
331-
resource sa 'Microsoft.Storage/storageAccounts@2019-06-01' =
331+
resource sa 'Microsoft.Storage/storageAccounts@2023-04-01' =
332332
if (newOrExisting == 'new') {
333333
...
334334
}
@@ -344,8 +344,8 @@ The following example shows a single-line comment.
344344

345345
```bicep
346346
// This is your primary NIC.
347-
resource nic1 'Microsoft.Network/networkInterfaces@2020-06-01' = {
348-
...
347+
resource nic1 'Microsoft.Network/networkInterfaces@2023-11-01' = {
348+
...
349349
}
350350
```
351351

articles/azure-resource-manager/bicep/linter-rule-explicit-values-for-loc-params.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Linter rule - use explicit values for module location parameters
33
description: Linter rule - use explicit values for module location parameters.
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 03/20/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Linter rule - use explicit values for module location parameters
@@ -35,7 +35,7 @@ module m1 'module1.bicep' = {
3535
name: 'm1'
3636
}
3737
38-
resource storageaccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
38+
resource storageaccount 'Microsoft.Storage/storageAccounts@2024-03-01' = {
3939
name: 'storageaccount'
4040
location: location
4141
kind: 'StorageV2'
@@ -50,7 +50,7 @@ resource storageaccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
5050
```bicep
5151
param location string = resourceGroup().location
5252
53-
resource stg 'Microsoft.Storage/storageAccounts@2022-09-01' = {
53+
resource stg 'Microsoft.Storage/storageAccounts@2024-03-01' = {
5454
name: 'stg'
5555
location: location
5656
kind: 'StorageV2'
@@ -74,7 +74,7 @@ module m1 'module1.bicep' = {
7474
}
7575
}
7676
77-
resource storageaccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
77+
resource storageaccount 'Microsoft.Storage/storageAccounts@2024-03-01' = {
7878
name: 'storageaccount'
7979
location: location
8080
kind: 'StorageV2'

articles/azure-resource-manager/bicep/linter-rule-nested-deployment-template-scoping.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Linter rule - nested deployment template scoping
33
description: Linter rule - nested deployment template scoping
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 03/20/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Linter rule - nested deployment template scoping
@@ -23,7 +23,7 @@ The following example fails this test because `fizz` is defined in the parent te
2323
```bicep
2424
var fizz = 'buzz'
2525
26-
resource nested 'Microsoft.Resources/deployments@2020-10-01' = {
26+
resource nested 'Microsoft.Resources/deployments@2024-03-01' = {
2727
name: 'name'
2828
properties: {
2929
mode: 'Incremental'
@@ -35,7 +35,7 @@ resource nested 'Microsoft.Resources/deployments@2020-10-01' = {
3535
contentVersion: '1.0.0.0'
3636
resources: [
3737
{
38-
apiVersion: '2022-09-01'
38+
apiVersion: '2024-03-01'
3939
type: 'Microsoft.Resources/tags'
4040
name: 'default'
4141
properties: {

articles/azure-resource-manager/bicep/linter-rule-no-deployments-resources.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Linter rule - no deployments resources
33
description: Linter rule - no deployments resources
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 03/20/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Linter rule - no deployments resources
@@ -47,7 +47,7 @@ In ARM templates, you can reuse or modularize a template through nesting or link
4747
"resources": [
4848
{
4949
"type": "Microsoft.Storage/storageAccounts",
50-
"apiVersion": "2023-01-01",
50+
"apiVersion": "2023-04-01",
5151
"name": "[parameters('storageAccountName')]",
5252
"location": "[parameters('location')]",
5353
"sku": {
@@ -69,7 +69,7 @@ In Bicep, you can still use the `Microsoft.Resources/deployments` resource for n
6969
param storageAccountName string = 'store${uniqueString(resourceGroup().id)}'
7070
param location string = resourceGroup().location
7171
72-
resource nestedTemplate1 'Microsoft.Resources/deployments@2023-07-01' = {
72+
resource nestedTemplate1 'Microsoft.Resources/deployments@2024-03-01' = {
7373
name: 'nestedTemplate1'
7474
properties:{
7575
mode: 'Incremental'
@@ -79,7 +79,7 @@ resource nestedTemplate1 'Microsoft.Resources/deployments@2023-07-01' = {
7979
resources: [
8080
{
8181
type: 'Microsoft.Storage/storageAccounts'
82-
apiVersion: '2023-01-01'
82+
apiVersion: '2023-04-01'
8383
name: storageAccountName
8484
location: location
8585
sku: {
@@ -116,7 +116,7 @@ _nested_nestedTemplate1.bicep_:
116116
param storageAccountName string
117117
param location string
118118
119-
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
119+
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-04-01' = {
120120
name: storageAccountName
121121
location: location
122122
sku: {
@@ -162,7 +162,7 @@ _createStorage.json_:
162162
"resources": [
163163
{
164164
"type": "Microsoft.Storage/storageAccounts",
165-
"apiVersion": "2023-01-01",
165+
"apiVersion": "2023-04-01",
166166
"name": "[parameters('storageAccountName')]",
167167
"location": "[parameters('location')]",
168168
"sku": {

articles/azure-resource-manager/bicep/linter-rule-no-hardcoded-environment-urls.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Linter rule - no hardcoded environment URL
33
description: Linter rule - no hardcoded environment URL
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 03/20/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Linter rule - no hardcoded environment URL
@@ -45,7 +45,7 @@ In some cases, you can fix it by getting a property from a resource you've deplo
4545
param storageAccountName string
4646
param location string = resourceGroup().location
4747
48-
resource sa 'Microsoft.Storage/storageAccounts@2022-09-01' = {
48+
resource sa 'Microsoft.Storage/storageAccounts@2023-04-01' = {
4949
name: storageAccountName
5050
location: location
5151
sku: {

articles/azure-resource-manager/bicep/linter-rule-no-hardcoded-location.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Linter rule - no hardcoded locations
33
description: Linter rule - no hardcoded locations
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 03/20/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Linter rule - no hardcoded locations
@@ -25,7 +25,7 @@ Rather than using a hardcoded string or variable value, use a parameter, the str
2525
The following example fails this test because the resource's `location` property uses a string literal:
2626

2727
```bicep
28-
resource stg 'Microsoft.Storage/storageAccounts@2021-02-01' = {
28+
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
2929
location: 'westus'
3030
}
3131
```
@@ -34,7 +34,7 @@ You can fix it by creating a new `location` string parameter (which may optional
3434

3535
```bicep
3636
param location string = resourceGroup().location
37-
resource stg 'Microsoft.Storage/storageAccounts@2021-02-01' = {
37+
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
3838
location: location
3939
}
4040
```
@@ -47,7 +47,7 @@ The following example fails this test because the resource's `location` property
4747

4848
```bicep
4949
var location = 'westus'
50-
resource stg 'Microsoft.Storage/storageAccounts@2021-02-01' = {
50+
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
5151
location: location
5252
}
5353
```
@@ -56,7 +56,7 @@ You can fix it by turning the variable into a parameter:
5656

5757
```bicep
5858
param location string = 'westus'
59-
resource stg 'Microsoft.Storage/storageAccounts@2021-02-01' = {
59+
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' = {
6060
location: location
6161
}
6262
```
@@ -77,7 +77,7 @@ where module1.bicep is:
7777
```bicep
7878
param location string
7979
80-
resource storageaccount 'Microsoft.Storage/storageAccounts@2021-02-01' = {
80+
resource storageaccount 'Microsoft.Storage/storageAccounts@2023-04-01' = {
8181
name: 'storageaccount'
8282
location: location
8383
kind: 'StorageV2'

articles/azure-resource-manager/bicep/linter-rule-no-loc-expr-outside-params.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Linter rule - no location expressions outside of parameter default values
33
description: Linter rule - no location expressions outside of parameter default values
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 03/20/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Linter rule - no location expressions outside of parameter default values
@@ -25,7 +25,7 @@ Template users may have limited access to regions where they can create resource
2525
Best practice suggests that to set your resources' locations, your template should have a string parameter named `location`. If you default the `location` parameter to `resourceGroup().location` or `deployment().location` instead of using these functions elsewhere in the template, users of the template can use the default value when convenient but also specify a different location when needed.
2626

2727
```bicep
28-
resource storageaccount 'Microsoft.Storage/storageAccounts@2021-02-01' = {
28+
resource storageaccount 'Microsoft.Storage/storageAccounts@2023-04-01' = {
2929
location: resourceGroup().location
3030
}
3131
```
@@ -35,7 +35,7 @@ You can fix the failure by creating a `location` property that defaults to `reso
3535
```bicep
3636
param location string = resourceGroup().location
3737
38-
resource storageaccount 'Microsoft.Storage/storageAccounts@2021-02-01' = {
38+
resource storageaccount 'Microsoft.Storage/storageAccounts@2023-04-01' = {
3939
location: location
4040
}
4141
```

articles/azure-resource-manager/bicep/linter-rule-no-unnecessary-dependson.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Linter rule - no unnecessary dependsOn entries
33
description: Linter rule - no unnecessary dependsOn entries
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 03/20/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Linter rule - no unnecessary dependsOn entries
@@ -25,7 +25,7 @@ The following example fails this test because the dependsOn entry `appServicePla
2525
```bicep
2626
param location string = resourceGroup().location
2727
28-
resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
28+
resource appServicePlan 'Microsoft.Web/serverfarms@2023-12-01' = {
2929
name: 'name'
3030
location: location
3131
sku: {
@@ -34,7 +34,7 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
3434
}
3535
}
3636
37-
resource webApplication 'Microsoft.Web/sites@2022-03-01' = {
37+
resource webApplication 'Microsoft.Web/sites@2023-12-01' = {
3838
name: 'name'
3939
location: location
4040
properties: {
@@ -51,7 +51,7 @@ You can fix it by removing the unnecessary dependsOn entry.
5151
```bicep
5252
param location string = resourceGroup().location
5353
54-
resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
54+
resource appServicePlan 'Microsoft.Web/serverfarms@2023-12-01' = {
5555
name: 'name'
5656
location: location
5757
sku: {
@@ -60,7 +60,7 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
6060
}
6161
}
6262
63-
resource webApplication 'Microsoft.Web/sites@2022-03-01' = {
63+
resource webApplication 'Microsoft.Web/sites@2023-12-01' = {
6464
name: 'name'
6565
location: location
6666
properties: {

articles/azure-resource-manager/bicep/linter-rule-no-unused-existing-resources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Linter rule - no unused existing resources
33
description: Linter rule - no unused existing resources
44
ms.topic: reference
55
ms.custom: devx-track-bicep
6-
ms.date: 03/20/2024
6+
ms.date: 07/11/2024
77
---
88

99
# Linter rule - no unused existing resources
@@ -23,7 +23,7 @@ To reduce confusion in your template, delete any [existing resources](./existing
2323
The following example fails this test because the existing resource **stg** is declared but never used:
2424

2525
```bicep
26-
resource stg 'Microsoft.Storage/storageAccounts@2022-09-01' existing = {
26+
resource stg 'Microsoft.Storage/storageAccounts@2023-04-01' existing = {
2727
name: 'examplestorage'
2828
}
2929
```

0 commit comments

Comments
 (0)