P John Raj
P John Raj

Reputation: 537

Save App service log into Azure Blob Storage, using Block blobs

How to save our application logs informarion to Azure Storage blob container as .csv (Block blobs type).

My application developed in Asp.Net core 6.0

Upvotes: 0

Views: 168

Answers (1)

SuryasriKamini-MT
SuryasriKamini-MT

Reputation: 915

Please check by using the BlobStream if it helps to resolve the issue:

 _container.CreateIfNotExist();

  CloudBlob inputBlob = _container.GetBlobReference(outputBlobUri);
  CloudBlob outputBlob = _container.GetBlobReference(inputBlobUri);

  using (BlobStream input = inputBlob.OpenRead())
  using (BlobStream output = outputBlob.OpenWrite())
  {
    ProcessImage(input, output);

 output.Commit();
 outputBlob.Properties.ContentType = "csv";
 outputBlob.SetProperties();

 AppRepository<Post> postRepository = new AppRepository<Post>();
 Post post = postRepository.Find(partitionKey, rowkey);

 post.PostImage = outputBlobUri;
 post.State = true;
 postRepository.Update(post);
 postRepository.SubmitChange();

 _queue.DeleteMessage(message);
}

Upvotes: -1

Related Questions