I am trying to fetch a html page which is placed in Azure blob storage using postman. The default blob storage access has been set to private, so i have to send "Shared Key", "x-ms-version" and "x-ms-date" in the header section to Authorize.
Here is the screen shot of request in Postman.
When i click on send button i am getting an error stating "The date header in the request is incorrect".
Any ideas to solve the issue?
Update-Corrected Date Format
I corrected the "x-ms-date" format, now it throwing an error stating Authentication Info is not in correct format
Here is the Authorization section of postman
Thanks for the help.
Three of the headers are required: an Authorization header, x-ms-date (contains the UTC time for the request), and x-ms-version (specifies the version of the REST API to use).
To retrieve metadata, call the GetProperties or GetPropertiesAsync method on your blob or container to populate the Metadata collection, then read the values, as shown in the example below. The GetProperties methods retrieve blob properties and metadata in a single call.
Azure Blob storage is a feature of Microsoft Azure. It allows users to store large amounts of unstructured data on Microsoft's data storage platform. In this case, Blob stands for Binary Large Object, which includes objects such as images and multimedia files.
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.
Please review the documentation.
You need to specify two headers for correct request: Authorization
and x-ms-date
headers.
The correct format for x-ms-date
header is Fri, 26 Jun 2015 23:39:12 GMT
.
It seems your Authorization
header is invalid.
Try to regenerate your SAS key and test your request again.
As I understand correctly then you have only 15 minutes for requests.
From documentation:
The storage services ensure that a request is no older than 15 minutes by the time it reaches the service. This guards against certain security attacks, including replay attacks. When this check fails, the server returns response code 403 (Forbidden).
The format is Fri, 26 Jun 2015 23:39:12 GMT
. In Python, this can be obtained via
import datetime
date = datetime.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')
assuming locale.en_US
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With