Setting Up Azure CLI on Ubuntu Linux

Azure has a great web interface called azure portal for performing all the functions. But if you prefer command line tools over graphical user interface, you can make use of azure command line interface to manage all azure resources.

Setting up Azure CLI on Ubuntu

This tutorial will guide you for setting up azure cli on Ubuntu Linux systems.

Azure cli need nodejs runtime for performing the cli operations. Execute th following commands for installing azure cli using npm.

If you would like to install it from source, you can use the following commands.

Verify Installation:

Once installed, verify the installation using the following command.

Configuring CLI with Azure Subscription

To connect to your azure subscription, you should configure your cli for authentication. You can do this by executing the following command.

The above command will output an url and code to get authenticated via browser. Open the url in a browser, enter the code and login to your azure account. Once you are done with it, you will see the confirmation in your command line as shown below.

Adding Subscriptions

If you have different subscriptions with you azure account, you can add a specific subscription for cli. To do that, get the subscription name using the following command.

Add then, you can set a specific subscription using the following command.

Authentication Using Publishsettings File

You can also use the publishsetting file to authenticate against azure. Execute the following command to download the publishsetting file.

You will get the below output.

Go the link specified in your output and download the file. Once downloaded, execute the following command to import the file.

Free DevOps Resources

Get DevOps news, tutorials and resources in your inbox. A perfect way If you want to get started with devops. Like you, we dont like spam.