locked
Azure Storage Emulator setting up RRS feed

  • Question

  • Today I was trying to set up the Azure Storage Emulator for testing purposes. I use my local database (MS SQL 2017 Development Edition). When I tried to generate the new container, I got the following error

    New-AzureStorageContainer : The remote server returned an error: (403) Forbidden. HTTP Status Code: 403 - HTTP Error Message: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

    I followed the tutorial provided by Microsoft (Use the Azure storage emulator for development and testing).

    Thank you in advance for your assistance!!

    Monday, December 11, 2017 11:35 AM

Answers

  • Hi Eva,

    I guess you tried defining the AccountKey and AccountName? You'll indeed run into the 403 error when using these. This is because the storage emulator uses custom endpoints (eg. http://127.0.0.1:10000/ for BLOB storage instead of https://yourstorageaccount.blob.core.windows.net).

    When you define a connection string in your Storage context it will work:

    $context = New-AzureStorageContext -ConnectionString "UseDevelopmentStorage=true"
    New-AzureStorageContainer -Name testcontainer -Context $context


    Floris van der Ploeg - www.florisvanderploeg.com

    If my post was helpfull, remember to click the "Propose as answer" button.

    • Marked as answer by Eva Pardi Monday, December 11, 2017 1:09 PM
    Monday, December 11, 2017 1:02 PM

All replies

  • When a client provides a SAS URI to Azure Storage as part of a request, the service checks the SAS parameters and signature to verify that it is valid for authenticating the request. If the service verifies that the signature is valid, then the request is authenticated. Otherwise, the request is declined with error code 403 (Forbidden).

    For more information refer the below link:

    Using shared access signatures (SAS)

    If you haven’t referred, refer the below article and let us know the status:

    https://blogs.msdn.microsoft.com/kwill/2013/08/27/http-403-server-failed-to-authenticate-the-request-when-using-shared-access-signatures/ 

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.


    • Edited by vikranth s Monday, December 11, 2017 12:26 PM
    Monday, December 11, 2017 12:25 PM
  • Thank you!

    According to the tutorial provided for the Storage Emulator (https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator), it is not really a generated SAS, this is the only key provided...

    "The storage emulator supports a single fixed account and a well-known authentication key for Shared Key authentication. This account and key are the only Shared Key credentials permitted for use with the storage emulator."

    Monday, December 11, 2017 12:58 PM
  • Hi Eva,

    I guess you tried defining the AccountKey and AccountName? You'll indeed run into the 403 error when using these. This is because the storage emulator uses custom endpoints (eg. http://127.0.0.1:10000/ for BLOB storage instead of https://yourstorageaccount.blob.core.windows.net).

    When you define a connection string in your Storage context it will work:

    $context = New-AzureStorageContext -ConnectionString "UseDevelopmentStorage=true"
    New-AzureStorageContainer -Name testcontainer -Context $context


    Floris van der Ploeg - www.florisvanderploeg.com

    If my post was helpfull, remember to click the "Propose as answer" button.

    • Marked as answer by Eva Pardi Monday, December 11, 2017 1:09 PM
    Monday, December 11, 2017 1:02 PM
  • Oh I thought I have to specify that only in the config file.. It is working perfectly now!!! :) Thank you!!!!!
    Monday, December 11, 2017 1:10 PM