Azure 对象存储提示令牌过期

在程序运行到一段时间后,发现上传文件的时候提示:

<?xml version="1.0" encoding="UTF-8"?>
<Error>
   <Code>AuthenticationFailed</Code>
   <Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:c443ad49-c01e-0083-126e-ad5565000000
Time:2020-10-28T21:10:53.9706211Z</Message>
   <AuthenticationErrorDetail>Signature not valid in the specified time frame: Start [Wed, 28 Oct 2020 20:43:29 GMT] - Expiry [Wed, 28 Oct 2020 20:45:29 GMT] - Current [Wed, 28 Oct 2020 21:10:53 GMT]</AuthenticationErrorDetail>
</Error>

问题原因和解决

出现上面的提示的原因是你的 sasToken 过期了。

在 Azure 存储的时候,如果你生成 sasToken,在这个 token 上面有一个有效期的设置,在默认的时候这个有效期的时间非常短。

你可以设置为更长的时间。

单击上面的链接,修改令牌的有效期后生成新的令牌。

这样就可以保证你的存储不快速过期。

 
 
原文地址:https://www.cnblogs.com/huyuchengus/p/13894550.html