@@ -301,31 +301,44 @@ function InstallDotNet([string] $dotnetRoot,
301301 if ($skipNonVersionedFiles ) { $installParameters.SkipNonVersionedFiles = $skipNonVersionedFiles }
302302 if ($noPath ) { $installParameters.NoPath = $True }
303303
304- try {
305- & $installScript @installParameters
306- }
307- catch {
308- if ($runtimeSourceFeed -or $runtimeSourceFeedKey ) {
309- Write-Host " Failed to install dotnet from public location. Trying from '$runtimeSourceFeed '"
310- if ($runtimeSourceFeed ) { $installParameters.AzureFeed = $runtimeSourceFeed }
304+ $variations = @ ()
305+ $variations += @ ($installParameters )
311306
312- if ($runtimeSourceFeedKey ) {
313- $decodedBytes = [System.Convert ]::FromBase64String($runtimeSourceFeedKey )
314- $decodedString = [System.Text.Encoding ]::UTF8.GetString($decodedBytes )
315- $installParameters.FeedCredential = $decodedString
316- }
307+ $dotnetBuilds = $installParameters.Clone ()
308+ $dotnetbuilds.AzureFeed = " https://dotnetbuilds.azureedge.net/public"
309+ $variations += @ ($dotnetBuilds )
317310
318- try {
319- & $installScript @installParameters
320- }
321- catch {
322- Write-PipelineTelemetryError - Category ' InitializeToolset' - Message " Failed to install dotnet from custom location '$runtimeSourceFeed '."
323- ExitWithExitCode 1
324- }
311+ if ($runtimeSourceFeed ) {
312+ $runtimeSource = $installParameters.Clone ()
313+ $runtimeSource.AzureFeed = $runtimeSourceFeed
314+ if ($runtimeSourceFeedKey ) {
315+ $decodedBytes = [System.Convert ]::FromBase64String($runtimeSourceFeedKey )
316+ $decodedString = [System.Text.Encoding ]::UTF8.GetString($decodedBytes )
317+ $runtimeSource.FeedCredential = $decodedString
318+ }
319+ $variations += @ ($runtimeSource )
320+ }
321+
322+ $installSuccess = $false
323+ foreach ($variation in $variations ) {
324+ if ($variation | Get-Member AzureFeed) {
325+ $location = $variation.AzureFeed
325326 } else {
326- Write-PipelineTelemetryError - Category ' InitializeToolset' - Message " Failed to install dotnet from public location."
327- ExitWithExitCode 1
327+ $location = " public location" ;
328+ }
329+ Write-Host " Attempting to install dotnet from $location ."
330+ try {
331+ & $installScript @variation
332+ $installSuccess = $true
333+ break
328334 }
335+ catch {
336+ Write-Host " Failed to install dotnet from $location ."
337+ }
338+ }
339+ if (-not $installSuccess ) {
340+ Write-PipelineTelemetryError - Category ' InitializeToolset' - Message " Failed to install dotnet from any of the specified locations."
341+ ExitWithExitCode 1
329342 }
330343}
331344
@@ -887,7 +900,7 @@ function Try-LogClientIpAddress()
887900 Write-Host " Attempting to log this client's IP for Azure Package feed telemetry purposes"
888901 try
889902 {
890- $result = Invoke-WebRequest - Uri " http://co1 .msedge.net/fdv2/diagnostics.aspx" - UseBasicParsing
903+ $result = Invoke-WebRequest - Uri " http://co1r5a .msedge.net/fdv2/diagnostics.aspx" - UseBasicParsing
891904 $lines = $result.Content.Split ([Environment ]::NewLine)
892905 $socketIp = $lines | Select-String - Pattern " ^Socket IP:.*"
893906 Write-Host $socketIp
0 commit comments