Azure storage error using Python SDK

后端 未结 1 1345
忘了有多久
忘了有多久 2021-01-14 08:43

I\'ve download Azure SDK for python to my Ubuntu (Tool version 0.8.16). And i\'m trying to run this code

from azure.storage import BlobService
blob_service          


        
1条回答
  •  隐瞒了意图╮
    2021-01-14 09:14

    As mentioned in the error:

    Request date header too old: 'Tue, 24 Mar 2015 09:06:59 GMT'

    You will get this error if difference between the date/time on your computer (in UTC) and date/time on Azure Storage Server is more than 15-20 minutes (your computer's date/time is behind that of Azure).

    UPDATE

    Essentially what happens is that when a request is sent to Azure Storage Service (e.g. create container) the SDK takes the local date/time of your computer, converts it into UTC and then sends it to Azure along with the request (as a request header either date or x-ms-date). Upon receiving the request, among other things Azure Storage service compares this date/time with its date/time and if the difference is more than 15-20 minutes (your clock is behind), Azure Storage service throws the error you're getting. This is done as a security measure so that in case somebody got hold of your request can't replay the request over and over again.

    0 讨论(0)
提交回复
热议问题