Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8718775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:37:46+00:00 2026-06-13T06:37:46+00:00

For a few hours I’ve been trying to set some metadata on the blob

  • 0

For a few hours I’ve been trying to set some metadata on the blob I create using the Azure SDK. I upload the data asynchronously using BeginUploadFromStream() and everything works smoothly. I can access the blob using its URI when the upload has completed, so it is created successfully, however any metadata I set is not persisted.

I set the metadata after calling EndUploadFromStream().

I’ve tried setting the metadata the three ways I can find through 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 to Azure, as specified by the documentation, but it does not stick. The call doesn’t trow any exceptions, but when I get a new reference to my blob, it doesn’t have any metadata.

I’ve tried saving the metadata asynchronously as well using BeginSetMetadata() and EndSetMetadata() but with similar result.

I start to think I’m missing something really trivial here, but after staring at it for five hours, I still cannot understand where I go wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:37:46+00:00Added an answer on June 13, 2026 at 6:37 am

    SetMetadata should work as expected. But simply getting a reference to the blob isn’t sufficient to read the metadata.

    After getting the blob reference, you need to call the FetchAttributes method on that CloudBlob. This will load all properties and metadata, and only then will you be able to access the metadata you set previously:

    // Get a reference to a blob.
    CloudBlob blob = blobClient.GetBlobReference("mycontainer/myblob.txt");
    
    // Populate the blob's attributes.
    blob.FetchAttributes();
    
    // Enumerate the blob's metadata.
    foreach (var metadataKey in blob.Metadata.Keys)
    {
        Console.WriteLine("Metadata name: " + metadataKey.ToString());
        Console.WriteLine("Metadata value: " + blob.Metadata.Get(metadataKey.ToString()));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For the past few hours I've been trying to figure out a way to
For the past few hours I have been trying to clone an image in
I have been struggling for the last few hours trying to get this search
I've been trying over the last few hours to implement a jQuery easing effect
For the last few hours, I've been trying to use jQuery append() to append
I have been looking around for a few hours trying to figure out how
I have been trying for the last few hours to get a UIAlert with
I've been for the past few hours trying to figure out why openCV doesn't
I've been trying for the past few hours to get SoundManager to work so
i spent last few hours trying to find what is wrong in my code(?)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.