What happens when your Azure SQL database becomes full?

Posted: (EET/GMT+2)

 

Sometimes, it is good to prepare for things in advance. Since many of my customers are already using Azure based services, including SQL Server, it is evident that at some point in time, some customers will run out of quota from their SQL Server databases. In other words, their database becomes "full".

If you are using Entity Framework to access Azure SQL databases, this is the exception object that gets raised when you run over quota:

DbUpdateException: An error occurred while updating the entries.
See the inner exception for details. Inner exception #1 of type
UpdateException: An error occurred while updating the entries.
See the inner exception for details. Inner exception #2 of type
SqlException: The database 'myazuresqldatabase_db' has reached
its size quota. Partition or delete data, drop indexes, or consult
the documentation for possible resolutions.

Notice how there are two exception objects linked together as inner exceptions.

In case you see a SqlException with the above message, then you know that the maximum size of the database currently configured has been reached.

To increase the size of an SQL database in Azure, use the ALTER DATABASE command. (I'm not aware of a method to change the database size in the new Azure portal.) For example:

ALTER DATABASE MyAzureSqlDatabase_DB MODIFY
(EDITION='STANDARD', MAXSIZE=10GB)

Once you have executed this command, it will take a minute or two for the database to increase in size.

Hope this helps!