Contents

Get Azure Active Directoy Tenant ID and Subscription ID

Requirements

Install the Azure PowerShell

1
Install-Module -Name Az -AllowClobber -Scope CurrentUser

Get Tenant and Subscription Details during Login

To get your Tenant ID / Name and Subscription ID / Name you have several options with PowerShell, one option is using

1
Connect-AzAccount

which directly gives you your default Subscription Name as well as your default Tenant ID after logging in.

Get Tenant and Subscription details from the Context

Another option is using

1
Get-AzContext | Select-Object *

which gets the metadata used to authenticate Azure Resource Manager requests.

Some more details you get with

1
Get-Aztenant

which gets tenants that are authorized for your current user.