How to get the azure account tenant Id?

后端 未结 21 1462
故里飘歌
故里飘歌 2020-11-30 17:47

My question is: Is it possible to get the azure active directory tenant id without using powershell command?

I found this two blogs and with this help, I\'m already

21条回答
  •  生来不讨喜
    2020-11-30 18:29

    You can run a simple curl call to get the tenant id of an azure subscription without any authentication.

    make a curl call to :

    https://management.azure.com/subscriptions/{subscription-id}?api-version=2015-01-01

    The request fails but you will be able to get the tenant id from the response header. The tenant id is present in line followed by "WWW-Authenticate: Bearer authorization_uri="https://login.windows.net/"

    you can use curl -v to show the response header.

提交回复
热议问题