How to update azure-cli on Windows?

based on what you've said:

I'm looking for something similar to apt-get command in Linux for installing, upgrading and cleaning packages.

You could update Azure CLI with the help of Chocolatey. Chocolatey is a package manager for Windows (like apt-get but for Windows).

Once you have Chocolatey installed (I use it for most of my application installations on Windows), you can install the Azure CLI package that you want to update like this from the Command Line:

choco upgrade azure-cli

You end-up seeing an screen like this:

enter image description here

As you can see from the previous image I'm updating from version 2.0.45 in to version 2.8.0. Once the installation is complete you should be able to see ii reflected:

az --version
azure-cli                          2.8.0

...

Your CLI is up-to-date.

I hope it helps.


Check the docs: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest#install-or-update

You can download a new installer from there and execute it to update your CLI version.


From Microsoft's documentation:

The CLI provides an in-tool command to update to the latest version:

az upgrade

However the documentation notes:

The az upgrade command was added in version 2.11.0 and will not work with versions prior to 2.11.0.