Install and Configure Azure CLI in Ubuntu.

There are multiple way to install Azure cli in ubuntu so below are the the two ways from those options.

Way 1: Install azure cli on ubuntu using the below commands.

  • apt install curl -y
  • curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
  • apt-get update
  • apt-get install azure-cli

Way 2. 

  1. Install the packages:
  •  sudo apt-get update
  •  sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg.

    2. Download and install the Microsoft signing key:

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

    3. Add the Azure CLI software repository:

  • 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

     4. Install the azure-cli package:

  • sudo apt-get update

  • sudo apt-get install azure-cli

     5. Now Login into azure using azure cli:

  •  az login

If the CLI can open your default browser, it will do so and load an Azure sign-in page.

Otherwise, open a browser page at https://aka.ms/devicelogin and enter the authorization code displayed in the terminal.

If no web browser is available or the web browser fails to open, use device code flow with az login –use-device-code.

 

 

Leave a Reply