Set your Azure subscription if you have more than one

Adam Bulgatz 2024-10-03 00:02:27 -05:00
parent 4cece0f049
commit 964d03bed0

@ -1,8 +1,9 @@
#### Prerequisites
You need the Azure Cli 2.0 tools to create a service principal for access to your DNS Zone.
Either install Azure Cli 2.0 locally or use the Azure Cloud Shell
You need the Azure Cli 2.0 tools to create a service principal for access to your DNS Zone.
Either install Azure Cli 2.0 locally or use the Azure Cloud Shell in Bash mode.
See https://docs.microsoft.com/en-us/cli/azure/overview?view=azure-cli-latest
See [
Azure Command-Line Interface (CLI) documentation](https://docs.microsoft.com/en-us/cli/azure/overview?view=azure-cli-latest)
#### Log-in to Azure
(not required when using the Azure Cloud Shell)
@ -26,6 +27,52 @@ az login
}
]
```
#### Set your Azure subscription if you have more than one
```
az account list
```
```json
[
{
"cloudName": "AzureCloud",
"homeTenantId": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"id": "baaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"isDefault": true,
"managedByTenants": [],
"name": "Subscription A",
"state": "Enabled",
"tenantId": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"user": {
"cloudShellID": true,
"name": "email@example.com",
"type": "user"
}
},
{
"cloudName": "AzureCloud",
"homeTenantId": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"id": "caaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"isDefault": false,
"managedByTenants": [],
"name": "Subscription B",
"state": "Enabled",
"tenantId": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"user": {
"cloudShellID": true,
"name": "email@example.com",
"type": "user"
}
}
]
```
```
az account set --subscription "Subscription B"
```
#### List your DNS Zones
```