Do you forget to pause Azure resources? If you answered yes, you’re not alone. Implementing the process below will save time and money. A Microsoft article on the same subject inspired me to write this.
I would highly recommend reviewing the original. What follows is an attempt to simplify the process and focus only on pausing the dedicated SQL pool.
Step 1: Create a New Pipeline in Synapse Studio
- First, navigate to your workspace and open Synapse Studio.
- Click the Integrate icon, then select the + sign to create a new pipeline.
- Name your pipeline PausePool.
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step1-1.png?resize=600%2C527&ssl=1)
Step 2: Create Pipeline Parameters
- Select the Parameters tab near the bottom of the pipeline screen.
- After that, select +New to create each of the following parameters:
Name | Type | Default Values |
---|---|---|
ResourceGroup | string | Name of your resource group |
SubscriptionID | string | Subscription Id of your resource group |
WorkspaceName | string | Name of your workspace |
SQLPoolName | string | Name of your dedicated SQL pool |
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step2-1.png?resize=753%2C301&ssl=1)
Step 3: Check the Dedicated SQL Pool State
- Under Activities > General drag a Web activity to the pipeline canvas as the first stage of your pipeline.
- In the General tab, name this stage Check State.
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step3-1-1.png?resize=860%2C702&ssl=1)
- Select the Settings tab then click in the URL entry space, then select Add dynamic content.
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step3-2.png?resize=616%2C387&ssl=1)
- Copy and paste the GET request that has been parameterized using the @concat string function below into the dynamic content box. Select Finish. The following code is a simple GET request:
@concat('https://management.azure.com/subscriptions/',pipeline().parameters.SubscriptionID,'/resourceGroups/',pipeline().parameters.ResourceGroup,'/providers/Microsoft.Synapse/workspaces/',pipeline().parameters.WorkspaceName,'/sqlPools/',pipeline().parameters.SQLPoolName,'?api-version=2021-03-01')
- Select the drop-down for Method and select GET.
- Select Advanced to expand the content. Select Managed Identity as the Authentication type. For Resource enter
https://management.azure.com/
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step3-4.png?resize=663%2C410&ssl=1)
Step 4: Add an If Condition to Pause the SQL Pool
- Continuing, under Activities > Iteration & conditionals drag an If condition activity to the pipeline canvas as the second stage of your pipeline.
- In the General tab, name this stage Pause If Online.
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step4-1.png?resize=1024%2C646&ssl=1)
- Select the Activates tab then click in the Expression entry space, then select Add dynamic content.
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step4-2.png?resize=521%2C276&ssl=1)
- Copy and paste the expression below into the dynamic content box. Select Finish. The following code is an expression which returns True if the status is Online:
@equals(activity('Check State').output.properties.status,'Online')
- On the Activities tab, select the edit icon for the True case.
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step4-3-2.png?resize=570%2C232&ssl=1)
- Under Activities > General drag a Web activity to the True activities canvas.
- In the General tab, name this stage Pause
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step4-4.png?resize=788%2C695&ssl=1)
- Copy and paste the POST request that has been parameterized using the @concat string function below into the dynamic content box. Select Finish. The following code is a simple Get request:
@concat('https://management.azure.com/subscriptions/',pipeline().parameters.SubscriptionID,'/resourceGroups/',pipeline().parameters.ResourceGroup,'/providers/Microsoft.Synapse/workspaces/',pipeline().parameters.WorkspaceName,'/sqlPools/',pipeline().parameters.SQLPoolName,'/pause?api-version=2021-03-01')
- Select the drop-down for Method and select POST.
- In the Body section type Pause.
- Select Advanced to expand the content. Select Managed Identity as the Authentication type. For Resource enter
https://management.azure.com/
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step4-5.png?resize=750%2C510&ssl=1)
- Finally, You can run your pipeline by selecting Debug mode. After your debug is successful, you can add a trigger to schedule the pipeline execution.
![](https://i0.wp.com/sqlsavior.com/wp-content/uploads/2021/09/Step4-6.png?resize=755%2C310&ssl=1)
Closing
Above all, I hope you found this article helpful. Would you mind letting me know of any comments or questions you have below?
If you run into issues or need help, please let me know.