簡體   English   中英

az 存儲上傳文件未按預期工作

[英]az storage upload file not working as expected

我一直在嘗試通過此鏈接將文件夾上傳到azure file share ,但它對我不起作用,這是否真的如該鏈接中所述那樣起作用,或者我們是否需要做任何額外的事情才能使其起作用。 這是我從 shell 所做的,只是運行了URL中提到的以下命令

az storage file upload-batch --connection-string "DefaultEndpointsProtocol=https;AccountName=asdadasd;AccountKey=ahdsidyagdasgdhasdghdgasdasjdag4857348574;EndpointSuffix=core.windows.net" --destination . --source /dfiles/folder

我收到以下錯誤

Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. ErrorCode: AuthenticationFailed
<?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:af9004d7-301a-0069-26e8-25db2b000000
Time:2020-05-09T09:57:19.5414005Z</Message><AuthenticationErrorDetail>The MAC signature found in the HTTP request 'gDQ+MYQgNglorkiZ3LkmHHNI56odT4FfxesXUhlK/TY=' is not the same as any computed signature. Server used following string to sign: 'PUT
x-ms-client-request-id:7747952b-91db-11ea-a2c1-000d3af2c73b
x-ms-content-length:90592
x-ms-date:Sat, 09 May 2020 09:57:19 GMT
x-ms-type:file
x-ms-version:2018-11-09
/storage/createdump'.</AuthenticationErrorDetail></Error

我不確定我在這里錯過了什么。 對此的任何幫助將不勝感激。

而不是指定. 對於目的地,請嘗試指定share name

az storage file upload-batch --connection-string "DefaultEndpointsProtocol=https;AccountName=asdadasd;AccountKey=ahdsidyagdasgdhasdghdgasdasjdag4857348574;EndpointSuffix=core.windows.net" --destination <share-name> --source /dfiles/folder

我也會留下我的反饋。 不要使用 --sas-token。 它總是拋出 404 找不到資源。 唯一合適的連接方式是--connection-string。

還可以使用下面的語句結構,並且可以肯定它會起作用:

az storage file upload-batch --account-name <storageName> -d '<shareName>/<example_folder>' --source <source_folder> --connection-string 'DefaultEndpointsProtocol=https;AccountName=<storageName>;AccountKey=<accountKey>;EndpointSuffix=core.windows.net'

暫無
暫無

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

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