Azure / azure-cli

Azure Command-Line Interface
MIT License
3.91k stars 2.88k forks source link

Latest API version not available in sovereign clouds #23985

Open jiasli opened 1 year ago

jiasli commented 1 year ago

Previously reported by

Symptom

We have a centralized location to define API versions for each resource provider:

https://github.com/Azure/azure-cli/blob/daa568579dbaec5af1ac92d261014cf9ce3ff9b1/src/azure-cli-core/azure/cli/core/profiles/_shared.py#L154-L158

Azure CLI supports 4 clouds, including 3 sovereign clouds:

All of them use the same latest profile and the same API version for each resource provider.

However, it happens frequently that a new API version is only deployed to AzureCloud, but not other clouds. Using Azure CLI to call that API version leads to error like:

NoRegisteredProviderFound - No registered resource provider found for location 'chinanorth' and API version '2019-06-15-preview' for type 'profiles/endpoints'. The supported api-versions are '2015-06-01, 2016-04-02, 2016-10-02, 2017-04-02, 2017-10-12, 2018-04-02, 2019-04-15'. The supported locations are 'chinanorth, chinanorth2, chinaeast, chinaeast2'.

Temporary workaroud

Install previous versions of Azure CLI that use old API versions in sovereign clouds. The installation document has detailed instruction on how to install previous versions: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli

Solution

Service team should deploy the new API version to all clouds synchronously.

jiasli commented 1 year ago

A similar issue is when a new API version is only deployed to certain regions, but not other regions. This happened for network RP before:

jiasli commented 1 year ago

Azure PowerShell faces the same issue:

jonathanzhang02 commented 1 year ago

Hi this happened again in our pipeline, could some actions be taken to ensure API version consistencies in sovereign clouds?

08:53:58  fatal: [127.0.0.1]: FAILED! => {"attempts": 3, "changed": true, "cmd": "az keyvault update  --resource-group \"modelt-tcyz0otvcne\"  --name \"modelt-tcyz0otvcne-vault\"  --default-action Deny\n", "delta": "0:00:02.765346", "end": "2023-04-06 00:53:56.239069", "msg": "non-zero return code", "rc": 1, "start": "2023-04-06 00:53:53.473723", "stderr": "ERROR: (NoRegisteredProviderFound) No registered resource provider found for location 'chinanorth3' and API version '2023-02-01' for type 'vaults'. The supported api-versions are '2015-06-01, 2016-10-01, 2018-02-14-preview, 2018-02-14, 2019-09-01, 2021-04-01-preview, 2021-06-01-preview, 2021-10-01, 2021-11-01-preview, 2022-07-01, 2022-11-01, 2022-02-01'. The supported locations are 'chinanorth, chinaeast, chinanorth2, chinaeast2, chinanorth3, chinaeast3'.\nCode: NoRegisteredProviderFound\nMessage: No registered resource provider found for location 'chinanorth3' and API version '2023-02-01' for type 'vaults'. 
fangchen0601 commented 12 months ago

Previously reported by

Symptom

We have a centralized location to define API versions for each resource provider:

https://github.com/Azure/azure-cli/blob/daa568579dbaec5af1ac92d261014cf9ce3ff9b1/src/azure-cli-core/azure/cli/core/profiles/_shared.py#L154-L158

Azure CLI supports 4 clouds, including 3 sovereign clouds:

  • AzureCloud
  • AzureChinaCloud
  • AzureUSGovernment
  • AzureGermanCloud

All of them use the same latest profile and the same API version for each resource provider.

However, it happens frequently that a new API version is only deployed to AzureCloud, but not other clouds. Using Azure CLI to call that API version leads to error like:

NoRegisteredProviderFound - No registered resource provider found for location 'chinanorth' and API version '2019-06-15-preview' for type 'profiles/endpoints'. The supported api-versions are '2015-06-01, 2016-04-02, 2016-10-02, 2017-04-02, 2017-10-12, 2018-04-02, 2019-04-15'. The supported locations are 'chinanorth, chinanorth2, chinaeast, chinaeast2'.

Temporary workaroud

Install previous versions of Azure CLI that use old API versions in sovereign clouds. The installation document has detailed instruction on how to install previous versions: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli

Solution

Service team should deploy the new API version to all clouds synchronously.

Hello,

I am using Azure Portal -> cloud shell, could you suggest how to work around this issue?

PSanetra commented 12 months ago

Unlike the issue title suggests this issue is not just affecting sovereign clouds, but also the Azure public cloud. See https://github.com/Azure/azure-cli/issues/26813 and https://github.com/Azure/azure-cli/issues/26814

iamalexmang commented 11 months ago

I find it confusing that the bot would link an issue to another issue which is opened relating to sovereign cloud, when the issue I opened earlier is NOT related to sovereign cloud. Either change the title, or stop linking the issues.

hobti01 commented 7 months ago

Looking forward to a resolution for this issue that is still occurring.

ERROR: (NoRegisteredProviderFound) No registered resource provider found for location 'chinanorth3' and API version '2023-10-02-preview' for type 'managedClusters'. The supported api-versions are '2017-08-31, 2018-03-31, 2019-02-01, 2019-04-01, 2019-06-01, 2019-08-01, 2019-10-01, 2019-11-01, 2020-01-01, 2020-02-01, 2020-03-01, 2020-04-01, 2020-06-01, 2020-07-01, 2020-09-01, 2020-11-01, 2020-12-01, 2021-02-01, 2021-03-01, 2021-05-01, 2021-07-01, 2021-08-01, 2021-09-01, 2021-10-01, 2022-01-01, 2022-01-02-preview, 2022-02-01, 2022-03-01, 2022-03-02-preview, 2022-04-01, 2022-04-02-preview, 2022-05-02-preview, 2022-06-01, 2022-06-02-preview, 2022-07-01, 2022-07-02-preview, 2022-08-01, 2022-08-02-preview, 2022-08-03-preview, 2022-09-01, 2022-09-02-preview, 2022-10-02-preview, 2022-11-01, 2022-11-02-preview, 2023-01-01, 2023-01-02-preview, 2023-02-01, 2023-02-02-preview, 2023-03-01, 2023-03-02-preview, 2023-04-01, 2023-04-02-preview, 2023-05-01, 2023-05-02-preview, 2023-06-01, 2023-06-02-preview, 2023-07-01, 2023-07-02-preview, 2023-08-01, 2023-08-02-preview, 2023-09-01, 2023-09-02-preview'. The supported locations are 'chinaeast2, chinanorth2, chinanorth3'.

Using older versions of the az CLI did not resolve the issue, but using an older version of the extension did. az extension list-versions --name aks-preview helped to find the previous version to install with az extension add --name aks-preview --version $AZURE_CLI_AKS_PREVIEW_EXTENSION_VERSION

jiasli commented 7 months ago

We have an internal ticket IcM 446898172 for this error:

No registered resource provider found for location 'xxx' and API version '2023-10-02-preview' for type 'managedClusters'.

yunbozhang-msft commented 5 months ago

Hi team, what is the progress on this issue?

michaelschuett-tomtom commented 3 months ago

Still running into this issue.

IakimLynnyk-TomTom commented 2 months ago

I'm using Azure Dev Ops and facing this issue, how to fix in ADO?