簡體   English   中英

Azcopy 無法使用 sas 令牌從 azure 文件存儲下載文件?

[英]Azcopy fails to download file from azure file storage using sas token?

我正在嘗試將文件下載到在 azure 上運行 CentOS 的虛擬機。 linux box安裝了azcopy 我正在嘗試使用生成的 SAS 令牌從 azure 文件存儲下載文件,但無法下載。 我是否誤解了如何使用 SAS 令牌?

最終我能夠使用密鑰而不是 SAS 令牌下載文件。 所以我知道網址是正確的。

我使用 linux vm 的公共 ip 為存儲帳戶創建了一個 sas 令牌,然后將其復制並附加到文件 url 中。 我創建了一個 CORS 規則來允許所有 ip 地址。 我在我的本地機器上重復了這個(使用它的公共 IP)並且能夠獲取文件。 當我在 vm 上運行相同的命令時,它失敗了。

我嘗試使用附加到 url 的 sas 令牌運行它,並將其作為單獨的參數傳入。

azcopy --source "https://mynamehere.file.core.windows.net/pathtofile/file" --source-sas "?sv=2018-03-28&ss=...&srt =...&sp=...&se=2019-04-04T21:53:38Z&st=2019-04-04T13:53:38Z&sip=...&spr=https&sig=..." --destination file --verbose

我不斷得到

[VERBOSE] Location 'Cloud file: https://mynamehere.file.core.windows.net/pathtofile/file' does not exist, This request is not authorized to perform this operation.
HttpStatusMessage:This request is not authorized to perform this operation.

[ERROR] Error parsing source location "https://mynamehere.file.core.windows.net/pathtofile/file": Source with location type File doesn't exist.

請檢查您用於訪問存儲的 sas 令牌的權限(讀取、寫入、刪除)和到期時間

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM