Skip to content

Instantly share code, notes, and snippets.

@DaveRuijter
Created December 24, 2018 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DaveRuijter/10721f8aff40227a5159322fa8649e63 to your computer and use it in GitHub Desktop.
Save DaveRuijter/10721f8aff40227a5159322fa8649e63 to your computer and use it in GitHub Desktop.
Azure Data Factory pipeline definition with a Web Activity to scale an Azure SQL Database. The pipeline is parameterized. The call to Azure SQL is synchronous, hence it waits for the db scale operation to complete.
{
"name": "ADF_Scale_Azure_SQLDB",
"properties": {
"activities": [
{
"name": "ADF_Scale_Azure_SQLDB",
"type": "WebActivity",
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"typeProperties": {
"url": {
"value": "@concat('https://management.azure.com/subscriptions/', pipeline().parameters.SubscriptionID, '/resourceGroups/', pipeline().parameters.ResourceGroupName, '/providers/Microsoft.Sql/servers/',pipeline().parameters.AzureSQLServerName,'/databases/',pipeline().parameters.AzureSQLDatabaseName,'?api-version=2017-10-01-preview')",
"type": "Expression"
},
"method": "PUT",
"headers": {
"Content-Type": "application/json"
},
"body": {
"value": "@json(concat('{\"sku\":{\"name\":\"', pipeline().parameters.ComputeSize, '\",\"tier\":\"', pipeline().parameters.ServiceTier, '\"}, \"location\": \"', pipeline().parameters.AzureRegionName, ' \"}' ) )",
"type": "Expression"
},
"authentication": {
"type": "MSI",
"resource": "https://management.azure.com/"
}
}
}
],
"parameters": {
"ServiceTier": {
"type": "String",
"defaultValue": "Standard"
},
"ComputeSize": {
"type": "String",
"defaultValue": "S0"
},
"AzureSQLServerName": {
"type": "String",
"defaultValue": "<specifyDefaultSQLServer>"
},
"AzureSQLDatabaseName": {
"type": "String",
"defaultValue": "<specifyDefaultSQLDB>"
},
"SubscriptionID": {
"type": "String",
"defaultValue": "<specifyDefaultSubscriptionID>"
},
"ResourceGroupName": {
"type": "String",
"defaultValue": "<specifyDefaultRG>"
},
"AzureRegionName": {
"type": "String",
"defaultValue": "West Europe"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment