Configure Azure CLI

This guide will walk you through configuring the Azure CLI (az) for your Azure account.

Note

If you have already configured az for your account, you may proceed to the Verify section.

What You'll Need

  • An Azure account.

Procedure

Sign in interactively using the Azure CLI's default authentication method that uses a web browser and access token.

  1. Run the login command:

    root@rok-tools:~# az login
    To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXXXXXXX to authenticate.
    
  2. Open your browser, go to https://microsoft.com/devicelogin and enter the authorization code displayed in your terminal.

  3. Sign in with your account credentials in the browser.

  4. Switch back to your management environment, and add the aks-preview extension:

    root@rok-tools:~# az extension add --name aks-preview
    
  5. Update the aks-preview extension to the latest version available:

    root@rok-tools:~# az extension update --name aks-preview
    

Verify

  1. Verify you have successfully signed in to your account:

    root@rok-tools:~# az account show
    {
      "environmentName": "AzureCloud",
      "homeTenantId": "b478f816-f0bc-49db-aca1-57aae4be5493",
      "id": "700556b9-3e58-4978-9cd4-6cb3d7310e03",
      "isDefault": true,
      "managedByTenants": [],
      "name": "Azure subscription",
      "state": "Enabled",
      "tenantId": "b478f816-f0bc-49db-aca1-57aae4be5493",
      "user": {
        "name": "jdoe@example.com",
        "type": "user"
      }
    }
    
  2. Verify you can access Azure Kubernetes Service:

    root@rok-tools:~# az aks list
    []
    

Summary

You have successfully configured the Azure CLI for your account in your management environment.

What's Next

The next step is to set up your cloud environment.