question

RamyaHarinarthini-MSFT avatar image
0 Votes"
RamyaHarinarthini-MSFT asked ChiragMishra-MSFT edited

Azure File storage SAS TOKEN

I can upload files to ADLS Gen 2 blob storage with AzCopy through OAuth authorization, but I am unable to upload to file storage with the same. It is asking for SAS token. Please tell me the process of generating SAS token. Thanks.

[Note: As we migrate from MSDN, this question has been posted by an Azure Cloud Engineer as a frequently asked question]

MSDN Source: Azure File storage SAS TOKEN


azure-data-lake-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ChiragMishra-MSFT avatar image
0 Votes"
ChiragMishra-MSFT answered ChiragMishra-MSFT edited

Welcome to the Microsoft Q&A (Preview) platform.

Happy to answer your query.

You can generate the SAS token: Settings => Shared access signature => Select the options required and click on generate SAS and connection string and copy the SAS token.


1473464



To learn more about SAS tokens and how to obtain one, see Using shared access signatures (SAS).

Use only the latest version of AzCopy (AzCopy v10):

Option1: Use Azure AD

Download a single file using OAuth authentication. Please use 'azcopy login' command first if you aren't logged in yet:



 azcopy cp "https://[account].blob.core.windows.net/[container]/[path/to/blob]" "/path/to/file.txt" 

Upload a single file with a SAS:



 azcopy cp "/path/to/file.txt" https://[account].blob.core.windows.net/[container]/[path/toblob]?[SAS] 

Option2: Use a SAS token

You can append a SAS token to each source or destination URL that use in your AzCopy commands.

This example command recursively copies data from a local directory to a blob container. A fictitious SAS token is appended to the end of the of the container URL.


 azcopy cp "C:\local\path" "https://account.blob.core.windows.net/mycontainer1/?sv=2018-03-28&ss=bjqt&srt=sco&sp=rwddgcup&se=2019-05-01T05:01:17Z&st=2019-04-30T21:01:17Z&spr=https&sig=MGCXiyEzbtttkr3ewJIh2AR8KrghSy1DGM9ovN734bQF4%3D" --recursive=true 

Hope this helps.

MSDN Source: Azure File storage SAS TOKEN


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.