Azure / Azure/bicep-types-az

Linter rule use-recent-api-versions suggests non-existent version for resource type

Open
#2,193 1 comment 0 reactions 0 assignees View on GitHub
Needs: Triage :mag:
Dominant language
TypeScript
Stars
108
Forks
44
Avg merge
18h 53m
Merged PRs (30d)
29

Description

**Bicep version**
0.28.1

**Describe the bug**
Building or deploying a bicep file that includes a `Microsoft.Insights/scheduledQueryRules@2023-03-15-preview` resource emits an inaccurate warning message:

```
Warning use-recent-api-versions: Use more recent API version for 'Microsoft.Insights/scheduledQueryRules'. '2023-03-15-preview' is a preview version and there is a more recent non-preview version available. Acceptable versions: 2023-12-01, 2022-06-15 [https://aka.ms/bicep/linter/use-recent-api-versions]
```

`2023-12-01` is not a valid API version for [Microsoft.Insights/scheduledQueryRules](https://learn.microsoft.com/en-us/azure/templates/microsoft.insights/scheduledqueryrules?pivots=deployment-language-bicep), and attempting to deploy with the suggested change results in an error.

**To Reproduce**
1. Create a bicep file (named e.g. main.bicep) with a `Microsoft.Insights/scheduledQueryRules@2023-03-15-preview` resource.
2. Run `az bicep build --file main.bicep`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported main.bicep reproduction containing Microsoft.Insights/scheduledQueryRules@2023-03-15-preview and run az bicep build --file main.bicep. Trace the source of the use-recent-api-versions warning and the listed acceptable versions for this resource type. Done means the warning no longer suggests the invalid 2023-12-01 version and the build output is accurate.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, typescript
Domain
cloud, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.