Be careful when you name or rename an Azure SQL Database.
Why, what’s going on?
The database will disappear from the Azure Portal.
No way! Show me.
Connect to your SQL Server and run:
1 2 3 4 5 |
CREATE DATABASE [Test#Database] ( EDITION = 'basic') ; CREATE DATABASE [Test$Database] ( EDITION = 'basic') ; CREATE DATABASE [Test*Database] ( EDITION = 'basic') ; CREATE DATABASE [Test_Database] ( EDITION = 'basic') ; CREATE DATABASE [Test1Database] ( EDITION = 'basic') ; |
(see that the colour changes in the code above? Keep it in mind for later…)
After only 3 minutes (damn, Azure is slow…) you have 5 databases created:
Then go to check in the Azure Portal, you will see only 4 of them:
The one with the hashtag in the name is missing.
Why?
This is probably due to the fact that the Azure Portal picks up data from the Azure REST API and like in any API call the #
is a fragment identifier.
And is not over…
What’s next?
If you go into the SQL Server the database is there:
But if you click on it, it will redirect you to a 404 page:
Conclusion
Using an hashtag (#
) in the name of an Azure SQL Database will make it disappear from the Azure Portal
But the database is there.
This generates a lot of confusion and if that database is a Premium or Business Critical you will feel the pain at the end of the month.