You can use Azure CLI az account list to get the tenant id for your Azure account.
Get Azure tenant id and subscription id:
1 2 3 4 5 6 7 8 9 |
## Get all tenant id and subscription id az account list --all \ --query '[].{UserName:user.name, TenantID:tenantId, SubscriptionID:id}' \ --output table ## Get current default tenant id and subscription id az account list --all \ --query '[?isDefault].{UserName:user.name, TenantID:tenantId, SubscriptionID:id}' \ --output table |