Microsoft Azure - Install Azure Command Line Interface (Azure CLI)
Last Updated :
22 Nov, 2023
Azure CLI is a very powerful tool that can be used to automate tasks, create, update, manage or delete azure resources or to troubleshoot problems with az module cmdlets. By installing az modules on your system or on your development system you and your development team can easily create, update or manage Azure AD and Azure resources such as management groups, subscriptions, resource groups, virtual machines, virtual networks, storage accounts, web apps or any other Azure native services directly from the command line interface.
If you are looking for a powerful and easy-to-use way to manage Azure resources, then you must definitely learn and make use of this Azure CLI command line tool to simplify the management across Azure services.
Requirements
- One should have administrator privileges on Windows System to install Azure CLI.
- The Azure CLI installer requires .NET Framework 4.7.2 or later.
Steps for Installing Azure CLI
Step 1: To install the Azure Command Line Interface (Azure CLI) we have to open Windows PowerShell from your system and select Run as Administrator. To Know the commands in Azure CLI to maintain the VMS refer to the Microsoft Azure – Azure CLI Commands to Manage Azure VMs.
.png)
Step 2: Now, we have to create a new PowerShell file to do that use the cmdlet New-Item <file name>.ps1
Syntax:
New-Item <file name>.ps1
Example:
New-Item installAzCLI.ps1

Step 3: Once you are done creating a new PowerShell file. Use the code cmdlet to add the script into the file. Check syntax and example.
Syntax:
Code .\<file name>.ps1
Example:
Code .\installAzCLI.ps1

Step 4: Now in the editor copy and paste the below following code to your PowerShell file <file name>.ps1 and use CTRL+S to save the changes.
$ProgressPreference = 'SilentlyContinue';
Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi;
Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet';
rm .\AzureCLI.msi

Step 5: In step 4 we have saved the Azure CLI installation script. Now, to execute or run the PowerShell script use the following syntax structure .\<file name>.ps1
Syntax:
.\<file name>.ps1
Example:
.\installAzCLI.ps1

Wait until the installation is complete. (It might take 2-3 minutes to install az cli modules)

Verify Azure CLI Installation
Once the installation is complete, you can verify the installation was successful or not by by just typing the command az or az -h:
az
This az command will list the available Azure CLI commands.
az -h
This will also list the available Azure CLI commands. Check out the sample output for better understanding.
Sample Output:

If you wish to check the Azure CLI then you may check the version of Az CLI on your system by running this below command:
az version
This will list the versions of azure cli, azure cli core, azure cli telemetry and extensions version if any.
Sample Output:

To build your own CLI extension refer to Microsoft Azure – Building Your Own Azure CLI Extensions.
Clean Up or Uninstall Azure CLI from your Environment:
On your Desktop Click on Windows Start button > Go to Settings > select Apps >> select Apps & Features >> Search for Azure CLI >> Select Azure CLI service >> Click on Uninstall to continue the removal of Azure CLI.
Removal will take around 5-10 minutes. Wait until it's done and verify the removal of Azure CLI.

Verify Uninstallation of Azure CLI
Open Azure PowerShell or Command Prompt and type "az --version." If you are not getting any preview of Azure CLI, then you have successfully removed Azure CLI from your environment.
Sample Output before and after the removal of Azure CLI:

Similar Reads
How to Manage Azure CLI Extensions in Command Line Interface?
In this article, we are going to provide the steps on how to list, find, install, update, and remove Azure CLI extensions from Azure Command Line Interface (Azure ACI) or Azure Cloud Shell. What are Azure CLI Extensions?Azure CLI or Command Line Interface is a powerful tool developed by Microsoft us
4 min read
Microsoft Azure -Create a User in Microsoft Entra ID from Azure Portal
A user in Microsoft Entra ID is an individual who can get access to Azure identity. This Microsoft Entra ID identity can be used to access applications and resources that are protected within the organization or project. Users can be created manually or automatically, and they can be assigned to gro
3 min read
Microsoft Azure-Rename Azure DevOps Repo
Here in this article, we will explain to you the step-by-step process on how to rename an Azure DevOps Repo and a few important checklist points that you should consider when renaming a repo in Azure DevOps. Before we move ahead to renaming the Azure Repo. Let's understand what is Azure Repo and its
4 min read
Microsoft Azure- Building and running a MEAN-based application in Azure
MEAN stack refers to the technology stack that is often used together to build web applications, and is an abbreviation that stands for: M: MongoDB - A NoSQL Database.E: ExpressJS - A web server framework for Node.js, based on JavaScript.A: Angular - A frontend framework, based on JavaScript.N: Node
9 min read
How To Install Microsoft Edge On Linux?
Want to set up Microsoft Edge on a Linux system? Linux users may now access Microsoft Edge, which was previously only available on Windows. Microsoft Edge for Linux is simple to download and use as your daily browser, regardless of the distribution you're usingâUbuntu, Debian, or another. Regardless
4 min read
How to Install NuGet from Command Line on Linux?
NuGet is the package manager for the .NET framework. It's very much useful for developers as developers can create, publish and consume packages. The package format of NuGet consists of a single ZIP file with the extension of .nupkg and which is the DLL compiled code like the packageâs version numbe
2 min read
How to Check the License Type of a Specific Azure VM using PowerShell Command?
In this article, we will show you how to use the Get-AzVM command to check the license type of an Azure VM. We will also tell you about the different license types for Azure VMs. Azure virtual machines (VMs) can be licensed in different ways, like Azure Hybrid Benefit, pay-as-you-go, and Bring Your
3 min read
How to Install and configure Jenkins on Debian Linux (Ubuntu/Kali/Mint)
Jenkins is an open-source, cross-platform automation server that is used to build, test and deploy software. It simplifies and accelerates Continuous Integration/Continuous Delivery (CI/CD) environments by creating jobs, scripts, and pipelines. The application is primarily written in Java and requir
2 min read
How To Deploy A Container To Azure Container Instances ?
In layman's terms, how will it feel when a developer develops an app and a member of the testing team tries to test the application on his/her OS? They will have to install the packages, and libraries required to run the app. Well, in this case, the container makes it easy and faster to rapidly depl
8 min read
How to Install SQL Server on Azure VM?
Microsoft Azure provides us with multiple database services which help us to run popular relational database management systems, like MySQL, SQL Server, and PostgreSQL in the cloud. We can use an SQL server on Azure Virtual machines by running a virtual machine in Azure and installing an SQL server
5 min read