Skip to content

Commit b494467

Browse files
committed
new linter rule - use recent api versions
1 parent 2cb11b6 commit b494467

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

articles/azure-resource-manager/bicep/bicep-config-linter.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Linter settings for Bicep config
33
description: Describes how to customize configuration values for the Bicep linter
44
ms.topic: conceptual
5-
ms.date: 09/23/2022
5+
ms.date: 09/30/2022
66
---
77

88
# Add linter settings in the Bicep config file
@@ -89,6 +89,9 @@ The following example shows the rules that are available for configuration.
8989
"use-protectedsettings-for-commandtoexecute-secrets": {
9090
"level": "warning"
9191
},
92+
"use-recent-api-versions": {
93+
"level": "warning"
94+
},
9295
"use-resource-id-functions": {
9396
"level": "warning"
9497
},
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Linter rule - use recent API versions
3+
description: Linter rule - use recent API versions
4+
ms.topic: conceptual
5+
ms.date: 09/30/2022
6+
---
7+
8+
# Linter rule - use recent API versions
9+
10+
This rule looks for resource API versions that are older than 730 days. It is recommended to use the most recent API versions.
11+
12+
> [!NOTE]
13+
> This rule is off by default, change the level in [bicepconfig.json](./bicep-config-linter.md) to enable it.
14+
15+
## Linter rule code
16+
17+
Use the following value in the [Bicep configuration file](bicep-config-linter.md) to customize rule settings:
18+
19+
`use-recent-api-versions`
20+
21+
## Solution
22+
23+
Use the most recent API version, or one that is no older than 730 days.
24+
25+
## Next steps
26+
27+
For more information about the linter, see [Use Bicep linter](./linter.md).

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Use Bicep linter
33
description: Learn how to use Bicep linter.
44
ms.topic: conceptual
5-
ms.date: 9/23/2022
5+
ms.date: 9/30/2022
66
---
77

88
# Use Bicep linter
@@ -39,6 +39,7 @@ The default set of linter rules is minimal and taken from [arm-ttk test cases](.
3939
- [secure-secrets-in-params](./linter-rule-secure-secrets-in-parameters.md)
4040
- [simplify-interpolation](./linter-rule-simplify-interpolation.md)
4141
- [use-protectedsettings-for-commandtoexecute-secrets](./linter-rule-use-protectedsettings-for-commandtoexecute-secrets.md)
42+
- [use-recent-api-versions](./linter-rule-use-recent-api-versions.md)
4243
- [use-resource-id-functions](./linter-rule-use-resource-id-functions.md)
4344
- [use-stable-resource-identifiers](./linter-rule-use-stable-resource-identifier.md)
4445
- [use-stable-vm-image](./linter-rule-use-stable-vm-image.md)

articles/azure-resource-manager/bicep/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@
432432
href: linter-rule-simplify-interpolation.md
433433
- name: Use explicit values for module location parameters
434434
href: linter-rule-explicit-values-for-loc-params.md
435+
- name: use recent API versions
436+
href: linter-rule-use-recent-api-versions.md
435437
- name: use resource ID functions
436438
href: linter-rule-use-resource-id-functions.md
437439
- name: Use stable resource identifier

0 commit comments

Comments
 (0)