question

DineshKumar-0907 avatar image
0 Votes"
DineshKumar-0907 asked Sumarigo-MSFT commented

Azcopy fails while executing thorugh powershell.

Hi,

Getting the below error while executing azcopy from powershell.

 $args = "/Source:\\UNCservcer\env\older /Dest:https://1234env.blob.core.windows.net/folder1/folder2  /DestKey:hsyugf-*********== /S /XO /V:\\uncserver\SHARE\folderlog\log_123.log"
 $exepath  = "F:\Prgrm flss\azcopy\AzCopy.exe"
 Start-Process     $exepath $args-Wait

I used the above code and got this error.
Error parsing destination location "https://1234env.blob.core.windows.net/folder1/folder2": The request was aborted: Could not create SSL/TLS secure channel.

I removed the the log(/V) and tried. But no luck.
I could see some solutions like to disable the the firewall and run azcopy as an adminstrator. But I am restricted to do this stuffs.

Thanks.

azure-storage-accountsazure-blob-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.

ManuPhilip avatar image
0 Votes"
ManuPhilip answered Sumarigo-MSFT commented

Hello @DineshKumar,


Please change the url as below: Reason: Syntax has changed in recent azcopy versions. SOURCE parameter is not longer used, ACCESS KEYS are not longer used for authentication. You need to use SAS (Shared Access Signatures)


azcopy cp "C:\myfolder*" "https://YOURSTORAGEACCOUNT.blob.core.windows.net/photos/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-06-07T13:30:00Z&st=2019-06-07T04:30:00Z&spr=https,http&sig=u5bUaEKOXJHqSbWVK16SiOgcI2SVg8mLAr2ujKWe%2F%2FI%3D" --recursive=true




Please mark as "Accept the answer" if the above steps helps you. Others with similar issues can also follow the solution as per your suggestion


Regards,


Manu


· 4
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.

Hi Manu,

Thanks for your quick response.

I tried with your above command but getting the below error.

  failed to perform copy command due to error: no sas token or Oauth token is present and the resource is not public.

I dont't have SAS token either. How do I execute without SAS token.

I have only the authentication key which is ending with == like this.
"hsyugf+vktfdDghhh/jyt*=="



0 Votes 0 ·

Hello Dinesh,
You may create the SAS token from the reference as below:

https://docs.microsoft.com/en-us/cli/azure/storage/container?view=azure-cli-latest#az-storage-container-generate-sas-examples

Example:

 az storage container generate-sas --account-key 00000000 --account-name mystorageaccount --expiry 2020-01-01 --name mycontainer --permissions dlrw


Please mark as "Accept the answer" if the above steps helps you. Others with similar issues can also follow the solution as per your suggestion

Regards,

Manu







0 Votes 0 ·

Hi Manu,

Is it possible the execute the command without SAS token?

0 Votes 0 ·
Show more comments
ManuPhilip avatar image
0 Votes"
ManuPhilip answered Sumarigo-MSFT converted comment to answer

Hello Dinesh,

You may check if it's a TLS issue for executing the PowerShell commands. That need a registry tweak as follows

Open Powershell and check for supported protocols by using the command


 [Net.ServicePointManager]::SecurityProtocol

Run anyone of the following 2 cmdlets to set .NET Framework strong cryptography registry keys:

Set strong cryptography on 64 bit .Net Framework (version 4 and above)

 Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord

set strong cryptography on 32 bit .Net Framework (version 4 and above)

 Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord

Restart Powershell and check again for supported protocol by using

[Net.ServicePointManager]::SecurityProtocol



Run the original PS commands again and check if you were able to susceed


Please mark as "Accept the answer" if the above steps helps you. Others with similar issues can also follow the solution as per your suggestion

Regards,

Manu

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.

Sumarigo-MSFT avatar image
0 Votes"
Sumarigo-MSFT answered Sumarigo-MSFT commented

@DineshKumar-0907 I see you have posted similar query in SO forum, If you are still finding any difficulties, please let me know




· 1
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.

@DineshKumar-0907 Just checking in to see if the above answer helped. If this answers your query, please don’t forget to "Accept the answer" and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

0 Votes 0 ·