question

GuduruSravanKumar-9492 avatar image
0 Votes"
GuduruSravanKumar-9492 asked ·

"Invoke-WebRequest : The underlying connection was closed: An unexpected error

Hi , I have tried below different ways to download azcopy using custom script extension

$AllProtocols = [System.Net.SecurityProtocolType]'Tls12'

[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols

[Net.ServicePointManager]::SecurityProtocol +='tls12'

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12

Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -OutFile $env:C:\temp\azcopy.zip

when I run my custom script extension , I am getting below error


"Invoke-WebRequest : The underlying connection was closed: An unexpected error


Any help on how to resolve it ?

azure-virtual-machinesazure-virtual-machines-extension
· 1
10 |1000 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.

@GuduruSravanKumar-9492 Any update on the issue?

If the suggested response helped you resolve your issue, do click on "Mark as Answer" and "Up-Vote" for the answer that helped you for benefit of the community.

Thanks.


0 Votes 0 ·

1 Answer

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

@GuduruSravanKumar-9492 Based on the error message there is a similar thread discussion in SO forum, please try the troubleshooting mentioned over-there and if the issue still persists, can you please the share the complete script hiding the PI data.

Azure Storage (including Azcopy) currently supports three versions of the TLS protocol: 1.0, 1.1, and 1.2. Azure Storage uses TLS 1.2 on public HTTPS endpoints, but TLS 1.0 and TLS 1.1 are still supported for backward compatibility.

For more information, please refer to this article: https://docs.microsoft.com/en-us/azure/storage/common/transport-layer-security-configure-minimum-version?tabs=portal

Hope this helps! Kindly let us know if the above helps or you need further assistance on this issue.


Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.



· Share
10 |1000 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.