Azure CLI에서 (GNU / Linux를 사용합니다) :
$ azure login # add "-e AzureChinaCloud" if you're using Azure China
https://aka.ms/devicelogin 또는 https://aka.ms/deviceloginchina 를 통해 로그인하라는 메시지가 표시됩니다
$ 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
또는 간단히 :
azure account show --json | jq -r '.[0].tenantId'
또는 새로운 az :
az account show --subscription a... | jq -r '.tenantId'
az account list | jq -r '.[].tenantId'
나는 그것이 도움이되기를 바랍니다