Get Specific column via REST API output in Web Activity

Priya Jha 866 Reputation points
2023-04-19T06:50:45.0166667+00:00

Hi All, I am leveraging Web activity to trigger REST API and get its details : https://learn.microsoft.com/en-us/rest/api/storageservices/get-blob-properties?tabs=azure-ad Now this is expected response for web activity output : User's image

I want the web activity output to have only specific values rather than entire output like I need only highlighted columns to be returned User's image

so how to provide specific list

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,472 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,751 questions
{count} votes

Accepted answer
  1. Nandan Hegde 29,906 Reputation points MVP
    2023-04-20T08:23:40.61+00:00

    Hey Priya, Good day! Agree with @KranthiPakala-MSFT ,Those are the standard response headers and you cannot restrict them, You can enable secure output thereby restricting access to other data in output and then pull in the required outputs based on dynamic expressions User's image

    User's image

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,427 Reputation points Microsoft Employee
    2023-04-20T06:07:55.9733333+00:00

    @Priya Jha Thanks for using Microsoft Q&A forum and posting your query.

    Those are the standard response headers and you cannot restrict them, but you can access only the specific response headers using dynamic expression as shown below. Please note below is an example but you can leverage similar implementations as per your need.

    Dynamic expressions to access those specific headers:

    @activity('Web1').output.ADFWebActivityResponseHeaders['x-ms-lease-status'] @activity('Web1').output.ADFWebActivityResponseHeaders['x-ms-lease-state'] @activity('Web1').output.ADFWebActivityResponseHeaders['x-ms-blob-type'] @activity('Web1').output.ADFWebActivityResponseHeaders['Date']
    @activity('Web1').output.ADFWebActivityResponseHeaders['Content-Type']
    
    {
        "name": "pipeline13",
        "properties": {
            "activities": [
                {
                    "name": "Web1",
                    "type": "WebActivity",
                    "dependsOn": [],
                    "policy": {
                        "timeout": "0.12:00:00",
                        "retry": 0,
                        "retryIntervalInSeconds": 30,
                        "secureOutput": false,
                        "secureInput": false
                    },
                    "userProperties": [],
                    "typeProperties": {
                        "url": "https://sharedblob.blob.core.windows.net/test/A.csv",
                        "method": "GET",
                        "headers": {
                            "Authorization": "Bearer eyJ0eXcxxxxxxxxxxxxxxxxxxxxxxxxxx",
                            "x-ms-version": "2022-11-02"
                            "additionalHeaders": "x-ms-blob-type,x-ms-lease-status,x-ms-lease-state,Content-Type,Date"
                        }
                    }
                },
                {
                    "name": "Set variable1",
                    "type": "SetVariable",
                    "dependsOn": [
                        {
                            "activity": "Web1",
                            "dependencyConditions": [
                                "Succeeded"
                            ]
                        }
                    ],
                    "userProperties": [],
                    "typeProperties": {
                        "variableName": "var_ResponseHeaders",
                        "value": {
                            "value": "@concat(activity('Web1').output.ADFWebActivityResponseHeaders['x-ms-lease-status'], ' + ' ,activity('Web1').output.ADFWebActivityResponseHeaders['x-ms-lease-state'], ' + ' ,activity('Web1').output.ADFWebActivityResponseHeaders['x-ms-blob-type'], ' + ' ,activity('Web1').output.ADFWebActivityResponseHeaders['Date'], ' + ' ,activity('Web1').output.ADFWebActivityResponseHeaders['Content-Type'])",
                            "type": "Expression"
                        }
                    }
                }
            ],
            "variables": {
                "var_ResponseHeaders": {
                    "type": "String"
                }
            },
            "annotations": []
        }
    }
    

    Hope this info helps.


    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.