-
Notifications
You must be signed in to change notification settings - Fork 817
Description
Bicep version
Bicep CLI version 0.34.44 (0439eb6484)
Describe the bug
There is a gap between when API version specs are published to azure-rest-api-specs (and auto-generated into bicep-types-az) and when resource providers actually deploy support for those versions. The use-recent-api-versions linter rule does not account for this gap, so it can recommend API versions that fail on deployment.
Current examples:
Microsoft.Search/searchServices@2025-05-01— fails ineastus([Microsoft.Search/searchServices]: Resource fails to deploy with API version 2025-05-01 bicep-types-az#2693)Microsoft.Insights/scheduledQueryRules@2026-03-01— fails ineastus(Microsoft.Insights/scheduledQueryRules@2023-12-01 : missing bicep-types-az#2185)
This is a recurring pattern. Issues for scheduledQueryRules@2023-12-01 were filed across May–October 2024 (Azure/bicep-types-az#2183, Azure/bicep-types-az#2193, Azure/bicep-types-az#2318) and remain open. That version eventually became available in the RP, but the same pattern immediately recurred with @2026-03-01. Other resource types have been affected as well, including Microsoft.ApiManagement/service (Azure/bicep-types-az#2301).
The practical impact is that users update to the linter-recommended version, deployments fail, and they must roll back and add #disable-next-line use-recent-api-versions suppressions.
Note: my bicepconfig.json uses maxAllowedAgeInDays: 45, which is more aggressive than the 730-day default. This increases the likelihood of hitting the issue, but does not change the underlying problem — the linter will recommend undeployable versions regardless of the threshold if the currently-used version is old enough.
To Reproduce
- Configure
use-recent-api-versionswith amaxAllowedAgeInDaysvalue that flags the current version as stale - Create a Bicep file with
Microsoft.Search/searchServices@2025-02-01-preview - Observe the linter warning recommending
@2025-05-01 - Update to the recommended version
- Deploy to
eastus - Deployment fails with
NoRegisteredProviderFound
Additional context
A possible mitigation would be for the linter rule to apply a grace period after a type version first appears in bicep-types-az before recommending it, giving resource providers time to complete deployment. Alternatively, the linter documentation could note that recommended versions may not yet be deployable in all regions.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status