In this article, we delve into the nitty-gritty of installing Azure Command Line Interface (CLI) on Ubuntu 24.04 LTS. Azure CLI is an open-source toolset that provides a unified scripting platform for managing and administering Azure resources. It offers a clean syntax, impressive expression capabilities, and detailed command specifications, making it a first-choice tool for many developers.
Step 1: Update System Packages
Before installing Azure CLI, it’s crucial to update your system packages. This ensures that you are working with the latest versions of all packages and their dependencies. Open a terminal and execute the following commands:
sudo apt update sudo apt upgrade
Subsequently, install the necessary packages with the commands below:
sudo apt install ca-certificates curl apt-transport-https lsb-release gnupg
Step 2: Installation of Azure CLI
With all necessary packages installed, you can now proceed to install Azure CLI. First, you need to download and install the Microsoft signing key with the following command:
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
Next, add the Azure CLI software repository that contains the package files for Azure CLI. Use the following command to add the repository:
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
Finally, install Azure CLI using the apt package manager. Run the following commands to install Azure CLI:
sudo apt update
sudo apt install azure-cli
Step 3: Verifying the Installation
After installing Azure CLI, verify the installation by checking the Azure CLI version. Execute the following command to display the version:
az --version
If a more recent version of Azure CLI is available, you can update it using the apt package manager. Execute the following commands to update Azure CLI:
sudo apt update
sudo apt upgrade azure-cli
Step 4: Logging into Azure from CLI
With Azure CLI installed and updated, you can now log into your Azure account. Execute the following command to initiate the login process:
az login
This command opens a new browser window where you can complete the authentication process. If you’re running Azure CLI on a remote server, you can use the device code displayed in the terminal to authenticate on another device.
Azure CLI provides a plethora of commands for managing Azure resources. Here are some common commands and their uses:
az group create
: Creates a new resource group.az vm create
: Creates a new virtual machine.az storage account create
: Creates a new storage account.
If you are looking for a reliable and efficient server to host your applications, consider Shape.host Linux SSD VPS services. They offer top-notch hosting services that can be customized to fit your specific needs. With their services, you can focus on what matters most – growing your business – while they take care of your hosting needs.