Showing posts with label Azure. Show all posts
Showing posts with label Azure. Show all posts

Wednesday, July 20, 2022

Setting Up Azure CLI on Linux for Seamless Azure Management

Introduction

The Azure CLI (Command-Line Interface) is a powerful tool that enables seamless interaction with Azure resources. In this blog post, we'll walk through the process of setting up Azure CLI on a Linux machine. Whether you are an administrator, developer, or an Azure enthusiast, having Azure CLI locally on your Linux computer allows you to execute administrative commands efficiently.

Prerequisites

Before we start, ensure you have the following prerequisites:

  • A Linux computer
  • Administrative privileges on the Linux machine

Step-by-Step Guide

Step 1: Import Microsoft Repository Key

Open your terminal and run the following command to import the Microsoft repository key:

bash
$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
Step 2: Create Local Azure-CLI Repository Information

Create and configure the local Azure CLI repository information by running the following commands:

bash
$ sudo sh -c 'echo -e "[azure-cli]
name=Azure CLI
baseurl=https://packages.microsoft.com/yumrepos/azure-cli
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/azure-cli.repo'


Step 3: Install Azure CLI

Install Azure CLI using the yum install command:

bash
$ sudo yum install azure-cli -y

Step 4: Check the Installed Version

Verify the successful installation by checking the installed version of Azure CLI:

bash
$ az --version

Conclusion

Congratulations! You've successfully set up Azure CLI on your Linux machine. With Azure CLI, you can now execute a wide range of administrative commands, manage Azure resources, and streamline your interactions with Azure services directly from the command line.

For more details and additional options, you can refer to the official documentation: Install Azure CLI on Linux.

Now you're ready to explore and harness the power of Azure CLI for efficient Azure management on your Linux environment. Happy coding!

Azure Cli Installation in Ubuntu (Debian)

The Azure CLI is a cross-platform command-line tool that can be installed locally on Linux computers. You can use the Azure CLI on Linux to connect to Azure and execute administrative commands on Azure resources. The CLI on Linux allows the execution of various commands through a terminal using interactive command-line prompts or a script.

Step 1:  Get packages needed for the install process
   $ sudo apt-get update
   $ sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg
   
Step 2: Download and install the Microsoft signing key

$ sudo curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null
Step 3: Add the Azure CLI software repository

$ sudo AZ_REPO=$(lsb_release -cs) echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
Step 4: Update repository information and install the azure-cli package
$ sudo apt-get update $ sudo apt-get install azure-cli
Step 5: Check the Azure cli version installed
$ az --version

Ref: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots= apt

Featured Post

Ansible Tool Introduction

                                                                                                                                    Next ...