19

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.

4
  • Where do you want to upgrade the Azure CLI? Windows? Linux? Commented Sep 12, 2019 at 6:56
  • @CharlesXu Windows Commented Sep 12, 2019 at 6:57
  • 1
    I don't think you can find the command to upgrade the CLI, in Windows, you just need to download the new installer and install it. Commented Sep 12, 2019 at 6:59
  • 3
    choco install azure-cli, that is if you have choco Commented Sep 12, 2019 at 7:00

4 Answers 4

14

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.

Sign up to request clarification or add additional context in comments.

Comments

11

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.

1 Comment

Yes this is exactly what I was looking for back then. It's very nice and convenient now.
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.

3 Comments

I've tried doing that and still getting this, You have 2 updates available. Consider updating your CLI installation.
I ran the installer, updated, and now it says Your CLI is up-to-date. :\
I removed everything related to azure and then started fresh. It worked. Thank you :)
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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.