question

AdityaRaj-8613 avatar image
0 Votes"
AdityaRaj-8613 asked MartinJaffer-MSFT answered

Not able to pass parameter in azure function activity body inside adf

120459-capture.png





I am trying to pass parameter to azure function activity and I am getting error.



This is the json.



@concat{"{
"job_name": "job1",
"source_table":"xyz",
"target_table": "abc",
"start_time": "2009-01-01 00:00:00.000",
"end_time": "2009-01-01 00:00:00.000",
"count": "activity('Data flow1').output.runStatus.metrics.sink1.rowsWritten",
"layer": "export",
"load_type":"full load",
"load_pattern":"insert",
"extract_query":"variables('Extract Query')",
"load_query":"select * from abc",
"default_engine":"adf",
"status":"success"}"}


This is body of azure function


Can somebody correct me what I am doing wrong?

azure-data-factoryazure-functions
capture.png (26.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MartinJaffer-MSFT avatar image
0 Votes"
MartinJaffer-MSFT answered AdityaRaj-8613 commented

Hello @AdityaRaj-8613 and welcome to Microsoft Q&A.

It looks like the syntax got tangled up. I have cleaned it up below:

 @concat('{
 "job_name": "job1",
 "source_table":"xyz",
 "target_table": "abc",
 "start_time": "2009-01-01 00:00:00.000",
 "end_time": "2009-01-01 00:00:00.000",
 "count": "'
 ,activity('Data flow1').output.runStatus.metrics.sink1.rowsWritten
 ,'",
 "layer": "export",
 "load_type":"full load",
 "load_pattern":"insert",
 "extract_query":"',
 variables('Extract Query'),
 '",
 "load_query":"select * from abc",
 "default_engine":"adf",
 "status":"success"}')

The changes I made were:

  • concat is a function, so the outermost { } -> ( )

  • separated the interior into string literals and expressions, so outermost " " -> ' '

  • By bringing the expressions out of the literal, added the '", sections


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.