我的问题是:不使用powershell命令可以获得azure活动目录租户id吗?
我找到了这两个博客,有了这个帮助,我已经能够从powershell获得租户ID和订阅ID。这是找回房客的唯一方法吗?
在Windows PowerShell中获取Windows Azure活动目录租户ID
Windows Azure AD认证支持PowerShell
谢谢
我的问题是:不使用powershell命令可以获得azure活动目录租户id吗?
我找到了这两个博客,有了这个帮助,我已经能够从powershell获得租户ID和订阅ID。这是找回房客的唯一方法吗?
在Windows PowerShell中获取Windows Azure活动目录租户ID
Windows Azure AD认证支持PowerShell
谢谢
当前回答
使用Azure门户:
步骤1:登录azure门户,搜索azure Active Directory并选择它。 Step2:在Azure Active Directory的概览页面中,找到租户ID。
使用Azure CLI:
使用命令az login、az account list或az account tenant list。在每个命令的输出中为每个订阅查找TenantId属性。
使用Powershell
在powershell cmdlet中使用以下命令。
Connect-AzAccount
Get-AzTenant
参考:
Azure CLI
Get-Aztenant
其他回答
在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'
我希望这对你们有帮助
访问https://login.windows.net/YOURDIRECTORYNAME.onmicrosoft.com/.well-known/openid-configuration,您将看到一堆包含租户ID的url。
一键回答:
打开这个URL:
https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/Properties
您还可以通过登录url resoures.azure.com获得租户id,实际上是所有的订阅详细信息
我使用跟踪来获取租户id
az account show --query homeTenantId --output tsv