we need to convert XML data into csv/excel/table in Azure cloud.
below is the sample xml code.
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns2:getProjectsResponse
xmlns:ns2="http://www.logic8.com/eq/webservices/generated">
<ns2:Project>
<ns2:fileName>P10001</ns2:fileName>
<ns2:alias>project1</ns2:alias>
</ns2:Project>
<ns2:Project>
<ns2:fileName>P10002</ns2:fileName>
<ns2:alias>project2</ns2:alias>
</ns2:Project>
<ns2:Project>
<ns2:fileName>P10003</ns2:fileName>
<ns2:alias>project3</ns2:alias>
</ns2:Project>
</ns2:getProjectsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Expected output:
Can anyone help me on this.
You could try this way, firstly convert xml to json then use create csv table action to implement it. The below is my test flow.
I use blob to get the xml content. The Compose action input is json(xml(body('Get_blob_content'))), then will get thejson data. Then is the Create CSV table From, ause the from data should be array, so it should be outputs('Compose')['SOAP-ENV:Envelope']['SOAP-ENV:Body']['ns2:getProjectsResponse']['ns2:Project'].
The last thing is customize the header and the value, the ProjectID value should be item()['ns2:fileName'] and the ProjectDescription should be item()['ns2:alias'].
And here is the flow output, suppose this is what you want, hope this could help you.
Do you have any experience with Azure? I ask because from your question it sounds like you’re not sure where to start or which service to use. I’m also curious if you were given a requirement to use Azure or you thought Azure might be the solution yourself. Also where is this XML coming from? It looks like a SOAP request.
If you are a developer I’d consider authoring a Web App in .Net, it can use MVC, Core, Web APIs, and use it to consume this SOAP request and translate it and save the file.
For this I’d consider using an XMLDocument class to load the XML and parse through it.
But if you absolutely need to use Azure, the closest thing that would help automate this is Azure Logic Apps. It offers many “no-code” solutions to plug in connectors that can transform and save data.
https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-enterprise-integration-transform#how-to-use-a-transform
If you elaborate on your situation I’d be happy to offer further solutions
Related
how you doing?
I'm trying to download a excel file from a web site (Specifically DataCamp) in order to use its data into an automatic process, but before to get the file is necessary to sign in on the page. I was thinking that this would be possible with the JSON Query on the HTTP action, but to be honest I don't know where to start (I'm new on Azure).
The process that I need to emulate to get the file extraction would be as follow (I know this could be possible with an API or RPA but I don't have any available for now):
Could you tell me guys some advices (how to get the desired result or at least where to make research)? is this even posibile?
Best regards.
If you don't have other ways, e.g. your source is on an SFTP, etc. than using an HTTP Action should work, pass the BODY to your next action (e.g. you might want to persist that on a BLOB if content is binary).
If your content is "readable", e.g. JSON, CSV and want to load for processing, you need to ensure, for large files, that you read it in Chunks to load it completely before processing.
Detailed explanation at https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-handle-large-messages#download-content-in-chunks
I have a requirement where I need to search a particular term in App insights and then export this 'report' and send it in the email. Consider this as "report a bug" use case.
So if I search key "xxxxxx123", it should retrieve all matching traces/logs and then export it to either excel or CSV.
So my question is, is it possible with the NuGet package or even with REST API?
I tried looking at this, but couldn't find it helpful,
dev.applicationinsights.io/apiexplorer
There is no nuget package. You can do it by using the Get query rest api.
Write any query you need in the Query textbox, then in the right side, you can see the generated request. Then you can use c# or other programming language to query the results, as per this article.(Note: remember use your real Application ID and API Key).
Add a screenshot for your reference:
After fetch the data, you should write your own logic to export it to csv or excel.
I know this is possible with Rest but would like to know if there is any way to upload Documents that are valid JSON only without the need to deserialize them and provide an object?
This is purely a performance optimization. Our SQL query returns the object as JSON and would prefer not to have to deserialize it in .Net consuming resources to be able to upload to Azure Search.
After thinking through using a custom JsonConverter scenario where I store a string and retrieve it, I have dismissed that option as probably not worth while.
No, the SDK does not support this scenario. You'd be better off writing a simple client to send your JSON to the REST API directly.
I need to set up an application in Azure and make communicate 2 functions (one written in C# and one written in JavaScript).
The C# fragment consists in analyzing a XML feed, get the data and save in objects then finally send them to the other JavaScript function by parameter.
I did read that we could establish communication between both functions using HTTP calls but is it possible to do it with parameters ?
If not, would have any suggestions in order to achieve something like this properly? I'm getting started with Azure and i don't have enough visibility to know what is recommened in such a situation
Thank you for your advices
Yes, this is absolutely possible. How you do this is up to you. If you look at the default HTTP trigger templates, you can see that they take parameters (for example, as query string parameters). You can find more examples in the HTTP and webhook recipes documentation.
You can use other trigger types for cross-function communication as well. Take a look at this documentation for related best practices: https://learn.microsoft.com/en-us/azure/azure-functions/functions-best-practices#cross-function-communication
Right now, the only project I can see that does this is
https://github.com/lucamartinetti/flurry-scraper
...but it currently is not logging in properly, I suspect that this is do to the fact that Flurry has made changes to their API which result in the login not working anymore...
I tried messing with it, but am unable to get it to work.
Can anyone help me, or point me in the direction of a project that will do this? I want to scrape all the data possible and download it.
Any help would be appreciated.
Thanks,
-Mark
You don't need to scrape the website if all you want is analytics metrics of your app and you have the API key.
You just need to access this data using Flurry's reporting APIs.
For instance, you can make a REST call to the AppMetrics API and it would give you data about about your apps' users, sessions, pageviews, etc in XML or JSON. A simple AppMetrics call would be of the form:
http://api.flurry.com/appMetrics/METRIC_NAME?apiAccessCode=APIACCESSCODE&apiKey=APIKEY&startDate=STARTDATE&endDate=ENDDATE&country=COUNTRY&versionName=VERSIONNAME&groupBy=GROUPBY