Hi @WZIAFP ,
Thankyou for using Microsoft Q&A platform.
In order to automate pausing and resuming of dedicated SQL pool , these are the steps you need to follow:
- Azure Synapse managed Identity (same name as Synapse workspace name) needs to have Contributor access in Azure Synapse Analytics.
- Use Web Activity to get the list of ded sql pool present in your resource group using this GET API URL : https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Synapse/workspaces/{workspace-name}/sqlPools?api-version=2019-06-01-preview
- Use ForEach activity to iterate for each ded sql pool and run Pause or resume command
- Use Web activity inside Foreach to send POST API URL for pausing or resuming ded sql pool : https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Synapse/workspaces/{workspace-name}/sqlPools/{database-name}/resume?api-version=2019-06-01-preview
Note: In Case of pause same URL can be used , just replace 'resume' with 'pause'
In order to make it dynamic for both the commands, i.e. Pause and Resume all SQLpools , you can create parameter to send the command during runtime: https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Synapse/workspaces/{workspace-name}/sqlPools/@{item().name}/@{pipeline().parameters.Command}?api-version=2019-06-01-preview
If you only have one ded sql pool in your Synapse workspace, you can skip bullet points 2 and 3 and directly use a Web activity to send the POST command.
Please refer to the below provided document and video link in order to understand better:
Pause and resume dedicated SQL pools with Synapse Pipelines
https://www.youtube.com/watch?v=4Hoye3kPYlU&t=827s
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on or upvote button whenever the information provided helps you.
Original posters help the community find answers faster by identifying the correct answer. Here is how - Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators