From 964d03bed000320de395db6a601c484833f407ad Mon Sep 17 00:00:00 2001 From: Adam Bulgatz Date: Thu, 3 Oct 2024 00:02:27 -0500 Subject: [PATCH] Set your Azure subscription if you have more than one --- How-to-use-Azure-DNS.md | 53 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/How-to-use-Azure-DNS.md b/How-to-use-Azure-DNS.md index fe42f8c..270b63a 100644 --- a/How-to-use-Azure-DNS.md +++ b/How-to-use-Azure-DNS.md @@ -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 ```