[英]Download blob using url of the blob and sas token in node.js
[英]Node.js reading a blob with azure and creating a SAS token
所以我目前正在編寫一些代碼來獲取一個容器,然后選擇一個 blob 並制作一個 SAS 令牌。 目前所有這些都有效,但是當我嘗試打開鏈接時出現錯誤。
給出的錯誤是這樣的。
AuthenticationFailed
服務器未能對請求進行身份驗證。
確保 Authorization header 的值格式正確,包括簽名。
RequestId:somethingsomething 此資源級別不允許指定的已簽名資源
const test = () => { const keyCredit = new StorageSharedKeyCredential('storageaccount', 'key') const sasOptions = { containerName: 'compliance', blobName: 'swo_compliance.csv', }; sasOptions.expiresOn = new Date(new Date().valueOf() + 3600 * 1000); sasOptions.permissions = BlobSASPermissions.parse("r"); const sasToken = generateBlobSASQueryParameters(sasOptions, keyCredit).toString(); console.log(`SAS token for blob container is: url/?${sasToken}`); return `url/?${sasToken}`; }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.