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.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay