Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stopping SQL Azure DB when not in use

People also ask

Can I turn off an Azure SQL Database?

In the Azure portal, choose your MySQL server that you want to stop. From the Overview page, click the Stop button in the toolbar. Once the server is stopped, the other management operations are not available for the single server.

Can I pause Azure SQL Database?

Sign in to the Azure portal, and select your dedicated SQL pool. To pause compute, click the Pause button. To remove the dedicated SQL pool so you are not charged for compute or storage, click Delete.


As of 6th November, 2021, The answer is No.

They won't allow it. So the billing will continue for your Azure Database starting the day you create it. There really is no way to pause / stop billing for your Azure SQL Database.

Official Source: feedback.azure.com Please add ability to temporarily turn off/on SQL Azure server to pause billing

Microsoft's official answer appears to be "Yes, you can export your database. Delete the Azure SQL database and that will pause billing. Then when you need it you can create a new database and import your previously expored DB."

I don't believe this is acceptable as an answer for "Allow me to temporarily turn off SQL Server to save on my billing"

enter image description here


This is not an option today - the only choice you have is to reduce the size of the Azure SQL Database which will reduce the cost from the next hour of service. If you really don't want to pay for the DB you could backup the DB to blob storage, delete the database and then restore when required. You could orchestrate this using PowerShell or similar.

Update May 2019: There is a new Azure SQL Database "Serverless" tier coming that might meet some of the requirements around reducing costs by not billing when not in use. Official documentation is available to read.


The databases get backed up automatically just before a drop. so, you can just drop it when you dont need it and restore it when needed. Restores will take some time depending on the database size and how much log you generated, so it wont be fast for large databases.

Also, there is an expiration policy on how long the backups are retained (depends on the service tier) so just watch out for that.

https://msdn.microsoft.com/en-us/library/azure/jj650016.aspx


The Azure SQL Database team is happy to announce that there is now an option that may address your request. We just announced a "serverless" option for Azure SQL DB that will pause your database when it is not in use. You can read more about the feature here: SQL Database Serverless


Agree with @Shiva answer. But if you are simply trying out SQL Server on an Azure VM, you would not want to incur charges by accidentally leaving it running over the weekend or weeks. One solution is to use Automatic Shutdown Feature.

enter image description here


This is now possible and the preview feature is public. Azure SQL Database serverless

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-serverless


Whereas, at this low scale (scale down requirement (pause) rather than scale up), SQL running within a VM might be a better answer for you...