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://docs.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.
By default, auto-upgrade for Azure CLI is disabled. If you would like to keep up with the latest version, you can enable auto-upgrade through configuration. The Azure CLI will check new versions regularly and prompt you to upgrade after any command finishes running once the update is available.
The Azure Command-Line Interface (CLI) is a cross-platform command-line tool that can be installed locally on Windows computers. You can use the Azure CLI for Windows to connect to Azure and execute administrative commands on Azure resources.
The current version of the Azure CLI is 2.39.
Once the CLI is installed, you can check if the utility has been correctly installed by running the command “az –version“. This command will show the current version of the tool and the other modules that are available to be used by the CLI tool. Note that in the figure below, the installed version of the tool is 2.5.
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:
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With