Never use an hashtag (#) in the Azure SQL Database name

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:

(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:

Azure SQL Database hashtag in name 3

Then go to check in the Azure Portal, you will see only 4 of them:

Azure SQL Database hashtag in name 5

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:

Azure SQL Database hashtag in name 6

But if you click on it, it will redirect you to a 404 page:

Azure SQL Database hashtag in name 8

 

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.

Related

Leave a Reply

Your email address will not be published. Required fields are marked *