-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Previously reported by
Microsoft.Cdn: Need a central place to record the Azure cli api-version change #16094Microsoft.Storage: Wrong api version used for enabling atp with the azure-cli on a storage account in China tenant #18828, az storage endpoint not available for AzureCLI 2.20.0 in Azure Goverment #17189Microsoft.ManagedIdentity: AzureUSGovernment;az identity create; NoRegisteredProviderFound API version2021-09-30-previewfor typeuserAssignedIdentities#22661Microsoft.KeyVault: Azure Key Vault API Error - Azure CLI version 2.30.0 #20226, "az keyvault update" not working in Azure China after upgrading to 2.40.0 #23888
Symptom
We have a centralized location to define API versions for each resource provider:
azure-cli/src/azure-cli-core/azure/cli/core/profiles/_shared.py
Lines 154 to 158 in daa5685
| AZURE_API_PROFILES = { | |
| 'latest': { | |
| ResourceType.MGMT_STORAGE: '2022-05-01', | |
| ResourceType.MGMT_NETWORK: '2022-01-01', | |
| ResourceType.MGMT_COMPUTE: SDKProfile('2022-03-01', { |
Azure CLI supports 4 clouds, including 3 sovereign clouds:
AzureCloudAzureChinaCloudAzureUSGovernmentAzureGermanCloud
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.