Skip to content

Add retries to Invoke-WebRequest#4425

Merged
mikeharder merged 3 commits intoAzure:masterfrom
mikeharder:invoke-webrequest-retry
Jul 25, 2019
Merged

Add retries to Invoke-WebRequest#4425
mikeharder merged 3 commits intoAzure:masterfrom
mikeharder:invoke-webrequest-retry

Conversation

@mikeharder
Copy link
Member

@mikeharder mikeharder commented Jul 25, 2019

Anytime Invoke-WebRequest is used in a pipeline or script, retries should be allowed to handle intermittent failures due to network or server issues. I will make this change across all client-library pipelines and scripts in all repos.

Example pipeline failure:

##[command]"C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\ba73e13b-9a3c-4388-a471-fd1ac4884a28.ps1'"
Invoke-WebRequest : Unable to connect to the remote server
At D:\a\_temp\ba73e13b-9a3c-4388-a471-fd1ac4884a28.ps1:2 char:1
+ Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubuserconten ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc 
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

https://dev.azure.com/azure-sdk/public/_build/results?buildId=74157&view=logs&jobId=0cac3d53-c604-5b5d-0b4e-ac2b7ffbaab5&taskId=60a41d80-98c5-5054-7eb3-8e76656b2cf2&lineStart=12&lineEnd=13&colStart=1&colEnd=1

CC: @Azure/azure-sdk-eng

- Downloads may occasionally fail due to server or network issues
@mikeharder
Copy link
Member Author

/azp run js - docs

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@mikeharder mikeharder requested a review from scbedd July 25, 2019 19:37
@mikeharder
Copy link
Member Author

mikeharder commented Jul 25, 2019

@scbedd: I manually triggered a build of the js - docs pipeline to verify the change in docs.yml:

https://dev.azure.com/azure-sdk/internal/_build/results?buildId=74228

@mikeharder mikeharder merged commit d95bcc3 into Azure:master Jul 25, 2019
@mikeharder mikeharder deleted the invoke-webrequest-retry branch July 25, 2019 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants