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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:06:07+00:00 2026-06-15T18:06:07+00:00

I’m moving a ClickOnce install from a regular web server to Azure Blob storage

  • 0

I’m moving a ClickOnce install from a regular web server to Azure Blob storage and have a problem with some of the files. The filenames contains [ ] and CloudBlob.UploadFile fails with an exception:

Microsoft.WindowsAzure.Storageclient.StorageException:
Error accessing blob storage: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

The code has been used for a while and only fails on files with [ ] in the name so I don’t believe that it is an “authentication failure”. In this particular case, this is the seventh file being uploaded in a loop. I found this link on MSDN about valid file names and this on stack overflow which both show problems with square brackets in URL’s and reference UrlEncode. I added in a call to UrlEncode and that did not help. The container is created with public access since we use it to support customer downloads of our software. We have been hosting a “test” install in another container and have not had permission problems accessing that either.

I can upload the file with no name changes and then rename the file to add the “path” using newdesic’s Azure Storage Explorer tool so what is that doing that I am not doing?

  • 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-15T18:06:09+00:00Added an answer on June 15, 2026 at 6:06 pm

    I see you’re using the 1.7 SDK. This is a small encoding issue with the SDK which is also present in v2.0. Let’s see what happens.

    No encoding

    account.CreateCloudBlobClient()
           .GetContainerReference("temp")
           .GetBlobReference("abc[]def.txt")
           .UploadFile("myfile.txt");
    

    If you don’t encode the blob name, you’ll end up with a request to the following URL which is causing the authentication exception:

    http://account.blob.core.windows.net/temp/abc%5B%5Ddef.txt

    The is because the SDK uses Uri.EscapeUriString internally to encode your string, but this doesn’t take into account square brackets.

    Encoding

    Then you would expect the following to do the trick:

    account.CreateCloudBlobClient()
           .GetContainerReference("temp")
           .GetBlobReference(HttpUtility.UrlEncode("abc[]def.txt"))
           .UploadFile("myfile.txt");
    

    The issue here is that you’ll end up with this url:

    http://account.blob.core.windows.net/temp/abc%255b%255ddef.txt

    So what’s happening here? Calling HttpUtility.UrlEncode turns abc[]def.txt to abc%5B%5Ddef.txt, which is correct. But internally, the SDK will encode this string again which results in abc%255b%255ddef.txt, which isn’t what you want.

    Workaround

    The only way to apply encoding which takes square brackets into accounts is by using a small workaround. If you pass the full URL to the GetBlobReference method, the SDK assumes you did all the encoding yourself:

    var container = account.CreateCloudBlobClient().GetContainerReference("temp");
    var blob = container.GetBlobReference(String.Format("{0}/{1}", 
                    container.Uri, System.Web.HttpUtility.UrlEncode("abc[]def.txt")));
    blob.UploadFile("myfile.txt");
    

    This results in a correctly encoded URL:

    http://account.blob.core.windows.net/temp/abc%5b%5ddef.txt
    

    And if you use a tool like CloudXplorer, you’ll see the blob with the correct filename:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of posts stored in text files formatted in yaml/textile (from
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a text area in my form which accepts all possible characters from
I have been unable to fix a problem with Java Unicode and encoding. The
I have thousands of HTML files to process using Groovy/Java and I need to
I have a view passing on information from a database: def serve_article(request, id): served_article
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am currently running into a problem where an element is coming back from

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.