Hello @Sathish Kumar Rajendiran ,
I just tried the same piece of code which went through successfully.
Where exactly you are getting the error and what is the failure error message? For me It went past through that debug point. (see below)
Below is Non-REST API Code:
static void SetCustomMetaDataOnBlockBlob()
{
string connectionString = "DefaultEndpointsProtocol=https;AccountName=<straccount>;AccountKey=<key>==;EndpointSuffix=core.windows.net";
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
CloudBlobClient cloudBlobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = cloudBlobClient.GetContainerReference("test2");
CloudBlockBlob cloudBlockBlob = container.GetBlockBlobReference("6.txt");
MemoryStream msWrite = new MemoryStream(Encoding.UTF8.GetBytes("custommetadata"));
msWrite.Position = 0;
cloudBlockBlob.Metadata["test"] = "TestMeta123";
using (msWrite)
{
cloudBlockBlob.UploadFromStream(msWrite);
}
}
If you are still facing the error , please post the complete piece of code after removing the secrets so that we can debug further !