I can't use a Dynamic concatenation in Azure Function Name inside Data Factory pipeline - azure-data-factory

I have a concat expression defined in the Function Name setting of an Azure Function in my pipeline, where it concatenates the API Query with the current filename that I want to run on this function. When I debug the pipeline, it fails without giving me any feedback. It just says "AzureFunction failed:"
If I manually insert the string, it works fine.
the concat expression is:
#concat('HttpTrigger?filename=', variables('filename'))
I'm new to Azure, any way I can debug this?

try this way:
#concat(variables('FirstName') ,variables('LastName'))

You could use Set Variable Activity with your Azure Function Activity.
In the Variable Activity, set the value of the variable.
Then refer the variable in the Azure Function Activity:
#concat('HttpTriggerJS1?name=',variables('name'))

Related

How to select object attribute in ADF using variable

I'm trying to parametrize a pipeline in Azure Data Factory in order to enable a certain functionality to mulptiple environments. The idea is that the current environment is always available through a global parameter. I'd like to use this parameter to look up an array of environments to process data to. Example:
targetEnvs = [{ "dev": ["dev"], "test": ["dev", "test"], "acc": [], "prod": ["acc", "prod"] }]
Then one should be able to select the targetEnv array with something like targetEnvs[environment] or targetEnvs.environment. Subsequently a ForEach is used to execute some logic on these target environments.
I tried setting this up with targetEnvs as a pipeline parameter (with default value mapping each env directly to targetEnv, as follows: {"dev": ["dev"], "test": ["test"]}) Then I have a Set variable step to take value from the targetEnvs parameter, as follows:.
I'm now looking for a way to use the current environment (stored in a global parameter) instead of hardcoding "dev" in the Set Variable expression, but I'm not sure how to do this.
.
Using this expression won't even start the pipeline.
.
Question: how do I select this attribute of the object? Any other suggestions on how to do tackle this problem are welcome as well!
(Python analogy would be to have a dictionary target_envs and taking a value from it by using the key "current_env": target_envs[current_env].)
When I tried to access the object same as you, the same error occurred. I have taken the parameter targetEnv (given array) and global parameter environment with value as dev.
You can use the following dynamic content to access the key value.
#pipeline().parameters.targetEnv[0][pipeline().globalParameters.environment]

Azure Data Factory Error 'item' is not a recognized function

I have the following REST configuration in Azure Data Factory
As you can I'm getting the error:
'item' is not a recognized function
The full configuration is
convert?q=USD_#{item().Currency}&compact=ultra&apiKey=xxxxxxxxxxxxxxxxxxx
Do I need to configure #item in Parameters?
The guide suggests I need to following these steps
Based on your code in the dynamic context, you are using this REST resource inside a ForEach as above it has item() function. You can get item().<"Value"> in a ForEach using a lookup.
item() is a ForEach function and can be used inside a ForEach which is used inside a ADF pipeline. You are using the ForEach function inside Dataset which is not known for the dataset. That's why it is giving a warning. When you use that dataset only for that pipeline it will give you the result without any error. But for any other pipeline It will give you the warning as error.
To use a pipeline function in the Dataset, the best practice is to create a Dataset parameter and give the value for this in the pipeline like below.
Create a Dataset Parameter with string type and a Default value:
Give this parameter in the Dataset dynamic context:
Now you can give pipeline function values for this Parameter inside ForEach or inside Pipeline:
Here I have used Copy activity for sample and given the value as per my URL. You can give your Relative URL with item() function in dynamic context.
Based on the item().Currency values it will give the REST page URL in each iteration.

How to set expression for Until activity in Azure Data Factory? - String does not match

I'm trying to execute Azure Durable Function in ADF.
I have "Get Current Function Status" Activity inside Until activity.
Possible value are pending, completed, running and exception.
I wish to execute Until runtimeStatus Completed or Exception is reached.
It this possible to do following way or should I create flag variable?
I try to set expression, but getting warning "String does not match" :
or(equals(activity('Get Current Function Status').output.runtimeStatus,'Pending'),
equals(activity('Get Current Function Status').output.runtimeStatus,'Running'))
Can you try the below expression, there are few tweaks.
#or(equals(activity('Azure Function').output.runtimeStatus,'Pending'),equals(activity('Azure Function').output.runtimeStatus,'Running'))

how to add dynamic content for ADF datafactory

I want to add dynamic parameter for my ADF pipeline. I have 2 parameter and i want to concat with '/'.
1. My source folder-> pipeline().parameters.sourcefolder
2. My source file-> pipeline().parameters.sourcefile
I have tried this dynamic parameter. but i am getting error.
#concat{(pipeline().parameters.sourcefolder,'/',(pipeline().parameters.sourcefile)}
but is giving me error. Can you please help me.
Since you already have the two parameter , I suggest you define the variable and use the "Set variable" activity and concatenate the parameters there .I have the Fname & Lname as the defined parameter and the below expression should work fine .
#concat(pipeline().parameters.Fname,'/',pipeline().parameters.Lname)

Azure Data factory: How to update the pipeline parameter (flag) inside the pipeline

I have initialized a pipeline parameter, lets say a flag, with a value ('true'). Now inside the pipeline I want to update the flag value based on some condition.
So lets say I have a web activity inside the pipeline, I want to update the value of that flag to 'false' if i dont get the response from the web activity.
Any idea how to do that?
You could try #empty(body('web1'))
So if I understand correctly you want to call a Web activity from your pipeline and if there is no response then set a variable?
In this case, could you not just set a low timeout and use a "Set Variable" activity on the Fail condition? So if there was no response it would fail and set the variable