Hello @Urkmez Hakan (BSH GDS-PSUG) ,
Thank you for reaching out to Microsoft Support.
In order to check the subscription's tenant, you need to have RBAC access to the subscription.
If you have access to the subscription then you can call this REST API and get the subscription's associated tenant ID. https://learn.microsoft.com/en-us/rest/api/resources/subscriptions/get?tabs=HTTP
Alternatively, you can use this PowerShell function to retrieve the tenant ID from a subscription ID:
function get-tenantIdFromSubscriptionID($subId){
$response = try {(Invoke-WebRequest -UseBasicParsing -Uri "https://management.azure.com/subscriptions/$($subId)?api-version=2015-01-01" -ErrorAction Stop).BaseResponse} catch { $_.Exception.Response }
$stringHeader = $response.Headers.ToString()
return($stringHeader.SubString($stringHeader.IndexOf("login.windows.net")+18,36))
}
get-tenantIdFromSubscriptionID("<subscriptionID>")
If you're able to access the Azure Portal, you can follow these steps to find the subscription ID:
- Sign in to the Azure portal.
- Under the Azure services heading, select Subscriptions. If you don't see Subscriptions here, use the search box to find it.
- Find the subscription in the list, and note the Subscription ID shown in the second column. If no subscriptions appear, or you don't see the right one, you may need to switch directories to show the subscriptions from a different Microsoft Entra tenant.
Reference : Get subscription and tenant IDs in the Azure portal - Azure portal | Microsoft Learn
If you do not have access to the subscription and unsure under which tenant the subscription is residing, then I would suggest to open a Support ticket with Azure Subscription Management Team:
Also, raising a support ticket to Azure Billing and Subscription management team is free of cost.
I hope this information is helpful. Please feel free to reach out if you have any further questions. If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Thanks,
Chaithra.