Convert CSV to XML with Logic App

Marc Towler 21 Reputation points
2022-09-27T16:47:17.35+00:00

I am in a position where I am required to convert CSV files following the same template into XML files. I have a restriction that I only have Data Factory or Logic App as the available routes to achieve this.
After doing some research, it seems that Data Factory still does not support XML Sinks so it seems I am left with Logic App as my only course of action. I was looking at this post for a way to do it but it seems a bit dated and uses BizTalk which I do not have available. I have gotten the premise that I basically need two XSD's, one for the CSV and one for the XML, plus a map. At this point I have hit a roadblock. Below is what I have so far:

CSV Example
245088-csv-example.png

The XSD for the XML Output (note, a lot of the references do not need to be filled in by the CSV)

Any help on this would be massively appreciated, especially on how to create the schema for the CSV file and the Map, those are what I believe to be the biggest blockers so far.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,878 questions
0 comments No comments
{count} votes

Accepted answer
  1. Mike Urnun 9,761 Reputation points Microsoft Employee
    2022-09-29T07:28:25.56+00:00

    Hello @Marc Towler - Welcome to MS Q&A, and thanks for posting here!

    For CSV to XML conversion, I’ve come across the following blog post which shows each required steps: http://blogs.recneps.net/post/Processing-a-flat-file-with-Azure-Logic-Apps

    As you’ll find in the post, you’ll need Azure resources such as Function app, Integration Account, and Logic Apps to accomplish the final solution. If you encounter a problem with any of the steps, let us know here and we’d be happy to help!

    UPDATE:
    Some steps in the blog post referenced above are a bit out of date, and also, @Marc Towler needed the solution to work without additional resources such as Azure Functions and Integration account. As such, the following sample application was created (instruction on the readme file) for demonstration purposes: https://github.com/mike-urnun-msft/csvtoxml

    Screenshot of the workflow:
    255844-image.png


0 additional answers

Sort by: Most helpful