Azure sql database - find out which tenant is belongs to

Copper Contributor



I got the ID of an SQL database from one of our customers ( and the login for the database itself.


They have 4 different tenants, but in none of them is an Azure subscriptiuon active.

The customer has no clue in which tenant the database could be hosted then.


Is there a way to find out to which tenant an Azure SQL database belongs?

E.g. from fields inside the database?


Best regards,



2 Replies

@Arjan Anthonisse 



No to search for a database or a server you need to connect to specify a subscription .
If there is no active subscription you cannot search or find anything . Tenant is only for Active directory not for Azure resources . Therefore you cannot host a database in a tenant. 

Also is a server not a database .

If you can reactivate inactive subscriptions or search for an active one  may be you can query  for each Azure resource graph and find  the server and its database  .

From the portal go to :


In the query section enter : 

| where type == "microsoft.sql/servers/databases"
Then check the name property in the results 

Example in screenshots

@ibnmbodji The problem is not that we cannot connect to the database. The problem is that we don't know to which subscription it belongs, so we cannot contact the administrator of the subscription.


So, I would like to know it the subscription id is somewhere in the database. That way, we cna contact Microsoft to ask who pays for the subscription.