LinuxCommandLibrary

az-upgrade

Update the Azure CLI to the latest version

TLDR

Upgrade Azure CLI

$ az upgrade
copy

Upgrade Azure CLI and Extensions
$ az upgrade --all
copy

Upgrade Azure CLI and Extensions without prompting for confirmation
$ az version --all --yes
copy

SYNOPSIS

az upgrade [--yes] [--debug] [--help] [--only-show-errors] [--output {json,jsonc,none,table,text,tsv,yaml,yamlc}] [--query JMESPath] [--verbose]

PARAMETERS

--yes
    Do not prompt for confirmation.

--debug
    Increase logging verbosity to show all debug logs.

--help
    Show this help message and exit.

--only-show-errors
    Only show errors, suppressing warnings.

--output {json,jsonc,none,table,text,tsv,yaml,yamlc}
    Specify the output format.

--query JMESPath
    JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose
    Increase logging verbosity. Use --debug for full debug logs.

DESCRIPTION

The `az upgrade` command updates your Azure CLI installation to the most recent available version. It checks for updates from Microsoft's official sources and automatically handles the download and installation process. This ensures you have access to the newest features, bug fixes, and security patches. Running this command is essential for keeping your Azure CLI environment up-to-date and compatible with the latest Azure services and SDKs.

The upgrade process will attempt to install the latest release from the same release channel you are already using. If you are using `az` with Azure Cloud Shell, upgrading isn't possible as the cloud shell automatically updates. Running this command allows you to benefit from improvements and additions Microsoft releases on a regular basis.

Consider running the upgrade command periodically and especially when encountering issues with the CLI to ensure compatibility with the Azure platform. It handles dependencies. It may require administrator privileges depending on your system configuration.

CAVEATS

The upgrade process requires internet connectivity to download the latest Azure CLI version. Ensure that your system can reach Microsoft's update servers. In some environments, like heavily restricted networks, proxy settings may need to be configured before upgrading.

TROUBLESHOOTING

If the upgrade fails, check your network connection and ensure that you have sufficient disk space. Review the error messages for details. You may also need to ensure that you have the necessary permissions to modify the Azure CLI installation directory.

SEE ALSO

az(1), az login(1), az version(1)

Copied to clipboard