我的问题是:不使用powershell命令可以获得azure活动目录租户id吗?

我找到了这两个博客,有了这个帮助,我已经能够从powershell获得租户ID和订阅ID。这是找回房客的唯一方法吗?

在Windows PowerShell中获取Windows Azure活动目录租户ID

Windows Azure AD认证支持PowerShell

谢谢


当前回答

如果你已经安装了Azure CLI,你可以运行下面的命令,

az account list

或者在~/.azure/credentials中找到它

其他回答

For AAD-B2C it is fairly simple. From Azure Portal with a B2C directory associated, go to your B2C directory (I added the "Azure AD B2C" to my portal's left menu). In the B2C directory click on "User flows (policies) directory menu item. In the policies pane click on one of your policies you previously added to select it. It should open a pane for the policy. Click "Properties". In the next pane is a section, "Token compatibility settings" which has a property "Issuer". Your AAD-B2C tenant GUID is contained in the URL.

我的团队真的厌倦了为我们的O365和Azure项目寻找租户ID。开发人员、支持团队、销售团队,每个人都在某个时候需要它,但从来不记得该怎么做。

所以我们建立了这个小网站,与whatismyip.com相同。希望对你有用!

如何找到我的Microsoft 365、Azure或SharePoint在线租户ID?

进入Azure门户> Azure活动目录。 在主屏幕上,您应该看到您的租户ID。

为我工作的是这个(az登录后):

 az account show |grep tenantId | awk {'print $2'} |tr -d '[:punct:]'

微软表示:

找到你的tenantID:你的tenantID可以通过打开以下metadata.xml文档来发现:https://login.microsoft.com/GraphDir1.onmicrosoft.com/FederationMetadata/2007-06/FederationMetadata.xml -用你租户的域值替换"graphDir1.onMicrosoft.com"(租户拥有的任何域都可以)。tenantId是一个guid,它是sts URL的一部分,在第一个xml节点的sts URL(“EntityDescriptor”)中返回:“https://sts.windows.net/”。

参考:

https://azure.microsoft.com/en-us/resources/samples/active-directory-dotnet-graphapi-web/