Logging in to the Azure CLI

Procedure

  1. Issue the following command to log in to the Azure CLI.
    az login

    The output is similar to the following message.

    To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ASFEGVB4R to authenticate.
  2. Open https://microsoft.com/devicelogin in a browser and enter the code from the message in step 1. Then select a login method, such as login via IBM.

    After you log in, the output is similar to the following message.

    Microsoft
    Microsoft Azure Cross-platform Command Line Interface
    You have signed in to the Microsoft Azure Cross-platform Command Line Interface application on your device. You may now close this window.
  3. View the list of available accounts and record the tenant ID for the subscription that you want to use for your cluster by using the following command.
    az account list --refresh
    The output is similar to the following example.
    [root@shahram-bastion1 ~]# az account list --refresh
    [
      {
        "cloudName": "AzureCloud",
        "homeTenantId": "fcf67057-50c9-4ad4-98f3-ffca64add9e9",
        "id": "0d7348f2-27a0-4fd2-8a5e-d9b7df304533",
        "isDefault": true,
        "managedByTenants": [],
        "name": "Microsoft Azure Enterprise",
        "state": "Enabled",
        "tenantId": "fcf67057-50c9-4ad4-98f3-ffca64add9e9",
        "user": {
          "name": "spourali@ibm.com",
          "type": "user"
        }
      },
      {
        "cloudName": "AzureCloud",
        "homeTenantId": "32bfacf3-8eb1-498d-b7d9-6f567cf065cd",
        "id": "297d75cf-ac86-4cb7-81f3-e4e400469453",
        "isDefault": false,
        "managedByTenants": [],
        "name": "Project-IBMSecurity-IS-POC-EA-DEV-Test",
        "state": "Enabled",
        "tenantId": "32bfacf3-8eb1-498d-b7d9-6f567cf065cd",
        "user": {
          "name": "spourali@ibm.com",
          "type": "user"
        }
      }
    ]
  4. To set the default resource subscription, run the following command.
    az account set -s <subscription_id>
  5. View your active account details by running this command.
    az account show
    The output is similar to the following example.
    [root@shahram-bastion1 ~]# az account show
    {
      "environmentName": "AzureCloud",
      "homeTenantId": "32bfacf3-8eb1-498d-b7d9-6f567cf065cd",
      "id": "297d75cf-ac86-4cb7-81f3-e4e400469453",
      "isDefault": true,
      "managedByTenants": [],
      "name": "Project-IBMSecurity-IS-POC-EA-DEV-Test",
      "state": "Enabled",
      "tenantId": "32bfacf3-8eb1-498d-b7d9-6f567cf065cd",
      "user": {
        "name": "spourali@ibm.com",
        "type": "user"
      }
    }

What to do next

After you run the az account show command, record the values of the id and tenantId parameters to use when you install OpenShift® Container Platform.