Press "Enter" to skip to content

Limits of Resource Locks on Azure SQL Databases

Applying a Lock to an Azure SQL Server can protect the databases in that SQL Server because child resources inherit locks from their parent, but this protection only applies in certain circumstances.

As an example, the following Azure SQL Server has a Delete Lock applied to it which protects its databases from deletion via the Azure Portal.

Azure Portal blade showing Azure SQL Server locks

If I attempt to delete the test database in that SQL Server via the Azure Portal, I receive the following error.

Error indicating that deletion of the Azure SQL Database failed due to a lock

However, if I connect to the Azure SQL Server using SQL Server Management Studio, I can successfully delete the database without removing the lock. Refreshing the Databases list in the Object Explorer confirms that the database has been deleted. The deletion of the database is possible whether you use T-SQL or the Object Explorer.

SSMS query showing successful deletion of the Azure SQL Database

Be First to Comment

Leave a Reply

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