DEV Community

Cover image for Azure-cli: Installing the tool on Linux
romerito
romerito

Posted on

2

Azure-cli: Installing the tool on Linux

This post is the beginning of a series of others in which we will talk about Azure Cli. This tool is a command line interface in which one can manage microsoft azure resources.
My current linux is that.

romerito@dev:~$ cat /etc/os-release | head -3

NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
Enter fullscreen mode Exit fullscreen mode

My OS as you can see is PopOS which was built based on the ubuntu/debian architecture, so we will use the APT package manager (Advanced package tool).
There are several ways to install the program, but we have chosen the method of setting up the repository on our own machine.
First we will update our distro using this command:

romerito@dev:~$ sudo apt-get update\
&& sudo apt-get install ca-certificates\
curl\ 
apt-transport-https lsb-release\
gnupg
Enter fullscreen mode Exit fullscreen mode

Now we need to use the gpg utility to authorize external repositories via apt.
but the utility only accepts GPG files, and in this case we need to convert from KEY to GPG, this is possible by passing the --dearmor flag after that we can add the repository link to the package source list.

romerito@dev:~$ curl -sL https://packages.microsoft.com/keys/microsoft.asc |
    gpg --dearmor |
    sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
Enter fullscreen mode Exit fullscreen mode

And finally we add the repository

romerito@dev:~$ 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
Enter fullscreen mode Exit fullscreen mode

After that, we update the system again and install the package

romerito@dev:~$ sudo apt-get update &&
sudo apt-get install azure-cli
Enter fullscreen mode Exit fullscreen mode

Ready! now if you type the command az in the terminal we will have this.

Image description

In the next post we will link cli to our microsoft azure account, see you later.

Image of Wix Studio

2025: Your year to build apps that sell

Dive into hands-on resources and actionable strategies designed to help you build and sell apps on the Wix App Market.

Get started

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay