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 9155073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:31:49+00:00 2026-06-17T12:31:49+00:00

I am using c# to create shared access signatures for new resources (The user

  • 0

I am using c# to create shared access signatures for new resources (The user should have create privileges to create new resources on my storage account).
The MS documentation is out of date and I can’t seem to get it to work using the different blog posts I’ve gone through.

Right now my code looks like so:

public static string GetBlobSharedAccessSignitureUrl(CloudBlobContainer container,string nameOfBlobToCreateSaSfor)
        {
            var blob = container.GetBlockBlobReference(nameOfBlobToCreateSaSfor);
            var policy = new SharedAccessBlobPolicy
                             {
                                 SharedAccessExpiryTime = DateTime.Now.AddHours(1),
                                 Permissions = SharedAccessBlobPermissions.Write | SharedAccessBlobPermissions.Read
                             };


            container.GetSharedAccessSignature(policy);
            string sas = blob.GetSharedAccessSignature(policy);

            return blob.Uri.AbsoluteUri + sas;

        }

and the returned url (for my local machine) looks like this (what seems to be correct)

http://127.0.0.1:10000/devstoreaccount1/photos/photos_4.jpg?sv=2012-02-12&se=2013-01-20T10%3A13%3A17Z&sr=b&sp=rw&sig=xxx

I started the Azure storage simulator and through fiddler tried to POST to this URL (also tried PUT)

I am getting errors (404 or 400 , depends on different code for this function that I have tried)

Do I need to do something else? (In the old examples I saw them create a resource in that location before hand – which I’ve tried as well but didn’t work either…)

Azure SDK version is 2.0 so the MS blog posts (and other tutorials) before October 2012 are broken (also according to MS dev blog http://blogs.msdn.com/b/windowsazurestorage/archive/2012/10/29/windows-azure-storage-client-library-2-0-breaking-changes-amp-migration-guide.aspx)

any help would be appreciated

  • 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-17T12:31:49+00:00Added an answer on June 17, 2026 at 12:31 pm

    If you’re posting through Fiddler or through your code, please make sure you add “x-ms-blob-type” request header and set it’s value as “BlockBlob”. Take a look at this sample code where it tries to upload a file:

                    FileInfo fInfo = new FileInfo(fileName);//fileName is the full path of the file.
                    HttpWebRequest req = (HttpWebRequest)WebRequest.Create(blobSaSUrl);
                    NameValueCollection requestHeaders = new NameValueCollection();
                    requestHeaders.Add("x-ms-blob-type", "BlockBlob");
                    req.Method = "PUT";
                    req.Headers.Add(requestHeaders);
                    req.ContentLength = fInfo.Length;
                    byte[] fileContents = new byte[fInfo.Length];
                    using (FileStream fs = fInfo.OpenRead())
                    {
                        fs.Read(fileContents, 0, fileContents.Length);
                        using (Stream s = req.GetRequestStream())
                        {
                            s.Write(fileContents, 0, fileContents.Length);
                        }
                        using (HttpWebResponse resp = (HttpWebResponse)req.GetResponse())
                        {
                        }
                    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 questions concerns about using shared memory. I'm using CreateFileMapping to create
when I tried to create a shared library file using the cl command in
Every new web service you create using visual studio comes with a predefined namespace
I have web site hosted on shared hosting account which is managed by CPanel.
I have designed an online editor with which a user can create files and
I'm in Linux 2.6. I have an environment where 2 processes simulate (using shared
I'm using Prism so I can create a modular solution. I need to access
i am using Directory.CreateDirectory(\\\\MyShared\\Pics\\NewFolder) to create a new folder in the directory \\MyShared\Pics and
I have to access some customers databases being hosted in a shared environment. There
I have a set of Win32 applications that share information using a shared memory

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.