Azure Storage REST API with Shared Key Suddenly Returns 403 errors

Jared Buschkopf 211 Reputation points
2022-11-02T19:46:45.073+00:00

I've had a web page that uploads files to and downloads files from Azure Storage using the Blob Storage REST API, authenticating with Shared Key, for some time now and suddenly today it is failing with 403 errors.

"AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature...The Date header in the request is incorrect."

My code and environment have not changed. The code is constructing the signature and request headers per the documentation. The same date in the x-ms-date header on the http request is going into the signature in the spot for x-ms-date. Is this related to the issue I see on the Azure Status page for Key Vaults (https://status.azure.com/en-us/status) ? Is there a separate issue on the Azure side that is causing this? Has Microsoft changed the API?

I saw at least one other post about a 403 error with Azure Blob Storage not long ago. Maybe more folks than just me are facing this?

Update:
I also tried using Date instead of x-ms-date in the header and signature (and different combinations) but that didn't work either. Same 403 error every time complaining about the date. It matches the format of the date in the documentation so I'm stumped here.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,687 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,428 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jared Buschkopf 211 Reputation points
    2022-11-03T13:02:13.277+00:00

    After much troubleshooting my colleague discovered that apparently the day in the date needs to be 0 padded. I guess I had been getting lucky all this time. It would help if the documentation had more information on the date format that could have helped here. I will submit feedback to Microsoft on that article.


  2. SaiKishor-MSFT 17,186 Reputation points
    2022-11-04T01:17:11.263+00:00

    @Jared Buschkopf The date format for Azure Storage is mentioned here- https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values

    This mentions the ISO 8601 UTC formats as acceptable.

    "The following ISO 8601 UTC formats are currently accepted by Azure Storage. The date value is required, while the time value is optional:

    YYYY-MM-DD
    YYYY-MM-DDThh:mm<TZDSuffix>
    YYYY-MM-DDThh:mm:ss<TZDSuffix>
    For the date value in these formats, YYYY is a four-digit year representation, MM is a two-digit month representation starting at 1, and DD is a two-digit day representation starting at 1.

    If the optional time value is included, a literal designator T is required to separate the time value from the date value. For the time value, hh is the hour representation in 24-hour notation, mm is the two-digit minute representation, and ss is the two-digit second representation. Each of these values is expressed as an integer, starting at zero."

    Does that help? Thanks!