Could you give an example for how to copy files with azure storage key. Only example I see is SAS?
What is equal of this in azcopy 10
azcopy.exe /Source:$sourcePath /Dest:$deploymentPath /destkey:$destinationKey /Pattern:"*.jpg" /S /Y
Thanks
Hi @tkumark, the lack of Shared Key support is by design, because Shared Keys have admin privileges, so it's bad practice to copy them around on the command line.
If you would like to generate a SAS, the easiest way is to use the Storage Explorer, which even provides the full URL with SAS token attached.
I was looking for this as well. Note that azcopy copy --help states that it supports key authentication for ADLS2:
C:\Users\hongooi>azcopy copy --help
Copies source data to a destination location. The supported pairs are:
- local <-> Azure Blob (SAS or OAuth authentication)
- local <-> Azure File (SAS authentication)
- local <-> ADLS Gen 2 (OAuth or SharedKey authentication) <----
Does this mean that the online help is wrong, or should there be a way of specifying the key?
Hi @Hong-Revo, thanks for reaching out!
You are right, ADLSGen 2 does support SharedKey due to historic reason(there was no OAuth nor SAS support when it came out in preview), but we would encourage you to use OAuth instead.
I was looking for this as well. Note that
azcopy copy --helpstates that it supports key authentication for ADLS2:C:\Users\hongooi>azcopy copy --help Copies source data to a destination location. The supported pairs are: - local <-> Azure Blob (SAS or OAuth authentication) - local <-> Azure File (SAS authentication) - local <-> ADLS Gen 2 (OAuth or SharedKey authentication) <----Does this mean that the online help is wrong, or should there be a way of specifying the key?
I mean the same, how is the correct way to deal with key in version 10+ ?
Or can you give an example how to deal with SaS authentication in version 10+?
I figured how to do it, in the Storage Account---> Shared access Signature I created a new signature and then append it at the end of the destination URL and It worked!!!
My powershell looks like:
Set-Variable Destino -Value 'https://mystorage.blob.core.windows.net/Vms/?sv=2018-03-28&ss=b&srt=sco&sp=rwdlac&se=2021-07-30T23:31:47Z&st=2019-07-30T15:31:47Z&spr=https&sig=lalalalala
& "./azcopy_windows_amd64.exe" sync $Origen $Destino --delete-destination=true --put-md5
Hope someone find it useful.
Regards
I've just had to do the same.
Did dig into the sources and here is how you still can use it:
1) Use the Gen2 storage with "DFS" url.
2) Before running AzCopy set 2 env variables: ACCOUNT_NAME and ACCOUNT_KEY
@denispoperechny Is this method still working for you? I'm getting an error "failed to perform copy command due to error: OAuth token, SAS token, or shared key should be provided for Blob FS" when I try to download from an ADLS endpoint.
Most helpful comment
I figured how to do it, in the Storage Account---> Shared access Signature I created a new signature and then append it at the end of the destination URL and It worked!!!
My powershell looks like:
Set-Variable Destino -Value 'https://mystorage.blob.core.windows.net/Vms/?sv=2018-03-28&ss=b&srt=sco&sp=rwdlac&se=2021-07-30T23:31:47Z&st=2019-07-30T15:31:47Z&spr=https&sig=lalalalala& "./azcopy_windows_amd64.exe" sync $Origen $Destino --delete-destination=true --put-md5Hope someone find it useful.
Regards