Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Authentication not in correct format" when setting Azure Blob Service Properties (REST API)

I am trying to set CORS rules on my Azure Blob Storage account by following these instructions.

This is the error I receive after making my request:

400 Authentication information is not given in the correct format. Check the value of Authorization header

Request URL:

PUT https://[MyAccountName].blob.core.windows.net/?restype=service&comp=properties

Request header:

x-ms-version: 2013-08-15
x-ms-date: Tue, 25 Feb 2014 13:02:00 GMT
Authorization: SharedKey
[MyAccountName]: [MyAccountKey]
Content-Length: 329
Host: [MyAccountName].blob.core.windows.net

Request body:

<?xml version="1.0" encoding="utf-8"?>
<StorageServiceProperties>
    <Cors>   
          <CorsRule>
                <AllowedOrigins>http://www.example.com</AllowedOrigins>
                <AllowedMethods>GET</AllowedMethods>
                <ExposedHeaders>x-ms-meta-data*,x-ms-meta*</ExposedHeaders>
                <AllowedHeaders>x-ms-meta-target*,x-ms-meta*</AllowedHeaders>
                <MaxAgeInSeconds>200</MaxAgeInSeconds>
        </CorsRule>
    <Cors>
</StorageServiceProperties>
like image 888
kaques Avatar asked Feb 25 '14 13:02

kaques


People also ask

Which authentication method should you use for Blob storage?

Suggested Answer: You can provide authorization credentials by using Azure Active Directory (AD), or by using a Shared Access Signature (SAS) token. Box 1: Both Azure Active Directory (AD) and Shared Access Signature (SAS) token are supported for Blob storage.

How do I authenticate my Azure Storage account?

To authenticate a security principal from your Azure Storage application, first configure Azure role-based access control (Azure RBAC) settings for that security principal. Azure Storage defines built-in roles that encompass permissions for containers and queues.

What is Wasbs in Azure?

ADLS - Azure Data Lake Storage. WASB - Windows Azure Storage Blob (provides unencrypted access)

What is azure blobstore?

Azure Blob storage is Microsoft's object storage solution for the cloud. Blob storage is optimized for storing massive amounts of unstructured data. Unstructured data is data that doesn't adhere to a particular data model or definition, such as text or binary data.


1 Answers

For people reaching this page and wondering why you get this error even though you are using a Shared Access Signature URL, then you most likely are sending YOUR APP token to Azure. Make sure to NOT include the Authorization header in this case.

like image 176
jsgoupil Avatar answered Sep 19 '22 12:09

jsgoupil