gpt4 book ai didi

azure - 从 azure CLI 获取租户名称

转载 作者:行者123 更新时间:2023-12-03 23:14:46 30 4
gpt4 key购买 nike

我想使用 Azure CLI 检索租户名称 THIS-THING-HERE.onmicrosoft.com。我在文档中确实找不到。

编辑:当我调用 Azure 帐户列表时,由于我使用公司电子邮件登录,因此在提供的域中没有获取用户名:

[
{
"cloudName": "AzureCloud",
"id": "46ee2f65-7112-4c96-ad0a-3ff6ca22a615",
"isDefault": true,
"name": "Visual Studio Professional",
"state": "Enabled",
"tenantId": "1caf5d6b-58cb-40e6-88b3-eb9ab9c0c010",
"user": {
"name": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="85e4abeef7e4efebece4eec5e4f3e4ebe4e1e0abe6eae8" rel="noreferrer noopener nofollow">[email protected]</a>",
"type": "user"
}
},
{
"cloudName": "AzureCloud",
"id": "1efd84d6-173f-42cc-80db-7b2c17eb0edd",
"isDefault": false,
"name": "Microsoft Azure Enterprise",
"state": "Enabled",
"tenantId": "c48d02ad-7efd-4910-9b51-ebb7a4b75379",
"user": {
"name": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f091de9b82919a9e99919bb09186919e919495de939f9d" rel="noreferrer noopener nofollow">[email protected]</a>",
"type": "user"
}
}
]

最佳答案

我用这个:

az account list --query "[?isDefault].tenantId | [0]" --output tsv

关于azure - 从 azure CLI 获取租户名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53279143/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com