You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes there are breaking changes between the latest API version and a previous one. If a user updates Azure CLI (which updates API versions), but doesn't want to migrate to the latest API version immediately, error may occur due to these breaking changes.
Sometimes a latest API version available in AzureCloud may not be available in sovereign clouds (Latest API version not available in sovereign clouds #23985). If a user updates Azure CLI (which updates API versions), error may occur in sovereign clouds.
Describe the solution you'd like
Add global argument --api-version to each command to support choosing API version.
Additional context
Technical difficulties:
Azure SDKs bundled in Azure CLI packages are now trimmed to reduce package size. Only declared API versions are preserved ({Packaging} Trim mgmt SDKs #23946). If we allow each command to use a random API version, all versions in Python SDKs must be kept, which will revert Azure CLI package to its original huge size.
Is your feature request related to a problem? Please describe.
Azure CLI uses
latestprofile for public and sovereign clouds.azure-cli/src/azure-cli-core/azure/cli/core/profiles/_shared.py
Lines 155 to 158 in fccca99
This approach has some problems:
AzureCloudmay not be available in sovereign clouds (Latest API version not available in sovereign clouds #23985). If a user updates Azure CLI (which updates API versions), error may occur in sovereign clouds.Describe the solution you'd like
Add global argument
--api-versionto each command to support choosing API version.Additional context
Technical difficulties:
azure-mgmt-network, there are currently 51 API versions: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/network/resource-manager/Microsoft.Network. Supporting all of them requires huge amount of work.--api-versionargument.