AzCopy - how to upload single file to a container using SASazcopy - Could not establish trust relationship for the SSL/TLS secure channelOmit uploaded files with AzCopyHow to transfer files from local machine to virtual folders within an Azure container (using blobxfer)Azcopy psts getting error 404 attempting to uploadHow to download a Blob using a SASAzcopy psts getting error 404 attempting to upload Need to download lower versionAn error occurred while reading the restart journalAzCopy upload file for LinuxAzCopy copy run from a batch file in Windows command prompt failureuploads a local file to a block blob
Can I make popcorn with any corn?
Why is an old chain unsafe?
I probably found a bug with the sudo apt install function
Motorized valve interfering with button?
Extreme, but not acceptable situation and I can't start the work tomorrow morning
Is it possible to do 50 km distance without any previous training?
What are these boxed doors outside store fronts in New York?
What would happen to a modern skyscraper if it rains micro blackholes?
Is there really no realistic way for a skeleton monster to move around without magic?
How is this relation reflexive?
Is there a minimum number of transactions in a block?
Why is the design of haulage companies so “special”?
When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?
I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine
How to add power-LED to my small amplifier?
Chess with symmetric move-square
Copycat chess is back
The magic money tree problem
"which" command doesn't work / path of Safari?
How do you conduct xenoanthropology after first contact?
Is it possible to make sharp wind that can cut stuff from afar?
Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?
Why Is Death Allowed In the Matrix?
Copenhagen passport control - US citizen
AzCopy - how to upload single file to a container using SAS
azcopy - Could not establish trust relationship for the SSL/TLS secure channelOmit uploaded files with AzCopyHow to transfer files from local machine to virtual folders within an Azure container (using blobxfer)Azcopy psts getting error 404 attempting to uploadHow to download a Blob using a SASAzcopy psts getting error 404 attempting to upload Need to download lower versionAn error occurred while reading the restart journalAzCopy upload file for LinuxAzCopy copy run from a batch file in Windows command prompt failureuploads a local file to a block blob
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a SAS for container (WRITE only, but I tries READ-WRITE-LIST too). And I need to upload a single file to that container. So I use AzCopy for that:
AzCopy /Source:./ /Dest:https://account.blob.core.windows.net/container/?sv=2018-03-28&si=write&sr=c&sig=****** /Pattern:somefile.ext /V:./AzCopy.log
And I tried another version:
AzCopy /Source:somefile.ext /Dest:https://account.blob.core.windows.net/container/somefile.ext /DestSAS:******
but that doesn't work either.
And I tried both AzCopy versions - 7.1.3 and 8.1! What else should I try?
BTW, with Powershell it works like a charm, with the same SAS token!
Windows 10 latest.
UPDATE
The log (made on completely different machine):
[2019.03.22 06:39:41.551+03:00] >>>>>>>>>>>>>>>> [2019.03.22
06:39:41.561+03:00][VERBOSE] Finished: 0 file(s), 0 B; Average Speed:0
B/s. [2019.03.22 06:39:41.569+03:00][VERBOSE] 8.1.0 : AzCopy
/Source:somefile.ext
/Dest:https://account.blob.core.windows.net/korch/somefile.ext
/DestSAS:****** /V:./AzCopy with SAS.log [2019.03.22
06:39:41.589+03:00][ERROR] An error occurred while reading the restart
journal from "C:UsersuserAppDataLocalMicrosoftAzureAzCopy".
Detailed error: Error parsing the journal file: Journal file was
generated by a different version of AzCopy. [2019.03.22
06:39:43.175+03:00][VERBOSE] [PROMPT] Do you want to overwrite the
journal to start a new operation? Choose Yes to overwrite, choose No
to cancel current operation. (Yes/No) : Y [2019.03.22
06:39:43.230+03:00][VERBOSE] Attempt to parse address 'somefile.ext'
to a directory as a candidate location succeeded. [2019.03.22
06:39:43.232+03:00][VERBOSE] Attempt to parse address 'somefile.ext'
to a single file as a candidate location succeeded. [2019.03.22
06:39:43.239+03:00][VERBOSE] Source is interpreted as a Local file:
G:1somefile.ext. [2019.03.22 06:39:43.260+03:00][VERBOSE] Attempt to
parse address
'https://account.blob.core.windows.net/korch/somefile.ext' to a
directory as a candidate location succeeded. [2019.03.22
06:39:43.269+03:00][VERBOSE] Attempt to parse address
'https://account.blob.core.windows.net/korch/somefile.ext' to a single
file as a candidate location succeeded. [2019.03.22
06:39:43.270+03:00][VERBOSE] Interpreting destination as a single file
as the provided source is a single file. [2019.03.22
06:39:43.271+03:00][VERBOSE] Destination is interpreted as a Cloud
blob: https://account.blob.core.windows.net/korch/somefile.ext.
[2019.03.22 06:39:43.942+03:00][VERBOSE] Start transfer:
G:1somefile.ext =>
https://account.blob.core.windows.net/korch/somefile.ext [2019.03.22
06:39:44.149+03:00][VERBOSE] Transfer FAILED: G:1somefile.ext =>
https://account.blob.core.windows.net/korch/somefile.ext. [2019.03.22
06:39:44.158+03:00][ERROR] An unknown error occurred: The transfer
failed. Server failed to authenticate the request. Make sure the value
of Authorization header is formed correctly including the signature.
HttpStatusMessage:Server failed to authenticate the request. Make sure
the value of Authorization header is formed correctly including the
signature. RequestId:76ffafce-901e-0132-6460-e00b82000000 Time:Fri, 22
Mar 2019 06:39:44 GMT [2019.03.22 06:39:44.161+03:00] Transfer
summary:
----------------- Total files transferred: 1 Transfer successfully: 0 Transfer skipped: 0 Transfer failed: 1 Elapsed time:
00.00:00:02
azure azure-blob-storage azcopy
|
show 1 more comment
I have a SAS for container (WRITE only, but I tries READ-WRITE-LIST too). And I need to upload a single file to that container. So I use AzCopy for that:
AzCopy /Source:./ /Dest:https://account.blob.core.windows.net/container/?sv=2018-03-28&si=write&sr=c&sig=****** /Pattern:somefile.ext /V:./AzCopy.log
And I tried another version:
AzCopy /Source:somefile.ext /Dest:https://account.blob.core.windows.net/container/somefile.ext /DestSAS:******
but that doesn't work either.
And I tried both AzCopy versions - 7.1.3 and 8.1! What else should I try?
BTW, with Powershell it works like a charm, with the same SAS token!
Windows 10 latest.
UPDATE
The log (made on completely different machine):
[2019.03.22 06:39:41.551+03:00] >>>>>>>>>>>>>>>> [2019.03.22
06:39:41.561+03:00][VERBOSE] Finished: 0 file(s), 0 B; Average Speed:0
B/s. [2019.03.22 06:39:41.569+03:00][VERBOSE] 8.1.0 : AzCopy
/Source:somefile.ext
/Dest:https://account.blob.core.windows.net/korch/somefile.ext
/DestSAS:****** /V:./AzCopy with SAS.log [2019.03.22
06:39:41.589+03:00][ERROR] An error occurred while reading the restart
journal from "C:UsersuserAppDataLocalMicrosoftAzureAzCopy".
Detailed error: Error parsing the journal file: Journal file was
generated by a different version of AzCopy. [2019.03.22
06:39:43.175+03:00][VERBOSE] [PROMPT] Do you want to overwrite the
journal to start a new operation? Choose Yes to overwrite, choose No
to cancel current operation. (Yes/No) : Y [2019.03.22
06:39:43.230+03:00][VERBOSE] Attempt to parse address 'somefile.ext'
to a directory as a candidate location succeeded. [2019.03.22
06:39:43.232+03:00][VERBOSE] Attempt to parse address 'somefile.ext'
to a single file as a candidate location succeeded. [2019.03.22
06:39:43.239+03:00][VERBOSE] Source is interpreted as a Local file:
G:1somefile.ext. [2019.03.22 06:39:43.260+03:00][VERBOSE] Attempt to
parse address
'https://account.blob.core.windows.net/korch/somefile.ext' to a
directory as a candidate location succeeded. [2019.03.22
06:39:43.269+03:00][VERBOSE] Attempt to parse address
'https://account.blob.core.windows.net/korch/somefile.ext' to a single
file as a candidate location succeeded. [2019.03.22
06:39:43.270+03:00][VERBOSE] Interpreting destination as a single file
as the provided source is a single file. [2019.03.22
06:39:43.271+03:00][VERBOSE] Destination is interpreted as a Cloud
blob: https://account.blob.core.windows.net/korch/somefile.ext.
[2019.03.22 06:39:43.942+03:00][VERBOSE] Start transfer:
G:1somefile.ext =>
https://account.blob.core.windows.net/korch/somefile.ext [2019.03.22
06:39:44.149+03:00][VERBOSE] Transfer FAILED: G:1somefile.ext =>
https://account.blob.core.windows.net/korch/somefile.ext. [2019.03.22
06:39:44.158+03:00][ERROR] An unknown error occurred: The transfer
failed. Server failed to authenticate the request. Make sure the value
of Authorization header is formed correctly including the signature.
HttpStatusMessage:Server failed to authenticate the request. Make sure
the value of Authorization header is formed correctly including the
signature. RequestId:76ffafce-901e-0132-6460-e00b82000000 Time:Fri, 22
Mar 2019 06:39:44 GMT [2019.03.22 06:39:44.161+03:00] Transfer
summary:
----------------- Total files transferred: 1 Transfer successfully: 0 Transfer skipped: 0 Transfer failed: 1 Elapsed time:
00.00:00:02
azure azure-blob-storage azcopy
You need to specify the SAS for the source also ?
– Thomas
Mar 22 at 1:26
source is the local file!
– alvipeo
Mar 22 at 1:40
What's the error message you're getting?
– Gaurav Mantri
Mar 22 at 2:30
Unauthorized header.
– alvipeo
Mar 22 at 3:29
Can you please edit your question and include complete error message? I tried both commands you used above and I was able to successfully upload a local file.
– Gaurav Mantri
Mar 22 at 3:33
|
show 1 more comment
I have a SAS for container (WRITE only, but I tries READ-WRITE-LIST too). And I need to upload a single file to that container. So I use AzCopy for that:
AzCopy /Source:./ /Dest:https://account.blob.core.windows.net/container/?sv=2018-03-28&si=write&sr=c&sig=****** /Pattern:somefile.ext /V:./AzCopy.log
And I tried another version:
AzCopy /Source:somefile.ext /Dest:https://account.blob.core.windows.net/container/somefile.ext /DestSAS:******
but that doesn't work either.
And I tried both AzCopy versions - 7.1.3 and 8.1! What else should I try?
BTW, with Powershell it works like a charm, with the same SAS token!
Windows 10 latest.
UPDATE
The log (made on completely different machine):
[2019.03.22 06:39:41.551+03:00] >>>>>>>>>>>>>>>> [2019.03.22
06:39:41.561+03:00][VERBOSE] Finished: 0 file(s), 0 B; Average Speed:0
B/s. [2019.03.22 06:39:41.569+03:00][VERBOSE] 8.1.0 : AzCopy
/Source:somefile.ext
/Dest:https://account.blob.core.windows.net/korch/somefile.ext
/DestSAS:****** /V:./AzCopy with SAS.log [2019.03.22
06:39:41.589+03:00][ERROR] An error occurred while reading the restart
journal from "C:UsersuserAppDataLocalMicrosoftAzureAzCopy".
Detailed error: Error parsing the journal file: Journal file was
generated by a different version of AzCopy. [2019.03.22
06:39:43.175+03:00][VERBOSE] [PROMPT] Do you want to overwrite the
journal to start a new operation? Choose Yes to overwrite, choose No
to cancel current operation. (Yes/No) : Y [2019.03.22
06:39:43.230+03:00][VERBOSE] Attempt to parse address 'somefile.ext'
to a directory as a candidate location succeeded. [2019.03.22
06:39:43.232+03:00][VERBOSE] Attempt to parse address 'somefile.ext'
to a single file as a candidate location succeeded. [2019.03.22
06:39:43.239+03:00][VERBOSE] Source is interpreted as a Local file:
G:1somefile.ext. [2019.03.22 06:39:43.260+03:00][VERBOSE] Attempt to
parse address
'https://account.blob.core.windows.net/korch/somefile.ext' to a
directory as a candidate location succeeded. [2019.03.22
06:39:43.269+03:00][VERBOSE] Attempt to parse address
'https://account.blob.core.windows.net/korch/somefile.ext' to a single
file as a candidate location succeeded. [2019.03.22
06:39:43.270+03:00][VERBOSE] Interpreting destination as a single file
as the provided source is a single file. [2019.03.22
06:39:43.271+03:00][VERBOSE] Destination is interpreted as a Cloud
blob: https://account.blob.core.windows.net/korch/somefile.ext.
[2019.03.22 06:39:43.942+03:00][VERBOSE] Start transfer:
G:1somefile.ext =>
https://account.blob.core.windows.net/korch/somefile.ext [2019.03.22
06:39:44.149+03:00][VERBOSE] Transfer FAILED: G:1somefile.ext =>
https://account.blob.core.windows.net/korch/somefile.ext. [2019.03.22
06:39:44.158+03:00][ERROR] An unknown error occurred: The transfer
failed. Server failed to authenticate the request. Make sure the value
of Authorization header is formed correctly including the signature.
HttpStatusMessage:Server failed to authenticate the request. Make sure
the value of Authorization header is formed correctly including the
signature. RequestId:76ffafce-901e-0132-6460-e00b82000000 Time:Fri, 22
Mar 2019 06:39:44 GMT [2019.03.22 06:39:44.161+03:00] Transfer
summary:
----------------- Total files transferred: 1 Transfer successfully: 0 Transfer skipped: 0 Transfer failed: 1 Elapsed time:
00.00:00:02
azure azure-blob-storage azcopy
I have a SAS for container (WRITE only, but I tries READ-WRITE-LIST too). And I need to upload a single file to that container. So I use AzCopy for that:
AzCopy /Source:./ /Dest:https://account.blob.core.windows.net/container/?sv=2018-03-28&si=write&sr=c&sig=****** /Pattern:somefile.ext /V:./AzCopy.log
And I tried another version:
AzCopy /Source:somefile.ext /Dest:https://account.blob.core.windows.net/container/somefile.ext /DestSAS:******
but that doesn't work either.
And I tried both AzCopy versions - 7.1.3 and 8.1! What else should I try?
BTW, with Powershell it works like a charm, with the same SAS token!
Windows 10 latest.
UPDATE
The log (made on completely different machine):
[2019.03.22 06:39:41.551+03:00] >>>>>>>>>>>>>>>> [2019.03.22
06:39:41.561+03:00][VERBOSE] Finished: 0 file(s), 0 B; Average Speed:0
B/s. [2019.03.22 06:39:41.569+03:00][VERBOSE] 8.1.0 : AzCopy
/Source:somefile.ext
/Dest:https://account.blob.core.windows.net/korch/somefile.ext
/DestSAS:****** /V:./AzCopy with SAS.log [2019.03.22
06:39:41.589+03:00][ERROR] An error occurred while reading the restart
journal from "C:UsersuserAppDataLocalMicrosoftAzureAzCopy".
Detailed error: Error parsing the journal file: Journal file was
generated by a different version of AzCopy. [2019.03.22
06:39:43.175+03:00][VERBOSE] [PROMPT] Do you want to overwrite the
journal to start a new operation? Choose Yes to overwrite, choose No
to cancel current operation. (Yes/No) : Y [2019.03.22
06:39:43.230+03:00][VERBOSE] Attempt to parse address 'somefile.ext'
to a directory as a candidate location succeeded. [2019.03.22
06:39:43.232+03:00][VERBOSE] Attempt to parse address 'somefile.ext'
to a single file as a candidate location succeeded. [2019.03.22
06:39:43.239+03:00][VERBOSE] Source is interpreted as a Local file:
G:1somefile.ext. [2019.03.22 06:39:43.260+03:00][VERBOSE] Attempt to
parse address
'https://account.blob.core.windows.net/korch/somefile.ext' to a
directory as a candidate location succeeded. [2019.03.22
06:39:43.269+03:00][VERBOSE] Attempt to parse address
'https://account.blob.core.windows.net/korch/somefile.ext' to a single
file as a candidate location succeeded. [2019.03.22
06:39:43.270+03:00][VERBOSE] Interpreting destination as a single file
as the provided source is a single file. [2019.03.22
06:39:43.271+03:00][VERBOSE] Destination is interpreted as a Cloud
blob: https://account.blob.core.windows.net/korch/somefile.ext.
[2019.03.22 06:39:43.942+03:00][VERBOSE] Start transfer:
G:1somefile.ext =>
https://account.blob.core.windows.net/korch/somefile.ext [2019.03.22
06:39:44.149+03:00][VERBOSE] Transfer FAILED: G:1somefile.ext =>
https://account.blob.core.windows.net/korch/somefile.ext. [2019.03.22
06:39:44.158+03:00][ERROR] An unknown error occurred: The transfer
failed. Server failed to authenticate the request. Make sure the value
of Authorization header is formed correctly including the signature.
HttpStatusMessage:Server failed to authenticate the request. Make sure
the value of Authorization header is formed correctly including the
signature. RequestId:76ffafce-901e-0132-6460-e00b82000000 Time:Fri, 22
Mar 2019 06:39:44 GMT [2019.03.22 06:39:44.161+03:00] Transfer
summary:
----------------- Total files transferred: 1 Transfer successfully: 0 Transfer skipped: 0 Transfer failed: 1 Elapsed time:
00.00:00:02
azure azure-blob-storage azcopy
azure azure-blob-storage azcopy
edited Mar 22 at 3:42
alvipeo
asked Mar 22 at 1:04
alvipeoalvipeo
95011141
95011141
You need to specify the SAS for the source also ?
– Thomas
Mar 22 at 1:26
source is the local file!
– alvipeo
Mar 22 at 1:40
What's the error message you're getting?
– Gaurav Mantri
Mar 22 at 2:30
Unauthorized header.
– alvipeo
Mar 22 at 3:29
Can you please edit your question and include complete error message? I tried both commands you used above and I was able to successfully upload a local file.
– Gaurav Mantri
Mar 22 at 3:33
|
show 1 more comment
You need to specify the SAS for the source also ?
– Thomas
Mar 22 at 1:26
source is the local file!
– alvipeo
Mar 22 at 1:40
What's the error message you're getting?
– Gaurav Mantri
Mar 22 at 2:30
Unauthorized header.
– alvipeo
Mar 22 at 3:29
Can you please edit your question and include complete error message? I tried both commands you used above and I was able to successfully upload a local file.
– Gaurav Mantri
Mar 22 at 3:33
You need to specify the SAS for the source also ?
– Thomas
Mar 22 at 1:26
You need to specify the SAS for the source also ?
– Thomas
Mar 22 at 1:26
source is the local file!
– alvipeo
Mar 22 at 1:40
source is the local file!
– alvipeo
Mar 22 at 1:40
What's the error message you're getting?
– Gaurav Mantri
Mar 22 at 2:30
What's the error message you're getting?
– Gaurav Mantri
Mar 22 at 2:30
Unauthorized header.
– alvipeo
Mar 22 at 3:29
Unauthorized header.
– alvipeo
Mar 22 at 3:29
Can you please edit your question and include complete error message? I tried both commands you used above and I was able to successfully upload a local file.
– Gaurav Mantri
Mar 22 at 3:33
Can you please edit your question and include complete error message? I tried both commands you used above and I was able to successfully upload a local file.
– Gaurav Mantri
Mar 22 at 3:33
|
show 1 more comment
2 Answers
2
active
oldest
votes
ok, I created a .CMD file for AzCopy'ing a single file. But I didn't know I had to escape % in windows batch files. That's why SAS token was not correct at the end.
add a comment |
Here's what I tried that worked.
AzCopy /Source:D:temp /Dest:https://account-name.blob.core.windows.net/blob-container-name /DestSAS:"?se=2019-03-30T18%3A30%3A00Z&sp=rw&sv=2018-03-28&sr=c&sig=xxxxx...%3D" /Pattern:test.txt
AzCopy /Source:D:temp2 /Dest:"https://account-name.blob.core.windows.net/blob-container-name?se=2019-03-30T18%3A30%3A00Z&sp=rw&sv=2018-03-28&sr=c&sig=xxxxx...%3D" /Pattern:test.log
One thing I noticed is that if I just include Write
permission, the operation fails. I had to add Read
permission in my SAS for the operation to succeed.
Furthermore, I had to include SAS token in double quotes.
There should be a space before /DestSAS, correct? Let me try it...
– alvipeo
Mar 22 at 3:59
That's correct. Edited my answer.
– Gaurav Mantri
Mar 22 at 4:00
Are you sure your SAS token made with policy for the container?
– alvipeo
Mar 22 at 4:06
I did not use a policy. I created an ad-hoc SAS token with read and write permission on the blob container.
– Gaurav Mantri
Mar 22 at 4:09
ok, I think I found the problem. I made a .cmd file with parameter and SAS token should be escaped inside batch file... Gr....!
– alvipeo
Mar 22 at 4:11
|
show 1 more comment
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55291430%2fazcopy-how-to-upload-single-file-to-a-container-using-sas%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
ok, I created a .CMD file for AzCopy'ing a single file. But I didn't know I had to escape % in windows batch files. That's why SAS token was not correct at the end.
add a comment |
ok, I created a .CMD file for AzCopy'ing a single file. But I didn't know I had to escape % in windows batch files. That's why SAS token was not correct at the end.
add a comment |
ok, I created a .CMD file for AzCopy'ing a single file. But I didn't know I had to escape % in windows batch files. That's why SAS token was not correct at the end.
ok, I created a .CMD file for AzCopy'ing a single file. But I didn't know I had to escape % in windows batch files. That's why SAS token was not correct at the end.
answered Mar 22 at 4:37
alvipeoalvipeo
95011141
95011141
add a comment |
add a comment |
Here's what I tried that worked.
AzCopy /Source:D:temp /Dest:https://account-name.blob.core.windows.net/blob-container-name /DestSAS:"?se=2019-03-30T18%3A30%3A00Z&sp=rw&sv=2018-03-28&sr=c&sig=xxxxx...%3D" /Pattern:test.txt
AzCopy /Source:D:temp2 /Dest:"https://account-name.blob.core.windows.net/blob-container-name?se=2019-03-30T18%3A30%3A00Z&sp=rw&sv=2018-03-28&sr=c&sig=xxxxx...%3D" /Pattern:test.log
One thing I noticed is that if I just include Write
permission, the operation fails. I had to add Read
permission in my SAS for the operation to succeed.
Furthermore, I had to include SAS token in double quotes.
There should be a space before /DestSAS, correct? Let me try it...
– alvipeo
Mar 22 at 3:59
That's correct. Edited my answer.
– Gaurav Mantri
Mar 22 at 4:00
Are you sure your SAS token made with policy for the container?
– alvipeo
Mar 22 at 4:06
I did not use a policy. I created an ad-hoc SAS token with read and write permission on the blob container.
– Gaurav Mantri
Mar 22 at 4:09
ok, I think I found the problem. I made a .cmd file with parameter and SAS token should be escaped inside batch file... Gr....!
– alvipeo
Mar 22 at 4:11
|
show 1 more comment
Here's what I tried that worked.
AzCopy /Source:D:temp /Dest:https://account-name.blob.core.windows.net/blob-container-name /DestSAS:"?se=2019-03-30T18%3A30%3A00Z&sp=rw&sv=2018-03-28&sr=c&sig=xxxxx...%3D" /Pattern:test.txt
AzCopy /Source:D:temp2 /Dest:"https://account-name.blob.core.windows.net/blob-container-name?se=2019-03-30T18%3A30%3A00Z&sp=rw&sv=2018-03-28&sr=c&sig=xxxxx...%3D" /Pattern:test.log
One thing I noticed is that if I just include Write
permission, the operation fails. I had to add Read
permission in my SAS for the operation to succeed.
Furthermore, I had to include SAS token in double quotes.
There should be a space before /DestSAS, correct? Let me try it...
– alvipeo
Mar 22 at 3:59
That's correct. Edited my answer.
– Gaurav Mantri
Mar 22 at 4:00
Are you sure your SAS token made with policy for the container?
– alvipeo
Mar 22 at 4:06
I did not use a policy. I created an ad-hoc SAS token with read and write permission on the blob container.
– Gaurav Mantri
Mar 22 at 4:09
ok, I think I found the problem. I made a .cmd file with parameter and SAS token should be escaped inside batch file... Gr....!
– alvipeo
Mar 22 at 4:11
|
show 1 more comment
Here's what I tried that worked.
AzCopy /Source:D:temp /Dest:https://account-name.blob.core.windows.net/blob-container-name /DestSAS:"?se=2019-03-30T18%3A30%3A00Z&sp=rw&sv=2018-03-28&sr=c&sig=xxxxx...%3D" /Pattern:test.txt
AzCopy /Source:D:temp2 /Dest:"https://account-name.blob.core.windows.net/blob-container-name?se=2019-03-30T18%3A30%3A00Z&sp=rw&sv=2018-03-28&sr=c&sig=xxxxx...%3D" /Pattern:test.log
One thing I noticed is that if I just include Write
permission, the operation fails. I had to add Read
permission in my SAS for the operation to succeed.
Furthermore, I had to include SAS token in double quotes.
Here's what I tried that worked.
AzCopy /Source:D:temp /Dest:https://account-name.blob.core.windows.net/blob-container-name /DestSAS:"?se=2019-03-30T18%3A30%3A00Z&sp=rw&sv=2018-03-28&sr=c&sig=xxxxx...%3D" /Pattern:test.txt
AzCopy /Source:D:temp2 /Dest:"https://account-name.blob.core.windows.net/blob-container-name?se=2019-03-30T18%3A30%3A00Z&sp=rw&sv=2018-03-28&sr=c&sig=xxxxx...%3D" /Pattern:test.log
One thing I noticed is that if I just include Write
permission, the operation fails. I had to add Read
permission in my SAS for the operation to succeed.
Furthermore, I had to include SAS token in double quotes.
edited Mar 22 at 4:00
answered Mar 22 at 3:53
Gaurav MantriGaurav Mantri
74.2k8116141
74.2k8116141
There should be a space before /DestSAS, correct? Let me try it...
– alvipeo
Mar 22 at 3:59
That's correct. Edited my answer.
– Gaurav Mantri
Mar 22 at 4:00
Are you sure your SAS token made with policy for the container?
– alvipeo
Mar 22 at 4:06
I did not use a policy. I created an ad-hoc SAS token with read and write permission on the blob container.
– Gaurav Mantri
Mar 22 at 4:09
ok, I think I found the problem. I made a .cmd file with parameter and SAS token should be escaped inside batch file... Gr....!
– alvipeo
Mar 22 at 4:11
|
show 1 more comment
There should be a space before /DestSAS, correct? Let me try it...
– alvipeo
Mar 22 at 3:59
That's correct. Edited my answer.
– Gaurav Mantri
Mar 22 at 4:00
Are you sure your SAS token made with policy for the container?
– alvipeo
Mar 22 at 4:06
I did not use a policy. I created an ad-hoc SAS token with read and write permission on the blob container.
– Gaurav Mantri
Mar 22 at 4:09
ok, I think I found the problem. I made a .cmd file with parameter and SAS token should be escaped inside batch file... Gr....!
– alvipeo
Mar 22 at 4:11
There should be a space before /DestSAS, correct? Let me try it...
– alvipeo
Mar 22 at 3:59
There should be a space before /DestSAS, correct? Let me try it...
– alvipeo
Mar 22 at 3:59
That's correct. Edited my answer.
– Gaurav Mantri
Mar 22 at 4:00
That's correct. Edited my answer.
– Gaurav Mantri
Mar 22 at 4:00
Are you sure your SAS token made with policy for the container?
– alvipeo
Mar 22 at 4:06
Are you sure your SAS token made with policy for the container?
– alvipeo
Mar 22 at 4:06
I did not use a policy. I created an ad-hoc SAS token with read and write permission on the blob container.
– Gaurav Mantri
Mar 22 at 4:09
I did not use a policy. I created an ad-hoc SAS token with read and write permission on the blob container.
– Gaurav Mantri
Mar 22 at 4:09
ok, I think I found the problem. I made a .cmd file with parameter and SAS token should be escaped inside batch file... Gr....!
– alvipeo
Mar 22 at 4:11
ok, I think I found the problem. I made a .cmd file with parameter and SAS token should be escaped inside batch file... Gr....!
– alvipeo
Mar 22 at 4:11
|
show 1 more comment
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55291430%2fazcopy-how-to-upload-single-file-to-a-container-using-sas%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You need to specify the SAS for the source also ?
– Thomas
Mar 22 at 1:26
source is the local file!
– alvipeo
Mar 22 at 1:40
What's the error message you're getting?
– Gaurav Mantri
Mar 22 at 2:30
Unauthorized header.
– alvipeo
Mar 22 at 3:29
Can you please edit your question and include complete error message? I tried both commands you used above and I was able to successfully upload a local file.
– Gaurav Mantri
Mar 22 at 3:33