18

az --version is telling to update my CLI installation without explaining what to do. So what is the az command to install the updates, if there is any? I can't seem to find it anywhere.

I've tried looking for answers here: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest and here: https://github.com/MicrosoftDocs/azure-docs-cli/issues/1341 but can't seem to find anything related to updating it.

my-username@Azure:~$ az --versionazure-cli                         2.0.72 *
command-modules-nspkg               2.0.3
core                              2.0.72 *
nspkg                              3.0.4
telemetry                          1.0.3

Extensions:
interactive                        0.4.3

Python location '/opt/az/bin/python3'
Extensions directory '/home/my-username/.azure/cliextensions'

Python (Linux) 3.6.5 (default, Aug 22 2019, 06:32:32)
[GCC 5.4.0 20160609]

Legal docs and information: aka.ms/AzureCliLegal


You have 2 updates available. Consider updating your CLI installation.

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

Himesh Ravi
  • 193
  • 1
  • 1
  • 9

4 Answers4

12

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.

Sebastian Inones
  • 1,561
  • 1
  • 19
  • 32
9

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.

6

Check the docs: https://learn.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.

juunas
  • 54,244
  • 13
  • 113
  • 149
0

For Ubuntu / Linux try using the below inline script.

pip install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge

az cli task in ADO release pipeline

Sagar Kulkarni
  • 636
  • 9
  • 24