Auto pausing Synapse dedicated SQL pool
As of July 2022, unlike Azure SQL Database and Azure Databricks, the ability to automatically pause the database is not available in Synapse dedicated SQL pool databases. It would be useful to detect inactive periods in a Synapse dedicated SQL pool database and automatically pause it. This recipe will showcase a method that detects whether the Synapse dedicated SQL pool database was inactive for 30 minutes and pauses it if so.
Getting ready
Create a Synapse Analytics workspace, as explained in the Provisioning an Azure Synapse Analytics workspace recipe of Chapter 8, Processing Data Using Azure Synapse Analytics.
Create a Synapse SQL dedicated pool database named packtadesqlpool, as described in steps to 3 of the How to do it… section of the Loading data into dedicated SQL pool using PolyBase and T-SQL recipe of Chapter 10, Building the Serving Layer in Azure Synapse SQL Pool.
Create an Azure Automation account named azadeautomation...