Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

|Microsoft.ApiManagement] Proposed API version is not existing on Azure #2330

Open
mgrosperrin opened this issue Oct 18, 2024 · 4 comments
Open

Comments

@mgrosperrin
Copy link

Bicep version
0.30.23

Describe the bug
In VS Code (& in the CLI), I have a warning message when deploying an Microsoft.APIManagement resource saying that I should update the version from 2022-08-01 to 2024-05-01.
However when I do this, I got an error during the deployment saying this version (2024-05-01) does not exists:
Image

To Reproduce
Deploy a Microosft.APIManagement resource with the latest version proposed by the tooling (and the docs by the way).

Additional context
Add any other context about the problem here.

@dozer75
Copy link

dozer75 commented Oct 21, 2024

Not getting that initial warning (about update the version) during my deployments using the same Bicep Version and CLI as you (I am using the Microsoft.ApiManagement/service@2022-08-01), but are you sure it is the resource version the message relates to and not the Min API version for API Management Service (You can see that in your APIM -> Properties -> API version constraint)? I had a warning half a year ago which I misinterpreted the same way myself.

If that's the case it is the following value you should set (in Properties of the Microsoft.ApiManagement/service resource):

    apiVersionConstraint: {
      minApiVersion: '<version>'
    }

@mgrosperrin
Copy link
Author

Hi @dozer75,

I don't think it is related to a property of the resource.

Here are the logs when I deploy:

2024-10-22T12:32:04.1388601Z WARNING: D:\a\1\Infrastructure\apim\apim.bicep(13,57) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
2024-10-22T12:32:04.1389588Z [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" account clear"
2024-10-22T12:32:04.1410121Z 
2024-10-22T12:32:04.1517875Z D:\a\1\Infrastructure\apim\apim.bicep(15,42) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service/policies'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
2024-10-22T12:32:04.1536452Z 
2024-10-22T12:32:04.2442882Z D:\a\1\Infrastructure\apim\apim.bicep(23,71) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service/policyFragments'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
2024-10-22T12:32:04.2463761Z 
2024-10-22T12:32:04.2508627Z D:\a\1\Infrastructure\apim\apim.bicep(30,67) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service/policyFragments'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
2024-10-22T12:32:04.2509724Z 
2024-10-22T12:32:04.2514208Z D:\a\1\Infrastructure\__shared\src\apim\api-registration\api-registration.bicep(36,48) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
2024-10-22T12:32:04.2839690Z 
2024-10-22T12:32:04.3906384Z D:\a\1\Infrastructure\__shared\src\apim\api-registration\api-registration.bicep(38,34) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service/backends'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
2024-10-22T12:32:04.3938469Z 
2024-10-22T12:32:04.4028408Z D:\a\1\Infrastructure\__shared\src\apim\api-registration\api-registration.bicep(47,26) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service/apis'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
2024-10-22T12:32:04.4513662Z 
2024-10-22T12:32:04.4519277Z D:\a\1\Infrastructure\__shared\src\apim\api-registration\api-registration.bicep(63,44) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service/apis/operations'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
2024-10-22T12:32:04.4528223Z 
2024-10-22T12:32:04.4533647Z D:\a\1\Infrastructure\__shared\src\apim\api-registration\api-registration.bicep(73,50) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service/apis/operations'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
2024-10-22T12:32:04.4535199Z 
2024-10-22T12:32:04.4551306Z D:\a\1\Infrastructure\__shared\src\apim\api-registration\api-registration.bicep(80,49) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service/apis/operations/policies'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]
2024-10-22T12:32:04.4552842Z 
2024-10-22T12:32:04.4555965Z D:\a\1\Infrastructure\__shared\src\apim\api-registration\api-registration.bicep(92,38) : Warning use-recent-api-versions: Use more recent API version for 'Microsoft.ApiManagement/service/apis/policies'. '2022-08-01' is 813 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2024-05-01 [https://aka.ms/bicep/linter/use-recent-api-versions]

And in VS Code, when I edit the file I have this warning:
Image

And when I CTRL+Space to display the available version:
Image

It really looks like Azure/bicep#15152

@stephaniezyen
Copy link
Contributor

This is a version issue with the Microsoft.ApiManagement resource - please open a support ticket with this resource provider

@stephaniezyen stephaniezyen transferred this issue from Azure/bicep Oct 23, 2024
@github-project-automation github-project-automation bot moved this to Todo in Bicep Oct 23, 2024
@dozer75
Copy link

dozer75 commented Oct 23, 2024

@mgrosperrin I do agree with you seeing your logs... It seems like a similar issue with another resource 😕 Its strange that they suddenly having lots of issues with version syncs...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

3 participants