Azure File storage SAS TOKEN

Ramya Harinarthini_MSFT 5,306 Reputation points Microsoft Employee
2020-05-11T06:25:14.897+00:00

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
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,354 questions
0 comments No comments
{count} votes

Accepted answer
  1. ChiragMishra-MSFT 951 Reputation points
    2020-05-11T10:24:02.377+00:00

    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

    0 comments No comments

0 additional answers

Sort by: Most helpful