1

I need a way to update/edit data from azure blob which is stored in JSON file without downloading the file as the file is huge.

I am looking for a way to Edit/Update JSON data file which is present in Azure blob container from C# code

Tried the below Append Block but this only helps to add new data. What if I want to update a particular data.

  • 1
    What "below Append Block"? There isn't any code in this question – Avery Apr 10 '19 at 09:58
  • Welcome to Stackoverflow. Please edit your question to include your code. We need to know what you have tried. For guidance please read [how to ask questions](https://stackoverflow.com/help/how-to-ask) and [how to create a minimal example](https://stackoverflow.com/help/mcve) – 5th Apr 10 '19 at 10:11
  • 1
    JSON is not a database. It sounds like you need a database. – Brian Rogers Apr 11 '19 at 03:54
  • @5th This question also does not include code: https://stackoverflow.com/questions/130794/what-is-dependency-injection?page=2&tab=Votes – lolelo Jul 19 '21 at 10:23
  • .. similar question: https://stackoverflow.com/questions/41783903/append-data-to-an-s3-object does also not include code – lolelo Jul 19 '21 at 10:30

1 Answers1

0

Assuming you know the structure of the file, you might be able to update just part of the Blob by using Blocks.

You can modify an existing block blob by inserting, replacing, or deleting existing blocks. After uploading the block or blocks that have changed, you can commit a new version of the blob by committing the new blocks with the existing blocks you want to keep using a single commit operation.

More information: Understanding Block Blobs, Append Blobs, and Page Blobs - About Block Blobs

Partially off-topic:
Looking at your scenario and the requirements, it feels like you might have picked the wrong storage type since the current one doesn't support what you're trying to do.
Also, you might want to split the 'huge' file into separate ones.

rickvdbosch
  • 14,105
  • 2
  • 40
  • 53