Manage Extension in Azure CLI
Like any other scripting language, you can add, remove, upgrade the extension in the Azure CLI to leverage the other tools and third-party extension features.
To get the help with Azure extension write the below command,
az extension -h
Output:
List Installed Extensions:
To list all the installed extensions use the below command.
az extension list -otable
This output will be blank if you have installed AZ CLI tool newly and haven’t installed any extension.
List available extensions:
To list all the available extensions, you can use list-available switch.
az extension list-available -otable
Install new Extension:
To install the new extension us the Add switch command.
For example, we need to add the Azure DevOps extension and its name is azure-devops in the list. Use the below command to install the extension.
az extension add --name azure-devops
Once the extension is installed, you can verify using the list command. For example,
az extension list -otable
Output:
You can check the path of the installed extension and it is on the “C:\Users\Administrator.azure\cliextensions\azure-DevOps“. We can also check its actual path on the local disk.
This extension is available only for the local user not for all the users. You need to select the option System to install the extension on the System drive, use the below command.
az extension add --name azure-devops --system
You can see the path of the extension is in the Program Files (x86) and that will be available to all the users.
To install the specific version of the extension you need to use –Version parameter.
az extension add --name azure-devops --version 1.0.0.0
Remove AZ CLI Extension:
To remove the AZ CLI extension, we need to use —Remove parameter.
az extension remove --name azure-devops
To learn more about the AZ extensions, use the below link.
https://docs.microsoft.com/en-us/cli/azure/extension?view=azure-cli-latest#az_extension