Kaja
Kaja

Reputation: 3057

Sending parameter from web activity in Data Factory to logic apps

I can successfully trigger Logic App from my Pipeline in ADFv2 via web activity. But now I would like to send also some user-defined parameters to logic app. My question is now:

Upvotes: 1

Views: 3679

Answers (1)

Arun Pant
Arun Pant

Reputation: 146

On the Azure Data Factory-v2 side:

  1. Click on the web activity. Go to the settings tab of the activity.

See this image for how to fill fields in settings tab

  1. You have already figured what goes into URL and Method field in settings tab as you have successfully triggered logic app.

  2. Let's suppose we want to send parameters in JSON (preferred way). Set 'NAME' Headers field to 'Content-Type' and 'VALUE' to 'application/json'.

  3. In the body send you parameters in the form of JSON. Let's send following dummy parameters

{"Location":"northeurope","Model":"dummy_model","Server_name":"dummy_service","Onwer_email":"[email protected]"}

On the Logic App side:

  1. You have already used 'When a HTTP request is received' trigger for logic app.

  2. In the 'Request Body JSON Schema' field, enter the following schema to catch parameters send from ADFv2 web activity:

{
    "properties": {
        "Location": {
            "type": "string"
        },
        "Model": {
            "type": "string"
        },
        "Onwer_email": {
            "type": "string"
        },
        "Server_name": {
            "type": "string"
        }
    },
    "type": "object"
}

See this image for help

  1. You can also use 'Use sample payload to generate schema' instead of doing step 2 above. When using this option simply paste the json that you passed in body of ADFv2 web activity. It will automatically generate JSON schema to catch parameter.

  2. Set the 'Method' field to the same method that you selected in ADFv2 web activity 'Method' field.

  3. In subsequent steps in logic apps (for example initialize variable step) you can now use parameters set above (Location, Model, Onwer_email and Server_name) as Dynamic content using 'Add dynamic content' option. See this image for help.

Upvotes: 2

Related Questions