I am trying to execute a stored procedure in an Azure SQL database from an Azure DataFactory V2. The procedure will do some upsert into different tables with data from a flat table. According to MS specifications you need to have a table valued parameter to make such thing, but that couples the pipeline activity to the procedure and to all the models. Is there any way to define the dataset and copy activity so it just executes the stored procedure?
The jsons below are from the arm template:
DataSet:
{"type": "datasets",
"name": "AzureSQLProcedureDS",
"dependsOn": [
"[parameters('dataFactoryName')]",
"[parameters('destinationLinkedServiceName')]"
],
"apiVersion": "[variables('apiVersion')]",
"properties": {
"type": "AzureSqlTable",
"linkedServiceName": {
"referenceName": "[parameters('destinationLinkedServiceName')]",
"type": "LinkedServiceReference"
},
"typeProperties": {
"tableName": "storedProcedureExecutions"
}
}}
Activity:
{"name": "ExecuteHarmonizationProcedure",
"description": "Executes the procedure that Harmonizes the Data",
"type": "Copy",
"inputs": [
{
"referenceName": "[parameters('destinationDataSetName')]",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "AzureSQLProcedureDS",
"type": "DatasetReference"
}
],
"typeProperties": {
"source": {
"type": "SqlSink"
},
"sink": {
"type": "SqlSink",
//"SqlWriterTableType": "storedProcedureExecutionsType",
"SqlWriterStoredProcedureName": "@Pipeline().parameters.procedureName",
"storedProcedureParameters": {
"param1": {
"value": "call from adf"
}
}
}
}
}
Any help would be appreciated considering that MS doesn't provide so much help for this subject.