|
2 | 2 | "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
3 | 3 | "contentVersion": "1.0.0.0", |
4 | 4 | "parameters": { |
5 | | - "workspaceName": { |
| 5 | + "factoryName": { |
6 | 6 | "type": "string", |
7 | | - "metadata": "Workspace name", |
8 | | - "defaultValue": "zzysynapsecanary" |
| 7 | + "metadata": "Data Factory name" |
9 | 8 | }, |
10 | | - "zhuzhangen2LS": { |
| 9 | + "DataSource_LinkService": { |
11 | 10 | "type": "string" |
12 | 11 | }, |
13 | | - "SapOdp1": { |
| 12 | + "SapOdp3": { |
14 | 13 | "type": "string" |
15 | 14 | } |
16 | 15 | }, |
17 | 16 | "variables": { |
18 | | - "workspaceId": "[concat('Microsoft.Synapse/workspaces/', parameters('workspaceName'))]" |
| 17 | + "factoryId": "[concat('Microsoft.DataFactory/factories/', parameters('factoryName'))]" |
19 | 18 | }, |
20 | 19 | "resources": [ |
21 | 20 | { |
22 | | - "name": "[concat(parameters('workspaceName'), '/SAP ODP to ADLS Gen2 in Parquet format')]", |
23 | | - "type": "Microsoft.Synapse/workspaces/pipelines", |
24 | | - "apiVersion": "2019-06-01-preview", |
| 21 | + "name": "[concat(parameters('factoryName'), '/Always Insert SAP ODP data to sink')]", |
| 22 | + "type": "Microsoft.DataFactory/factories/pipelines", |
| 23 | + "apiVersion": "2018-06-01", |
25 | 24 | "properties": { |
26 | | - "description": "Use this template to replicate multiple tables from SAP to Azure Data Lake Gen2 in Parquet format with additional operation type column, e.g., Upsert, Delete.", |
| 25 | + "description": "Insert each row of sap odp data to sink, no update, delete operation.", |
27 | 26 | "activities": [ |
28 | 27 | { |
29 | 28 | "name": "SAP2ParquetLookup", |
|
130 | 129 | }, |
131 | 130 | "staging": { |
132 | 131 | "linkedService": { |
133 | | - "referenceName": "[parameters('zhuzhangen2LS')]", |
| 132 | + "referenceName": "[parameters('DataSource_LinkService')]", |
134 | 133 | "type": "LinkedServiceReference" |
135 | 134 | }, |
136 | 135 | "folderPath": { |
|
160 | 159 | "cancelAfter": {} |
161 | 160 | }, |
162 | 161 | "annotations": [], |
163 | | - "lastPublishTime": "2023-05-19T02:37:53Z" |
| 162 | + "lastPublishTime": "2023-05-22T07:57:59Z" |
164 | 163 | }, |
165 | 164 | "dependsOn": [ |
166 | | - "[concat(variables('workspaceId'), '/datasets/SapToParquetLookupJson')]", |
167 | | - "[concat(variables('workspaceId'), '/dataflows/SAP2ParquetTemplateDataflow')]" |
| 165 | + "[concat(variables('factoryId'), '/datasets/SapToParquetLookupJson')]", |
| 166 | + "[concat(variables('factoryId'), '/dataflows/SAP2ParquetTemplateDataflow')]" |
168 | 167 | ] |
169 | 168 | }, |
170 | 169 | { |
171 | | - "name": "[concat(parameters('workspaceName'), '/SapToParquetLookupJson')]", |
172 | | - "type": "Microsoft.Synapse/workspaces/datasets", |
173 | | - "apiVersion": "2019-06-01-preview", |
| 170 | + "name": "[concat(parameters('factoryName'), '/SapToParquetLookupJson')]", |
| 171 | + "type": "Microsoft.DataFactory/factories/datasets", |
| 172 | + "apiVersion": "2018-06-01", |
174 | 173 | "properties": { |
175 | 174 | "linkedServiceName": { |
176 | | - "referenceName": "[parameters('zhuzhangen2LS')]", |
| 175 | + "referenceName": "[parameters('DataSource_LinkService')]", |
177 | 176 | "type": "LinkedServiceReference" |
178 | 177 | }, |
179 | 178 | "annotations": [], |
|
253 | 252 | "dependsOn": [] |
254 | 253 | }, |
255 | 254 | { |
256 | | - "name": "[concat(parameters('workspaceName'), '/SAP2ParquetTemplateDataflow')]", |
257 | | - "type": "Microsoft.Synapse/workspaces/dataflows", |
258 | | - "apiVersion": "2019-06-01-preview", |
| 255 | + "name": "[concat(parameters('factoryName'), '/SAP2ParquetTemplateDataflow')]", |
| 256 | + "type": "Microsoft.DataFactory/factories/dataflows", |
| 257 | + "apiVersion": "2018-06-01", |
259 | 258 | "properties": { |
260 | 259 | "type": "MappingDataFlow", |
261 | 260 | "typeProperties": { |
262 | 261 | "sources": [ |
263 | 262 | { |
264 | 263 | "linkedService": { |
265 | | - "referenceName": "[parameters('SapOdp1')]", |
| 264 | + "referenceName": "[parameters('SapOdp3')]", |
266 | 265 | "type": "LinkedServiceReference" |
267 | 266 | }, |
268 | 267 | "name": "SAPSource" |
|
271 | 270 | "sinks": [ |
272 | 271 | { |
273 | 272 | "linkedService": { |
274 | | - "referenceName": "[parameters('zhuzhangen2LS')]", |
| 273 | + "referenceName": "[parameters('DataSource_LinkService')]", |
275 | 274 | "type": "LinkedServiceReference" |
276 | 275 | }, |
277 | 276 | "name": "ParquetSink" |
278 | 277 | } |
279 | 278 | ], |
280 | 279 | "transformations": [ |
281 | 280 | { |
282 | | - "name": "AddOperationTypeColumn" |
| 281 | + "name": "InsertEachRow", |
| 282 | + "description": "Update each row to insert, no mater update, delete or insert." |
283 | 283 | } |
284 | 284 | ], |
285 | 285 | "scriptLines": [ |
|
303 | 303 | " keys: ($sapKeyColumns),", |
304 | 304 | " partitionPredicates: ($sapPartitions),", |
305 | 305 | " partitionBy('external', 1)) ~> SAPSource", |
306 | | - "SAPSource derive(OperationType = case(isUpsert(),'Upsert', isDelete(), 'Delete', isUpdate(), 'Update', isInsert(), 'Insert')) ~> AddOperationTypeColumn", |
307 | | - "AddOperationTypeColumn sink(allowSchemaDrift: true,", |
| 306 | + "SAPSource alterRow(insertIf(true())) ~> InsertEachRow", |
| 307 | + "InsertEachRow sink(allowSchemaDrift: true,", |
308 | 308 | " validateSchema: false,", |
309 | 309 | " format: 'parquet',", |
310 | 310 | " fileSystem: ($parquetContainer),", |
|
0 commit comments