Reputation: 6755
I want to start my data factory with parameters. For that I defined a parameter "param" in my factory. The parameter is of type string and contains a json object like this
{
"url": "http://mySpecialFile.csv",
"name": "testing"
"destination: "farAway"
}
Now how can I a access these values in my factory. Is it necessary to define for each attribue a variable? And can I extract for example the value of url? I tried it like this
(@json(@pipeline().parameters.param).url)
But this does not work, it will write this value into the variable? Is there better way to access the incoming json object? Also if I define for each json entry a variable I need to change my factory if the json changes?
Thanks for any advice
Upvotes: 0
Views: 1442
Reputation: 8291
In Azure Data factory pipeline parameter for Json object type
of data there is Data type called Object.
Here I created Pipeline parameter named json with Object data type
and your sample value.
from this parameter to access particular value you can use dynamic parameter like @pipeline().parameters.json['value_which_you_want']
e.g. @pipeline().parameters.json['url']
,@pipeline().parameters.json['name']
,@pipeline().parameters.json['destination']
And it is fetching proper data.
Upvotes: 1