Unable to create Microsoft.EventHub/namespaces due to bad errors from CLI and linter
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 108
- Forks
- 44
- Avg merge
- 18h 53m
- Merged PRs (30d)
- 29
Description
Describe the bug
Currently our bi cep is creating a event hub like this:
resource evhnssplunk 'Microsoft.EventHub/namespaces@2022-10-01-preview' ...
I got an error saying it was old, the handy bicep intellisense told me latest was 2024-01-01, great! Tried that and get this error:
ERROR: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/ef5f5f98-119a-40a0-8bae-d4b10bd13a96/resourceGroups/rg-test-eventhub-splunk-eus2/providers/Microsoft.Resources/deployments/create_eventhub_eastus2-","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"NoRegisteredProviderFound","message":"No registered resource provider found for location 'eastus2' and API version '2024-01-01' for type 'namespaces'. The supported api-versions are '2017-04-01, 2018-01-01-preview, 2021-01-01-preview, 2021-06-01-preview, 2021-11-01, 2022-01-01-preview, 2022-10-01-preview, 2023-01-01-preview, 2014-09-01, 2015-08-01'. The supported locations are 'australiacentral, australiaeast, australiasoutheast, brazilsouth, canadacentral, canadaeast, centralindia, centralus, eastasia, eastus, eastus2, francecentral, germanywestcentral, israelcentral, italynorth, japaneast, japanwest, jioindiawest, koreacentral, koreasouth, northcentralus, northeurope, norwayeast, polandcentral, qatarcentral, southafricanorth, southcentralus, southeastasia, southindia, swedencentral, switzerlandnorth, uaenorth, uksouth, ukwest, westcentralus, westeurope, westindia, westus, westus2, westus3'."}]}}
Ok... so maybe i need to use 2023-01-01-preview since that's the latest from that error... try that and this is the error i get...
/home/vsts/work/1/s/infra-as-code/bicep/modules/eventHubs/eventHubs.bicep(11,53) : Error use-recent-api-versions: Use more recent API version for 'Microsoft.EventHub/namespaces'. '2023-01-01-preview' is a preview version and there is a more recent non-preview version available. Acceptable versions: 2024-01-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
So now i'm in a catch22, i can't deploy this because of these errors. On top of all that, the official site doesn't even show 2023 or 2024 versions...
https://learn.microsoft.com/en-us/azure/templates/microsoft.eventhub/namespaces?pivots=deployment-language-bicep
I'm going to look at disabling our linter rules but this just seems wrong and isn't the first time the bicep linter gave me a newer version that the CLI tolerated or existed in documentation but this is the first time that the reverse also happened and blocked me...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Microsoft.EventHub/namespaces API-version data and reproduce the mismatch between the Bicep linter, CLI deployment, and the linked documentation. Compare the 2023-01-01-preview and 2024-01-01 behavior for eastus2, then verify that the reported version is deployable and consistently represented. Done means the linter, CLI, and documentation no longer recommend conflicting versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, typescript
- Domain
- cloud, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100