Azure Data Factory: Transforming XML Response to CSV in Blob Storage

Nalini Bhavaraju 110 Reputation points
2025-05-22T19:25:52.03+00:00

Hi Team,

I am attempting to make a REST API call to retrieve data and store the response in Data Lake Storage using Azure Data Factory.

The REST API returns an XML response. Here's what has been done so far:

  1. A Web activity was created to pull data from the REST API.
  2. A Copy activity was set up, where an XML source dataset linked to a Blob storage was created, using a dummy XML data file.
  3. In the sink, a CSV dataset linked to Blob storage was established.

During the process, I tried to import the schemas under mapping. Subsequently, I added a new column in the source under Additional columns with the value as @activity('Webactivityoutput').output.Response. However, when I attempted to import the schema again by passing a dummy value, it failed with the error: "The value of property 'additionalColumns' is in unexpected type 'IList`1'".

Need some assistance to successfully convert the XML response from the REST API into Data Blob Storage (.csv) using an ADF pipeline.

Thanks,

Nalini.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-05-30T06:04:00.5433333+00:00

    Hi @Nalini Bhavaraju, Thank you for your response. I have tried a work around for your question.

    In the Copy Data activity, the supported format for APIs is JSON only. However, if the API returns data in a different format (like XML), you can use a Web activity in combination with Copy Data to handle the response as shown below.

    1: Using Web Activity to Call an XML API

    I used a sample API that responds with data in XML format. This API was called using a Web activity, and the debug output looked like the following:

    The entire XML response is returned as a plain string.

    pcs1

    2: Creating a Dummy Source

    Next, I created a Copy Data activity. As the source, I used a CSV file (the actual content of the file is not important—just ensure it has at least one row, similar to the sample below):

    pcs2

    3: Configuring the Sink

    For the destination (sink), choose the Delimited Text option. Name the file as op.xml.

    Make sure you uncheck the "First row as header" option and set quote character to "No quote character."

    Here is how the sink dataset is configured: pcs3

    4: Mapping Configuration

    In the mapping section, import the schema, and retain only the additional column you added manually for the XML content.

    pcs4

    Final Output

    pcs5

    This configuration generates an output file called op.xml in your destination storage location.

    Post-Processing

    If needed, you can use Data Flow to further transform this file and convert it into your desired format.

    You can refer this QnA for transformation.

    I hope this information helps you. Happy to help you always.

    Kindly consider upvoting the answer if the information provided is helpful. This can assist other community members in resolving similar issues.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.