ARM JSON template linter rejects current apiVersions
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
### Bug description
Opening a raw ARM JSON templateand setting a resource's `apiVersion` to a current Azure API version triggers a linter error saying the value isn't accepted.
Example: `Microsoft.Network/virtualNetworks` with `"apiVersion": "2023-09-01"` (a real, documented Azure API version) is flagged with:
> Value is not accepted. Valid values: "2017-06-01".
Same happens for the corresponding `Microsoft.Network/virtualNetworks/subnets` resource.
extension version `0.46.1`
### To reproduce
1. Install `ms-azuretools.vscode-bicep`
2. Open/create a `.json` ARM template with:
```json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2023-09-01",
"name": "exampleVnet",
"location": "eastus",
"properties": {
"addressSpace": { "addressPrefixes": ["10.20.0.0/16"] }
}
}
]
}
```
3. Observe the linter warning/error on the `apiVersion` line: "Value is not accepted. Valid values: "2017-06-01"."
### Expected behavior
The linter's apiVersion allowlist for a given resource type should reflect apiVersions that are current.
### Actual behavior
The linter rejects valid, current apiVersions and only accepts very old ones, suggesting the bundled azure-resource-manager-schemas snapshot used for ARM JSON template validation is stale relative to the extension's own release cadence.
### Additional context
A near-identical bug was reported years ago against the predecessor extension, `microsoft/vscode-azurearmtools#255` ("Latest API version not supported"), which described the exact same symptom ("Valid values: '2017-06-01'") for a different resource type. That repo/extension is now archived and superseded by this one (`ms-azuretools.vscode-bicep`, which also lints raw ARM JSON templates), and the underlying stale-schema behavior appears to have carried over rather than being fixed.
### Environment
- Extension: `ms-azuretools.vscode-bicep` v0.46.1 (Marketplace-listed release date 2026-08-31)
- VS Code, Windows 11
Contributor guide
Research direction
Start with the ARM JSON template linter and the bundled azure-resource-manager-schemas snapshot used for validation. Reproduce the warning with Microsoft.Network/virtualNetworks and apiVersion 2023-09-01, then trace how the snapshot supplies allowed versions. Done means current documented versions are accepted, including the virtualNetworks/subnets case, with regression coverage for the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, json
- Domain
- cloud, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100