Hello @Ashutosh Saini ,
Thanks for reaching out to Microsoft Q&A platform.
You can't append to Block Blob but I just tried for Append Blob using C#.net , below is the piece of tested code and it works by appending to the existing file. I am sure similar functions will work for Java SDK too, modify the code accordingly to get your stream. Please try out.
public static void AppendToBlobStorage()
{
string connection = "DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=accountkey;EndpointSuffix=core.windows.net";
string filename = "appendblob.txt";
string container= "test";
CloudStorageAccount storage = CloudStorageAccount.Parse(connection);
CloudBlobClient client = storage.CreateCloudBlobClient();
CloudBlobContainer container = client.GetContainerReference(container);
CloudAppendBlob blob = container.GetAppendBlobReference(filename);
using (MemoryStream stream = new MemoryStream())
using (StreamWriter sw = new StreamWriter(stream))
{
sw.WriteLine("This is appended line");
sw.Flush();
stream.Position = 0;
blob.AppendFromStream(stream);
}
}
If that helps out , kindly make sure to Upvote & Accept the answer.