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
This answer was provided on Microsoft's website, last updated on 3/21/2018:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal
In short, here are the screenshots from the walkthrough:
Hope this helps.
In PowerShell:
Add-AzureRmAccount #if not already logged in
Get-AzureRmSubscription -SubscriptionName <SubscriptionName> | Select-Object -Property TenantId
Via PowerShell anonymously:
(Invoke-WebRequest https://login.windows.net/YOURDIRECTORYNAME.onmicrosoft.com/.well-known/openid-configuration|ConvertFrom-Json).token_endpoint.Split('/')[3]