Azure CLI'de (GNU / Linux kullanıyorum):
$ azure login # add "-e AzureChinaCloud" if you're using Azure China
Bu sizden https://aka.ms/devicelogin veya https://aka.ms/deviceloginchina üzerinden giriş yapmanızı isteyecektir.
$ azure account show
info: Executing command account show
data: Name : BizSpark Plus
data: ID : aZZZZZZZ-YYYY-HHHH-GGGG-abcdef569123
data: State : Enabled
data: Tenant ID : 0XXXXXXX-YYYY-HHHH-GGGG-123456789123
data: Is Default : true
data: Environment : AzureCloud
data: Has Certificate : No
data: Has Access Token : Yes
data: User name : nico@XXXXXXX.onmicrosoft.com
data:
info: account show command OK
ya da sadece:
azure account show --json | jq -r '.[0].tenantId'
veya yeni az:
az account show --subscription a... | jq -r '.tenantId'
az account list | jq -r '.[].tenantId'
Umut ediyorum bu yardım eder