For several hours, I have been trying to set some metadata in the blob that I create using the Azure SDK. I load data asynchronously using BeginUploadFromStream() and everything works smoothly. I can access the blob using its URI when the download is complete, so it was created successfully, however, any metadata that I set is not saved .
I set the metadata after by calling EndUploadFromStream() .
I tried setting metadata in three ways that I can find in the documentation :
// First attempt myBlob.Metadata["foo"] = "bar"; // Second attempt myBlob.Metadata.Add("foo", "bar"); //Third attempt var metadata = new NameValueCollection(); metadata["foo"] = "bar"; blob.Metadata.Add(metadata);
After setting the metadata, I call myBlob.SetMetadata() to save the metadata in Azure, as indicated in the documentation, but it is not inserted. The call does not raise any exceptions , but when I get a new link to my blob, it has no metadata .
I also tried to save metadata asynchronously using BeginSetMetadata() and EndSetMetadata() , but with a similar result.
I'm starting to think that I am missing something really trivial here, but looking at it for five hours, I still canβt understand where I am going wrong?
Christofer eliasson
source share