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

Aditya Raj 286 Reputation points
2021-08-04T11:26:06.517+00:00

120459-capture.png

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

This is the json.

@markus.bohland@hotmail.de {"{
"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 Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,679 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,196 questions
0 comments No comments
{count} votes

Accepted answer
  1. MartinJaffer-MSFT 26,061 Reputation points
    2021-08-04T19:25:57.813+00:00

    Hello @Aditya Raj 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
    0 comments No comments

0 additional answers

Sort by: Most helpful