Getting Started with Azure CLI

Length: 00:14:44

Lesson Summary:

Before we work with the Azure CLI, we first need to install it, connect it, and configure it.

In this lesson we perform an installation of Azure CLI on an Ubuntu Linux server. This process is quite similar for other versions of Linux and macOS.

Once the installation is complete, we connect to an Azure subscription and walk through the configuration of default settings for our user profile.

Commands and Links Used In This Lesson

  • Azure CLI installation documentation
  • Checking the Azure CLI version: az --version
  • Interactively logging in to Azure: az login
  • Listing the available subscriptions in a table: az account list -o table
  • Setting a subscription to be active: az account set -s "subscription"
  • Changing configuration options: az configure

All commands used if you wish to follow along:

sudo apt-get update
sudo apt-get install curl apt-transport-https lsb-release gnupg

curl -sL https://packages.microsoft.com/keys/microsoft.asc | \
    gpg --dearmor | \
    sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null

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

sudo apt-get update
sudo apt-get install azure-cli

az --version

az login

az account list -o table

az account set -s "LA Lab Subscription"

az configure

cd ~
ls -la
cd .azure
vi config

This lesson is only available to Linux Academy members.

Sign Up To View This Lesson

Or Log In

Looking For Team Training?

Learn More