/logicapp-synapse-sqlpool

Azure Logic App to Pause, Resume, Dial-Up and Dial-Down a Azure Synapse Dedicated SQL Pool

Primary LanguagePowerShellGNU General Public License v3.0GPL-3.0

logicapp-synapse-sqlpool

Logic App to Pause, Resume, Dial-Up and Dial-Down Synapse Dedicated SQL Pool

Pre-Requisites

  • Grant the Managed Identity of this Logic App the Contibutor role to the Synapse Dedicated SQL Pool that you want to manage
  • Grant the Managed Identity of this Logic App the db_owner role to the Synapse Dedicated SQL Pool that you want to manage
CREATE USER [logic-app-name] FROM EXTERNAL PROVIDER
GO

EXEC sp_addrolemember 'db_owner', [logic-app-name]
GO

Deploy project to Azure using Powershell Az module

From PowerShell console execute the following commands

cd 'bin folder'
Connect-AzAccount -Tenant XX-YY-ZZ -Subscription XX-YY-ZZ
.\Deploy-AzureResourceGroup.ps1 -ArtifactStagingDirectory . -TemplateFile LogicApp.json -TemplateParametersFile LogicApp.parameters.json

HTTP Trigger POST Payload Schema

{
  "type": "object",
  "properties": {
    "action": {
      "type": "string"
    },
    "sku": {
      "type": "string"
    },
    "subscriptionId": {
      "type": "string"
    },
    "resourceGroupName": {
      "type": "string"
    },
    "workspaceName": {
      "type": "string"
    },
    "sqlPoolName": {
      "type": "string"
    },
    "apiVersion": {
      "type": "string"
    }
  }
}

For example the body payload will look like this:

{
    "action": "pause", #valid values - pause, resume, scale
    "sku": "DW100c",
    "subscriptionId": "XXX-YYY-ZZZ",
    "resourceGroupName": "rg-dataplatform",
    "workspaceName": "ba-synapseanalytics01",
    "sqlPoolName": "dw01",
    "apiVersion": "2021-03-01"
 }

Synapse Pipeline

Azure Data Factory/Synapse Pipeline to call this logic app is found in this repo. Look for SQLPool-Pause-Resume-Scale pipeline in Manage-SQLPool/Manage-All-SQLPools