Manage the Synapse pipeline triggers as part of your CICD DevOps process.
Context
I use an Azure Automation account to host my PowerShell script because it provides reusability and management of required modules. Schedules and logging are included but most importantly, it provides a REST API webhook that I can call from pipelines if necessary.
If you rather not use the Automation Account to run PowerShell, then you can still call the Synapse data-plane REST APIs directly as we have several operations for Triggers.
Trigger – REST API (Azure Synapse) | Microsoft Docs
Steps
- Create PowerShell run book in Azure Automation Account (requires modules Az.Accounts and Az.Synapse). Replace Tenant, App ID and Thumbprint values for your RunAs account.
param(
$ws = "wplushiramsynapse", #wplushiramsynapse (dev), hfpocws1 (prod)
$ts = "Daily,Hourly,Last Day of Month", #list of triggers
$status = "Start" #Start, Stop
)
# login
$null = Connect-AzAccount -ServicePrincipal `
-Tenant 'aaaaaa' `
-ApplicationId 'bbbbbb' `
-CertificateThumbprint 'cccccc'
# enable
if ($status -eq "Start"){
$triggers = $ts.split(",");
foreach ($t in $triggers) {
$t
$trigger = Get-AzSynapseTrigger -WorkspaceName $ws -Name $t
$trigger | Start-AzSynapseTrigger
}
}
# disable
if ($status -eq "Stop"){
$triggers = $ts.split(",");
foreach ($t in $triggers) {
$t
$trigger = Get-AzSynapseTrigger -WorkspaceName $ws -Name $t
$trigger | Stop-AzSynapseTrigger
}
}
- Add a Webhook for your runbook using the default parameters and copy the URL. (Save it somewhere so we can use it step 6).
- Grant the RunAs of the Azure Automation Account resource Synapse Admin access to the target workspaces

- Edit the release and Install the Rest Call task. (Org admin will need to approve/add it)

- Refresh the Add tasks after its installed and Add the Rest Call task to your ADO release pipeline. Click Manage to create the WebService endpoint. (may need Org admin to add it)

- Choose Generic service, paste the Webhook URL, auth is not required, provide a name, grant access to all pipelines and Save.

- Return to the Release pipeline Rest Call task and refresh Web Service endpoint drop down. Select the service, choose Post method, you may provide a body for your POST request like in the example in step 5. Save and create a release to test.