locked
How to capture Web Activity Return RRS feed

  • Question

  • Looking at the following documentation:

    https://docs.microsoft.com/en-us/azure/data-factory/control-flow-web-activity

    Is it me or is there no real code on how to capture the Instance name in the example. Example has 

    "returns the name of the instance of SQL server. " 

    There is no real code in the article to capture that in the ADF pipeline. Does anyone have any real examples of capturing return data from the web call or assigning that return value to a pipeline param? Is it saved as a property of the Web Activity? 



    Kyle Clubb

    Wednesday, October 24, 2018 5:54 PM

All replies

  • Hi Kyle,

    Thanks for the find.  Could you create a document feedback item at the bottom of the page you linked?  I know there some old issues down there but we will try to address them all eventually.  

    Wednesday, October 24, 2018 8:49 PM
  • Solution example provided my MS.

     You can use the output from the web activity into another activity.

    Example:

    "activities": [

    {

    "name": "Web1",

    "type": "WebActivity",

    "policy": {

    "timeout": "7.00:00:00",

    "retry": 0,

    "retryIntervalInSeconds": 30,

    "secureOutput": false,

    "secureInput": false

    },

    "typeProperties": {

    "url": "https://www.test.xyz",

    "method": "GET"

    }

    },

    {

    "name": "ForEach1",

    "type": "ForEach",

    "dependsOn": [

    {

    "activity": "Web1",

    "dependencyConditions": [

    "Succeeded"

    ]

    }

    ],

    "typeProperties": {

    "items": {

    "value": "@activity('Web1').output",

    "type": "Expression"

    }

    }

    }

    ]

    Assuming we are getting array from the 'GET' call then we can have our ForEach activity leverage the output as the condition. Parameters can only be defined prior to pipeline run begins and can't be modified. However we have Set Variables / Append Variables activity which allows user to save an output to be used throughout the pipeline run. https://docs.microsoft.com/en-us/azure/data-factory/control-flow-set-variable-activity

    For example:

    "name": "pipeline134",

    "properties": {

    "activities": [

    {

    "name": "Web1",

    "type": "WebActivity",

    "policy": {

    "timeout": "7.00:00:00",

    "retry": 0,

    "retryIntervalInSeconds": 30,

    "secureOutput": false,

    "secureInput": false

    },

    "typeProperties": {

    "url": "https://www.test.xyz",

    "method": "GET"

    }

    },

    {

    "name": "Set Variable1",

    "type": "SetVariable",

    "dependsOn": [

    {

    "activity": "Web1",

    "dependencyConditions": [

    "Succeeded"

    ]

    }

    ]

    },

    {

    "name": "ForEach1",

    "type": "ForEach",

    "dependsOn": [

    {

    "activity": "Set Variable1",

    "dependencyConditions": [

    "Succeeded"

    ]

    }

    ],

    "typeProperties": {

    "items": {

    "value": "@variables('webOutput')",

    "type": "Expression"

    }

    }

    }

    ],

    "variables": {

    "webOutput": {

    "type": "String"

    }

    }

    }


    Kyle Clubb


    • Edited by Kyle Clubb Monday, November 5, 2018 4:48 PM
    • Proposed as answer by Jason_J (Azure) Thursday, November 8, 2018 3:25 AM
    Monday, November 5, 2018 4:48 PM