// Module included in the following assemblies:
//
// * installing/installing_azure/installing-azure-account.adoc

:_mod-docs-content-type: PROCEDURE
[id="installation-azure-subscription-tenant-id_{context}"]
= Recording the subscription and tenant IDs

[role="_abstract"]
To record the subscription and tenant IDs that the installation program requires for your {azure-short} account, you can use the {azure-short} CLI.

.Prerequisites

* You have installed or updated the link:https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-yum?view=azure-cli-latest[{azure-short} CLI].

.Procedure

. Log in to the {azure-short} CLI by running the following command:
+
[source,terminal]
----
$ az login
----

. Ensure that you are using the right subscription:

.. View a list of available subscriptions by running the following command:
+
[source,terminal]
----
$ az account list --refresh
----
+
.Example output
[source,terminal]
----
[
  {
    "cloudName": "AzureCloud",
    "id": "8xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "isDefault": true,
    "name": "Subscription Name 1",
    "state": "Enabled",
    "tenantId": "6xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "user": {
      "name": "you@example.com",
      "type": "user"
    }
  },
  {
    "cloudName": "AzureCloud",
    "id": "9xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "isDefault": false,
    "name": "Subscription Name 2",
    "state": "Enabled",
    "tenantId": "7xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "user": {
      "name": "you2@example.com",
      "type": "user"
    }
  }
]
----

.. View the details of the active account, and confirm that this is the subscription you want to use, by running the following command:
+
[source,terminal]
----
$ az account show
----
+
.Example output
[source,terminal]
----
{
  "environmentName": "AzureCloud",
  "id": "8xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "isDefault": true,
  "name": "Subscription Name 1",
  "state": "Enabled",
  "tenantId": "6xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "user": {
    "name": "you@example.com",
    "type": "user"
  }
}
----

. If you are not using the right subscription:

.. Change the active subscription by running the following command:
+
[source,terminal]
----
$ az account set -s <subscription_id>
----

.. Verify that you are using the subscription you need by running the following command:
+
[source,terminal]
----
$ az account show
----
+
.Example output
[source,terminal]
----
{
  "environmentName": "AzureCloud",
  "id": "9xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "isDefault": true,
  "name": "Subscription Name 2",
  "state": "Enabled",
  "tenantId": "7xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "user": {
    "name": "you2@example.com",
    "type": "user"
  }
}
----

. Record the `id` and `tenantId` parameter values from the output. You require these values to install an {product-title} cluster.
