Azure sql database - find out which tenant is belongs to

%3CLINGO-SUB%20id%3D%22lingo-sub-2462767%22%20slang%3D%22en-US%22%3EAzure%20sql%20database%20-%20find%20out%20which%20tenant%20is%20belongs%20to%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2462767%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20got%20the%20ID%20of%20an%20SQL%20database%20from%20one%20of%20our%20customers%20(%3CSPAN%3Exyzsql.database.windows.net)%20and%20the%20login%20for%20the%20database%20itself.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThey%20have%204%20different%20tenants%2C%20but%20in%20none%20of%20them%20is%20an%20Azure%20subscriptiuon%20active.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20customer%20has%20no%20clue%20in%20which%20tenant%20the%20database%20could%20be%20hosted%20then.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20find%20out%20to%20which%20tenant%20an%20Azure%20SQL%20database%20belongs%3F%3C%2FP%3E%3CP%3EE.g.%20from%20fields%20inside%20the%20database%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3EArjan%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2465437%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20sql%20database%20-%20find%20out%20which%20tenant%20is%20belongs%20to%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2465437%22%20slang%3D%22en-US%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F189476%22%20target%3D%22_blank%22%3E%40Arjan%20Anthonisse%3C%2FA%3E%20%2C%3CBR%20%2F%3E%3CBR%20%2F%3Edoes%20this%20documentation%20help%20you%3F%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20regards%2C%3CBR%20%2F%3ESchnittlauch%3CBR%20%2F%3E%3CBR%20%2F%3E%22First%2C%20No%20system%20is%20safe.%20Second%2C%20Aim%20for%20the%20impossible.%20Third%2C%20no%20Backup%2C%20no%20Mercy%22%20-%20Schnittlauch%3CBR%20%2F%3E%3CBR%20%2F%3EMy%20answer%20helped%20you%3F%20Don't%20forget%20to%20leave%20a%20like.%20Also%20mark%20the%20answer%20as%20solved%20when%20your%20problem%20is%20solved.%20%3A)%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2480087%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20sql%20database%20-%20find%20out%20which%20tenant%20is%20belongs%20to%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2480087%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F540591%22%20target%3D%22_blank%22%3E%40ibrahimambodji%3C%2FA%3E%26nbsp%3BThe%20problem%20is%20not%20that%20we%20cannot%20connect%20to%20the%20database.%20The%20problem%20is%20that%20we%20don't%20know%20to%20which%20subscription%20it%20belongs%2C%20so%20we%20cannot%20contact%20the%20administrator%20of%20the%20subscription.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20I%20would%20like%20to%20know%20it%20the%20subscription%20id%20is%20somewhere%20in%20the%20database.%20That%20way%2C%20we%20cna%20contact%20Microsoft%20to%20ask%20who%20pays%20for%20the%20subscription.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

 

I got the ID of an SQL database from one of our customers (xyzsql.database.windows.net) 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,

Arjan

 

2 Replies

@Arjan Anthonisse 

 

Hi 

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 xyzsql.database.windows.net 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 : 

https://portal.azure.com/#blade/HubsExtension/ArgQueryBlade

 

In the query section enter : 

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

Example in screenshots

@ibrahimambodji 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.