How i can fetch xml file from azure blob and do conversion to json and then upload back to blob container using c#? Anyone please help me


#1

How i can fetch xml file from azure blob and do conversion to json and then upload back to blob container using c#? Anyone please help me

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using System.Xml;
using System.Xml.Linq;
using System.Reflection;
using System.IO;
using System.Configuration;
using Microsoft.Azure;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.Azure;

namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
string connString = ConfigurationManager.ConnectionStrings[“AzureStorageAccount”].ConnectionString;
string source = ConfigurationManager.AppSettings[“example”];

//get reference to storage account
Console.WriteLine(@“Connecting to storage account”);
CloudStorageAccount sa = CloudStorageAccount.Parse(connString);
CloudBlobClient bc = sa.CreateCloudBlobClient();

//get reference to container
Console.WriteLine(@“Getting reference to container”);
CloudBlobContainer container = bc.GetContainerReference(source);

//create this container if it doesn’t exist
container.CreateIfNotExists();