Quickest Way to Import XML and output to Azure Blob in CSV format

Nathaniel B Szypulinski 21 Reputation points

I was wondering what is the quickest way to receive a xml file and be able to convert to csv and put into azure blob.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,470 questions
{count} votes

Accepted answer
  1. shiva patpi 13,146 Reputation points Microsoft Employee

    Hello @Nathaniel B Szypulinski ,
    I was thinking the quick way is to use the PowerShell script.

    $xmlfilePath = "C:\azure\xmlfilename.xml" (if the file is remote then use: (Invoke-webrequest -URI "path").Content > $xmlfilePath )
    $csvfilePath = "C:\azure\filename.csv"
    [xml]$XmlFileContent = Get-Content -Path $xmlfilePath
    $XmlFileContent.catalog.ChildNodes | Export-Csv -Path $csvfilePath -NoTypeInformation -Delimiter:","
    //above code was to convert xml to csv
    //below code is to upload that csv to blob storage account

    $uploadstorage=Get-AzStorageAccount -ResourceGroupName "resourcegroupname" -Name "storageaccountname"
    Set-AzStorageBlobContent -Container "containername" -File $csvfilePath -Context $storcontext

    0 comments No comments

0 additional answers

Sort by: Most helpful