Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increment a parameter in an Azure Data Factory Until Activity?

I am accessing a RESTful API that pages results in groups of 50 using the HTTP connector. The REST connector doesn't seem to support Client Certificates so I can't use the pagination in that.

I have a Pipeline Variable called SkipIndex that defaults to 0. Inside the Until loop I have a Copy Data Activity that works (HTTP source to BLOB sink), then a Set Variable Activity that I am trying to get to increment this Variable.

{
    "name": "Add 50 to SkipIndex",
    "type": "SetVariable",
    "dependsOn": [
        {
            "activity": "Copy next to temp",
            "dependencyConditions": [
                "Succeeded"
            ]
        }
    ],
    "userProperties": [],
    "typeProperties": {
        "variableName": "SkipIndex",
        "value": {
            "value": "50++",
            "type": "Expression"
        }
    }
}

Everything I have tried results in errors such as "The expression contains self referencing variable. A variable cannot reference itself in the expression." and the one above with 50++ causes a sink error during debug.

How can I get the Until loop to increment this variable after it retrieves data?

like image 516
Graham Avatar asked Mar 22 '20 04:03

Graham


People also ask

How do you pass parameters in Azure data Factory?

To add parameters to your data flow, click on the blank portion of the data flow canvas to see the general properties. In the settings pane, you will see a tab called Parameter. Select New to generate a new parameter. For each parameter, you must assign a name, select a type, and optionally set a default value.

What is until activity in Azure data Factory?

The Until activity provides the same functionality that a do-until looping structure provides in programming languages. It executes a set of activities in a loop until the condition associated with the activity evaluates to true. You can specify a timeout value for the until activity.

How do you set a variable in a data/factory pipeline?

Search for Set Variable in the pipeline Activities pane, and drag a Set Variable activity to the pipeline canvas. Select the Set Variable activity on the canvas if it is not already selected, and its Variables tab, to edit its details. Select the variable for the Name property. Enter an expression to set the value.

How do I append variables in Azure data Factory?

To use a Append Variable activity in a pipeline, complete the following steps: Select the background of the pipeline canvas and use the Variables tab to add an array type variable: Search for Append Variable in the pipeline Activities pane, and drag an Append Variable activity to the pipeline canvas.


1 Answers

Agree that REST Connector does supports pagination but does not for Client Certificates Authentication type.

For the idea of your Until activity scenario,i am tripped by the can't self-reference a variable in an expression limitation also. Maybe you could make a little trick on that: Add one more variable to persist the index number.

For example,i got 2 variables: count and indexValue

Until Activity:

enter image description here

Inside Until Activity:

enter image description here

V1:

enter image description here

V2:

enter image description here

BTW, no usage of 50++ in ADF.

like image 80
Jay Gong Avatar answered Sep 29 '22 02:09

Jay Gong