Is it ok to assume that if the server name ends with "database.windows.net" that the database is hosted on azure?
I tried executing this code on my azure db:
SELECT CASE ServerProperty('EngineEdition')
WHEN 1 THEN 'Personal'
WHEN 2 THEN 'Standard'
WHEN 3 THEN 'Enterprise'
WHEN 4 THEN 'Express'
WHEN 5 THEN 'SQL Database'
WHEN 6 THEN 'Azure Synapse Analytics'
WHEN 8 THEN 'Azure SQL Managed Instance'
WHEN 9 THEN 'Azure SQL Edge'
WHEN 11 THEN 'Azure Synapse serverless SQL pool'
ELSE 'Unknown'
END
But it returned "SQL Database"...
How can I reliably discern if a database or sql server is hosted on azure?
I should be writing the code to determine this in c#
right now it might be something like:
if (serverName.Contains("database.windows.net"))
{
//is on azure
}
else
{
//is not hosted on azure
}