diff --git a/Tasks/DotNetCoreInstallerV0/externals/install-dotnet.ps1 b/Tasks/DotNetCoreInstallerV0/externals/install-dotnet.ps1 index 85404535cc2e..2d45bd0ac5c9 100644 --- a/Tasks/DotNetCoreInstallerV0/externals/install-dotnet.ps1 +++ b/Tasks/DotNetCoreInstallerV0/externals/install-dotnet.ps1 @@ -47,7 +47,7 @@ .PARAMETER Verbose Displays diagnostics information. .PARAMETER AzureFeed - Default: https://dotnetcli.azureedge.net/dotnet + Default: https://builds.dotnet.microsoft.com/dotnet This parameter typically is not changed by the user. It allows to change URL for the Azure feed used by this installer. .PARAMETER UncachedFeed @@ -68,7 +68,8 @@ param( [switch]$SharedRuntime, [switch]$DryRun, [switch]$NoPath, - [string]$AzureFeed="https://dotnetcli.azureedge.net/dotnet", + [string]$AzureFeed="https://builds.dotnet.microsoft.com/dotnet", + [string]$FallbackAzureFeed="https://dotnetcli.azureedge.net/dotnet", [string]$UncachedFeed="https://dotnetcli.blob.core.windows.net/dotnet", [string]$ProxyAddress, [switch]$ProxyUseDefaultCredentials @@ -446,12 +447,14 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde $CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture $SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version $DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture +$FallbackDownloadLink = Get-Download-Link -AzureFeed $FallbackAzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture $LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture if ($DryRun) { Say "Payload URLs:" Say "Primary - $DownloadLink" Say "Legacy - $LegacyDownloadLink" + Say "Fallback - $FallbackDownloadLink" Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir" exit 0 } @@ -484,12 +487,21 @@ try { DownloadFile -Uri $DownloadLink -OutPath $ZipPath } catch { - Say "Cannot download: $DownloadLink" - $DownloadLink = $LegacyDownloadLink - $ZipPath = [System.IO.Path]::GetTempFileName() - Say-Verbose "Legacy zip path: $ZipPath" - Say "Downloading legacy link: $DownloadLink" - DownloadFile -Uri $DownloadLink -OutPath $ZipPath + try { + Say "Cannot download: $DownloadLink" + $DownloadLink = $FallbackDownloadLink + $ZipPath = [System.IO.Path]::GetTempFileName() + Say-Verbose "Fallabck zip path: $ZipPath" + Say "Downloading fallback link: $FallbackDownloadLink" + DownloadFile -Uri $FallbackDownloadLink -OutPath $ZipPath + } catch { + Say "Cannot download: $FallbackDownloadLink" + $DownloadLink = $LegacyDownloadLink + $ZipPath = [System.IO.Path]::GetTempFileName() + Say-Verbose "Legacy zip path: $ZipPath" + Say "Downloading legacy link: $DownloadLink" + DownloadFile -Uri $DownloadLink -OutPath $ZipPath + } } Say "Extracting zip from $DownloadLink" diff --git a/Tasks/DotNetCoreInstallerV0/externals/install-dotnet.sh b/Tasks/DotNetCoreInstallerV0/externals/install-dotnet.sh index 0ea08a77870a..c5f626f63289 100644 --- a/Tasks/DotNetCoreInstallerV0/externals/install-dotnet.sh +++ b/Tasks/DotNetCoreInstallerV0/externals/install-dotnet.sh @@ -628,6 +628,9 @@ calculate_vars() { download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version) say_verbose "download_link=$download_link" + fallback_download_link=$(construct_download_link $fallback_azure_feed $channel $normalized_architecture $specific_version) + say_verbose "fallback_download_link=$fallback_download_link" + legacy_download_link=$(construct_legacy_download_link $azure_feed $channel $normalized_architecture $specific_version) || valid_legacy_download_link=false if [ "$valid_legacy_download_link" = true ]; then @@ -643,6 +646,7 @@ calculate_vars() { install_dotnet() { eval $invocation local download_failed=false + local fallback_download_failed=false if is_dotnet_package_installed $install_root "sdk" $specific_version; then say ".NET SDK version $specific_version is already installed." @@ -656,8 +660,20 @@ install_dotnet() { say "Downloading link: $download_link" download "$download_link" $zip_path || download_failed=true + say_verbose "download_failed: $download_failed" + + if [ "$download_failed" = true ]; then + say "Cannot download: $download_link" + download_link=$fallback_download_link + zip_path=$(mktemp $temporary_file_template) + say_verbose "Fallback zip path: $zip_path" + say "Downloading fallback link: $download_link" + download "$download_link" $zip_path || fallback_download_failed=true + fi + + say_verbose "valid_legacy_download_link: $valid_legacy_download_link" # if the download fails, download the legacy_download_link - if [ "$download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then + if [ "$fallback_download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then say "Cannot download: $download_link" download_link=$legacy_download_link zip_path=$(mktemp $temporary_file_template) @@ -682,7 +698,8 @@ install_dir="" architecture="" dry_run=false no_path=false -azure_feed="https://dotnetcli.azureedge.net/dotnet" +fallback_azure_feed="https://dotnetcli.azureedge.net/dotnet" +azure_feed="https://builds.dotnet.microsoft.com/dotnet" uncached_feed="https://dotnetcli.blob.core.windows.net/dotnet" verbose=false shared_runtime=false diff --git a/Tasks/DotNetCoreInstallerV0/task.json b/Tasks/DotNetCoreInstallerV0/task.json index 046e3a5f895f..aa6cf9daa266 100644 --- a/Tasks/DotNetCoreInstallerV0/task.json +++ b/Tasks/DotNetCoreInstallerV0/task.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 247, + "Minor": 250, "Patch": 0 }, "satisfies": [ diff --git a/Tasks/DotNetCoreInstallerV0/task.loc.json b/Tasks/DotNetCoreInstallerV0/task.loc.json index 3816182557f4..5e4b8b03541d 100644 --- a/Tasks/DotNetCoreInstallerV0/task.loc.json +++ b/Tasks/DotNetCoreInstallerV0/task.loc.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 247, + "Minor": 250, "Patch": 0 }, "satisfies": [ diff --git a/Tasks/UseDotNetV2/task.json b/Tasks/UseDotNetV2/task.json index 7ab9cc97a88b..b21a373796d7 100644 --- a/Tasks/UseDotNetV2/task.json +++ b/Tasks/UseDotNetV2/task.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 248, + "Minor": 250, "Patch": 0 }, "satisfies": [ diff --git a/Tasks/UseDotNetV2/task.loc.json b/Tasks/UseDotNetV2/task.loc.json index 65944cef02c9..940ae011119a 100644 --- a/Tasks/UseDotNetV2/task.loc.json +++ b/Tasks/UseDotNetV2/task.loc.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 248, + "Minor": 250, "Patch": 0 }, "satisfies": [ diff --git a/Tasks/UseDotNetV2/versioninstaller.ts b/Tasks/UseDotNetV2/versioninstaller.ts index 205fd968ca2d..a11a75d07576 100644 --- a/Tasks/UseDotNetV2/versioninstaller.ts +++ b/Tasks/UseDotNetV2/versioninstaller.ts @@ -38,10 +38,14 @@ export class VersionInstaller { var downloadPath = await toolLib.downloadToolWithRetries(downloadUrl) } catch (ex) { - tl.warning(tl.loc("CouldNotDownload", downloadUrl, ex)); - let fallBackUrl = `https://dotnetcli.azureedge.net/dotnet/${this.packageType === "runtime" ? "Runtime" : "Sdk"}/${version}/${downloadUrl.substring(downloadUrl.lastIndexOf('/') + 1)}`; - console.log("Using fallback url for download: " + fallBackUrl); - var downloadPath = await toolLib.downloadToolWithRetries(fallBackUrl) + let feedFallbackUrl = "https://builds.dotnet.microsoft.com/dotnet"; + try { + tl.warning(tl.loc("CouldNotDownload", downloadUrl, ex)); + var downloadPath = await this.downloadFromFallbackUrl(feedFallbackUrl, this.packageType, version, downloadUrl); + } catch(ex) { + tl.warning(tl.loc("CouldNotDownload", feedFallbackUrl, ex)); + var downloadPath = await this.downloadFromFallbackUrl("https://dotnetcli.azureedge.net/dotnet", this.packageType, version, downloadUrl); + } } // Extract @@ -176,6 +180,13 @@ export class VersionInstaller { throw tl.loc("FileNameNotCorrectCompleteFileName", name); } + private async downloadFromFallbackUrl(fallBackUrl: string, packageType: string, version: string, downloadUrl: string) : Promise { + let url = `${fallBackUrl}/${packageType === "runtime" ? "Runtime" : "Sdk"}/${version}/${downloadUrl.substring(downloadUrl.lastIndexOf('/') + 1)}`; + console.log("Using fallback url for download: " + url); + var downloadPath = await toolLib.downloadToolWithRetries(url) + return downloadPath; + } + private packageType: string; private installationPath: string; } \ No newline at end of file diff --git a/_generated/DotNetCoreInstallerV0.versionmap.txt b/_generated/DotNetCoreInstallerV0.versionmap.txt index 789c1d8a7110..c7bfaef441f8 100644 --- a/_generated/DotNetCoreInstallerV0.versionmap.txt +++ b/_generated/DotNetCoreInstallerV0.versionmap.txt @@ -1,2 +1,2 @@ -Default|0.247.0 -Node20_229_3|0.247.1 +Default|0.250.0 +Node20_229_3|0.250.1 diff --git a/_generated/DotNetCoreInstallerV0/externals/install-dotnet.ps1 b/_generated/DotNetCoreInstallerV0/externals/install-dotnet.ps1 index 85404535cc2e..2d45bd0ac5c9 100644 --- a/_generated/DotNetCoreInstallerV0/externals/install-dotnet.ps1 +++ b/_generated/DotNetCoreInstallerV0/externals/install-dotnet.ps1 @@ -47,7 +47,7 @@ .PARAMETER Verbose Displays diagnostics information. .PARAMETER AzureFeed - Default: https://dotnetcli.azureedge.net/dotnet + Default: https://builds.dotnet.microsoft.com/dotnet This parameter typically is not changed by the user. It allows to change URL for the Azure feed used by this installer. .PARAMETER UncachedFeed @@ -68,7 +68,8 @@ param( [switch]$SharedRuntime, [switch]$DryRun, [switch]$NoPath, - [string]$AzureFeed="https://dotnetcli.azureedge.net/dotnet", + [string]$AzureFeed="https://builds.dotnet.microsoft.com/dotnet", + [string]$FallbackAzureFeed="https://dotnetcli.azureedge.net/dotnet", [string]$UncachedFeed="https://dotnetcli.blob.core.windows.net/dotnet", [string]$ProxyAddress, [switch]$ProxyUseDefaultCredentials @@ -446,12 +447,14 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde $CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture $SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version $DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture +$FallbackDownloadLink = Get-Download-Link -AzureFeed $FallbackAzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture $LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture if ($DryRun) { Say "Payload URLs:" Say "Primary - $DownloadLink" Say "Legacy - $LegacyDownloadLink" + Say "Fallback - $FallbackDownloadLink" Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir" exit 0 } @@ -484,12 +487,21 @@ try { DownloadFile -Uri $DownloadLink -OutPath $ZipPath } catch { - Say "Cannot download: $DownloadLink" - $DownloadLink = $LegacyDownloadLink - $ZipPath = [System.IO.Path]::GetTempFileName() - Say-Verbose "Legacy zip path: $ZipPath" - Say "Downloading legacy link: $DownloadLink" - DownloadFile -Uri $DownloadLink -OutPath $ZipPath + try { + Say "Cannot download: $DownloadLink" + $DownloadLink = $FallbackDownloadLink + $ZipPath = [System.IO.Path]::GetTempFileName() + Say-Verbose "Fallabck zip path: $ZipPath" + Say "Downloading fallback link: $FallbackDownloadLink" + DownloadFile -Uri $FallbackDownloadLink -OutPath $ZipPath + } catch { + Say "Cannot download: $FallbackDownloadLink" + $DownloadLink = $LegacyDownloadLink + $ZipPath = [System.IO.Path]::GetTempFileName() + Say-Verbose "Legacy zip path: $ZipPath" + Say "Downloading legacy link: $DownloadLink" + DownloadFile -Uri $DownloadLink -OutPath $ZipPath + } } Say "Extracting zip from $DownloadLink" diff --git a/_generated/DotNetCoreInstallerV0/externals/install-dotnet.sh b/_generated/DotNetCoreInstallerV0/externals/install-dotnet.sh index 0ea08a77870a..c5f626f63289 100644 --- a/_generated/DotNetCoreInstallerV0/externals/install-dotnet.sh +++ b/_generated/DotNetCoreInstallerV0/externals/install-dotnet.sh @@ -628,6 +628,9 @@ calculate_vars() { download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version) say_verbose "download_link=$download_link" + fallback_download_link=$(construct_download_link $fallback_azure_feed $channel $normalized_architecture $specific_version) + say_verbose "fallback_download_link=$fallback_download_link" + legacy_download_link=$(construct_legacy_download_link $azure_feed $channel $normalized_architecture $specific_version) || valid_legacy_download_link=false if [ "$valid_legacy_download_link" = true ]; then @@ -643,6 +646,7 @@ calculate_vars() { install_dotnet() { eval $invocation local download_failed=false + local fallback_download_failed=false if is_dotnet_package_installed $install_root "sdk" $specific_version; then say ".NET SDK version $specific_version is already installed." @@ -656,8 +660,20 @@ install_dotnet() { say "Downloading link: $download_link" download "$download_link" $zip_path || download_failed=true + say_verbose "download_failed: $download_failed" + + if [ "$download_failed" = true ]; then + say "Cannot download: $download_link" + download_link=$fallback_download_link + zip_path=$(mktemp $temporary_file_template) + say_verbose "Fallback zip path: $zip_path" + say "Downloading fallback link: $download_link" + download "$download_link" $zip_path || fallback_download_failed=true + fi + + say_verbose "valid_legacy_download_link: $valid_legacy_download_link" # if the download fails, download the legacy_download_link - if [ "$download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then + if [ "$fallback_download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then say "Cannot download: $download_link" download_link=$legacy_download_link zip_path=$(mktemp $temporary_file_template) @@ -682,7 +698,8 @@ install_dir="" architecture="" dry_run=false no_path=false -azure_feed="https://dotnetcli.azureedge.net/dotnet" +fallback_azure_feed="https://dotnetcli.azureedge.net/dotnet" +azure_feed="https://builds.dotnet.microsoft.com/dotnet" uncached_feed="https://dotnetcli.blob.core.windows.net/dotnet" verbose=false shared_runtime=false diff --git a/_generated/DotNetCoreInstallerV0/task.json b/_generated/DotNetCoreInstallerV0/task.json index 2d75f80fed1c..a5085165f3e9 100644 --- a/_generated/DotNetCoreInstallerV0/task.json +++ b/_generated/DotNetCoreInstallerV0/task.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 247, + "Minor": 250, "Patch": 0 }, "satisfies": [ @@ -80,7 +80,8 @@ "UpdateToNewerVersion": "Kindly upgrade to new major version of this task 'Use .NET Core (2.*)' for installing newer versions of .NET Core. '0.*' task version might not be able to download newer .NET core versions. To know more about 'Use Dot Net (2.*)', refer https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops." }, "_buildConfigMapping": { - "Default": "0.247.0", - "Node20_229_3": "0.247.1" + "Default": "0.250.0", + "LocalPackages": "0.249.4", + "Node20_229_3": "0.250.1" } } \ No newline at end of file diff --git a/_generated/DotNetCoreInstallerV0/task.loc.json b/_generated/DotNetCoreInstallerV0/task.loc.json index 7c7d62c6c9d3..5b9eb65edd63 100644 --- a/_generated/DotNetCoreInstallerV0/task.loc.json +++ b/_generated/DotNetCoreInstallerV0/task.loc.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 247, + "Minor": 250, "Patch": 0 }, "satisfies": [ @@ -80,7 +80,8 @@ "UpdateToNewerVersion": "ms-resource:loc.messages.UpdateToNewerVersion" }, "_buildConfigMapping": { - "Default": "0.247.0", - "Node20_229_3": "0.247.1" + "Default": "0.250.0", + "LocalPackages": "0.249.4", + "Node20_229_3": "0.250.1" } } \ No newline at end of file diff --git a/_generated/DotNetCoreInstallerV0_Node20/.npmrc b/_generated/DotNetCoreInstallerV0_Node20/.npmrc index 5fca0d518be7..d5c7fef620a3 100644 --- a/_generated/DotNetCoreInstallerV0_Node20/.npmrc +++ b/_generated/DotNetCoreInstallerV0_Node20/.npmrc @@ -1 +1,5 @@ scripts-prepend-node-path=true + +registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ + +always-auth=true \ No newline at end of file diff --git a/_generated/DotNetCoreInstallerV0_Node20/externals/install-dotnet.ps1 b/_generated/DotNetCoreInstallerV0_Node20/externals/install-dotnet.ps1 index 85404535cc2e..2d45bd0ac5c9 100644 --- a/_generated/DotNetCoreInstallerV0_Node20/externals/install-dotnet.ps1 +++ b/_generated/DotNetCoreInstallerV0_Node20/externals/install-dotnet.ps1 @@ -47,7 +47,7 @@ .PARAMETER Verbose Displays diagnostics information. .PARAMETER AzureFeed - Default: https://dotnetcli.azureedge.net/dotnet + Default: https://builds.dotnet.microsoft.com/dotnet This parameter typically is not changed by the user. It allows to change URL for the Azure feed used by this installer. .PARAMETER UncachedFeed @@ -68,7 +68,8 @@ param( [switch]$SharedRuntime, [switch]$DryRun, [switch]$NoPath, - [string]$AzureFeed="https://dotnetcli.azureedge.net/dotnet", + [string]$AzureFeed="https://builds.dotnet.microsoft.com/dotnet", + [string]$FallbackAzureFeed="https://dotnetcli.azureedge.net/dotnet", [string]$UncachedFeed="https://dotnetcli.blob.core.windows.net/dotnet", [string]$ProxyAddress, [switch]$ProxyUseDefaultCredentials @@ -446,12 +447,14 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde $CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture $SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version $DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture +$FallbackDownloadLink = Get-Download-Link -AzureFeed $FallbackAzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture $LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture if ($DryRun) { Say "Payload URLs:" Say "Primary - $DownloadLink" Say "Legacy - $LegacyDownloadLink" + Say "Fallback - $FallbackDownloadLink" Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir" exit 0 } @@ -484,12 +487,21 @@ try { DownloadFile -Uri $DownloadLink -OutPath $ZipPath } catch { - Say "Cannot download: $DownloadLink" - $DownloadLink = $LegacyDownloadLink - $ZipPath = [System.IO.Path]::GetTempFileName() - Say-Verbose "Legacy zip path: $ZipPath" - Say "Downloading legacy link: $DownloadLink" - DownloadFile -Uri $DownloadLink -OutPath $ZipPath + try { + Say "Cannot download: $DownloadLink" + $DownloadLink = $FallbackDownloadLink + $ZipPath = [System.IO.Path]::GetTempFileName() + Say-Verbose "Fallabck zip path: $ZipPath" + Say "Downloading fallback link: $FallbackDownloadLink" + DownloadFile -Uri $FallbackDownloadLink -OutPath $ZipPath + } catch { + Say "Cannot download: $FallbackDownloadLink" + $DownloadLink = $LegacyDownloadLink + $ZipPath = [System.IO.Path]::GetTempFileName() + Say-Verbose "Legacy zip path: $ZipPath" + Say "Downloading legacy link: $DownloadLink" + DownloadFile -Uri $DownloadLink -OutPath $ZipPath + } } Say "Extracting zip from $DownloadLink" diff --git a/_generated/DotNetCoreInstallerV0_Node20/externals/install-dotnet.sh b/_generated/DotNetCoreInstallerV0_Node20/externals/install-dotnet.sh index 0ea08a77870a..c5f626f63289 100644 --- a/_generated/DotNetCoreInstallerV0_Node20/externals/install-dotnet.sh +++ b/_generated/DotNetCoreInstallerV0_Node20/externals/install-dotnet.sh @@ -628,6 +628,9 @@ calculate_vars() { download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version) say_verbose "download_link=$download_link" + fallback_download_link=$(construct_download_link $fallback_azure_feed $channel $normalized_architecture $specific_version) + say_verbose "fallback_download_link=$fallback_download_link" + legacy_download_link=$(construct_legacy_download_link $azure_feed $channel $normalized_architecture $specific_version) || valid_legacy_download_link=false if [ "$valid_legacy_download_link" = true ]; then @@ -643,6 +646,7 @@ calculate_vars() { install_dotnet() { eval $invocation local download_failed=false + local fallback_download_failed=false if is_dotnet_package_installed $install_root "sdk" $specific_version; then say ".NET SDK version $specific_version is already installed." @@ -656,8 +660,20 @@ install_dotnet() { say "Downloading link: $download_link" download "$download_link" $zip_path || download_failed=true + say_verbose "download_failed: $download_failed" + + if [ "$download_failed" = true ]; then + say "Cannot download: $download_link" + download_link=$fallback_download_link + zip_path=$(mktemp $temporary_file_template) + say_verbose "Fallback zip path: $zip_path" + say "Downloading fallback link: $download_link" + download "$download_link" $zip_path || fallback_download_failed=true + fi + + say_verbose "valid_legacy_download_link: $valid_legacy_download_link" # if the download fails, download the legacy_download_link - if [ "$download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then + if [ "$fallback_download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then say "Cannot download: $download_link" download_link=$legacy_download_link zip_path=$(mktemp $temporary_file_template) @@ -682,7 +698,8 @@ install_dir="" architecture="" dry_run=false no_path=false -azure_feed="https://dotnetcli.azureedge.net/dotnet" +fallback_azure_feed="https://dotnetcli.azureedge.net/dotnet" +azure_feed="https://builds.dotnet.microsoft.com/dotnet" uncached_feed="https://dotnetcli.blob.core.windows.net/dotnet" verbose=false shared_runtime=false diff --git a/_generated/DotNetCoreInstallerV0_Node20/task.json b/_generated/DotNetCoreInstallerV0_Node20/task.json index 941daee8cdab..a548d9eaa046 100644 --- a/_generated/DotNetCoreInstallerV0_Node20/task.json +++ b/_generated/DotNetCoreInstallerV0_Node20/task.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 247, + "Minor": 250, "Patch": 1 }, "satisfies": [ @@ -84,7 +84,8 @@ "UpdateToNewerVersion": "Kindly upgrade to new major version of this task 'Use .NET Core (2.*)' for installing newer versions of .NET Core. '0.*' task version might not be able to download newer .NET core versions. To know more about 'Use Dot Net (2.*)', refer https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops." }, "_buildConfigMapping": { - "Default": "0.247.0", - "Node20_229_3": "0.247.1" + "Default": "0.250.0", + "LocalPackages": "0.249.4", + "Node20_229_3": "0.250.1" } } \ No newline at end of file diff --git a/_generated/DotNetCoreInstallerV0_Node20/task.loc.json b/_generated/DotNetCoreInstallerV0_Node20/task.loc.json index 4e6de75afee6..be1eb7129e4c 100644 --- a/_generated/DotNetCoreInstallerV0_Node20/task.loc.json +++ b/_generated/DotNetCoreInstallerV0_Node20/task.loc.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 0, - "Minor": 247, + "Minor": 250, "Patch": 1 }, "satisfies": [ @@ -84,7 +84,8 @@ "UpdateToNewerVersion": "ms-resource:loc.messages.UpdateToNewerVersion" }, "_buildConfigMapping": { - "Default": "0.247.0", - "Node20_229_3": "0.247.1" + "Default": "0.250.0", + "LocalPackages": "0.249.4", + "Node20_229_3": "0.250.1" } } \ No newline at end of file diff --git a/_generated/UseDotNetV2.versionmap.txt b/_generated/UseDotNetV2.versionmap.txt index 25a4e874bc74..9059947d0705 100644 --- a/_generated/UseDotNetV2.versionmap.txt +++ b/_generated/UseDotNetV2.versionmap.txt @@ -1,2 +1,2 @@ -Default|2.248.0 -Node20_229_3|2.248.1 +Default|2.250.0 +Node20_229_3|2.250.1 diff --git a/_generated/UseDotNetV2/task.json b/_generated/UseDotNetV2/task.json index bdaeab8ae0c5..b9928c34b22c 100644 --- a/_generated/UseDotNetV2/task.json +++ b/_generated/UseDotNetV2/task.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 248, + "Minor": 250, "Patch": 0 }, "satisfies": [ @@ -203,7 +203,8 @@ "DepricatedVersionNetCore": "NET Core version you specfied %s is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy." }, "_buildConfigMapping": { - "Default": "2.248.0", - "Node20_229_3": "2.248.1" + "Default": "2.250.0", + "LocalPackages": "2.249.4", + "Node20_229_3": "2.250.1" } } \ No newline at end of file diff --git a/_generated/UseDotNetV2/task.loc.json b/_generated/UseDotNetV2/task.loc.json index bdbc4ecd92ad..c289ae7754cb 100644 --- a/_generated/UseDotNetV2/task.loc.json +++ b/_generated/UseDotNetV2/task.loc.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 248, + "Minor": 250, "Patch": 0 }, "satisfies": [ @@ -203,7 +203,8 @@ "DepricatedVersionNetCore": "ms-resource:loc.messages.DepricatedVersionNetCore" }, "_buildConfigMapping": { - "Default": "2.248.0", - "Node20_229_3": "2.248.1" + "Default": "2.250.0", + "LocalPackages": "2.249.4", + "Node20_229_3": "2.250.1" } } \ No newline at end of file diff --git a/_generated/UseDotNetV2/versioninstaller.ts b/_generated/UseDotNetV2/versioninstaller.ts index 205fd968ca2d..a11a75d07576 100644 --- a/_generated/UseDotNetV2/versioninstaller.ts +++ b/_generated/UseDotNetV2/versioninstaller.ts @@ -38,10 +38,14 @@ export class VersionInstaller { var downloadPath = await toolLib.downloadToolWithRetries(downloadUrl) } catch (ex) { - tl.warning(tl.loc("CouldNotDownload", downloadUrl, ex)); - let fallBackUrl = `https://dotnetcli.azureedge.net/dotnet/${this.packageType === "runtime" ? "Runtime" : "Sdk"}/${version}/${downloadUrl.substring(downloadUrl.lastIndexOf('/') + 1)}`; - console.log("Using fallback url for download: " + fallBackUrl); - var downloadPath = await toolLib.downloadToolWithRetries(fallBackUrl) + let feedFallbackUrl = "https://builds.dotnet.microsoft.com/dotnet"; + try { + tl.warning(tl.loc("CouldNotDownload", downloadUrl, ex)); + var downloadPath = await this.downloadFromFallbackUrl(feedFallbackUrl, this.packageType, version, downloadUrl); + } catch(ex) { + tl.warning(tl.loc("CouldNotDownload", feedFallbackUrl, ex)); + var downloadPath = await this.downloadFromFallbackUrl("https://dotnetcli.azureedge.net/dotnet", this.packageType, version, downloadUrl); + } } // Extract @@ -176,6 +180,13 @@ export class VersionInstaller { throw tl.loc("FileNameNotCorrectCompleteFileName", name); } + private async downloadFromFallbackUrl(fallBackUrl: string, packageType: string, version: string, downloadUrl: string) : Promise { + let url = `${fallBackUrl}/${packageType === "runtime" ? "Runtime" : "Sdk"}/${version}/${downloadUrl.substring(downloadUrl.lastIndexOf('/') + 1)}`; + console.log("Using fallback url for download: " + url); + var downloadPath = await toolLib.downloadToolWithRetries(url) + return downloadPath; + } + private packageType: string; private installationPath: string; } \ No newline at end of file diff --git a/_generated/UseDotNetV2_Node20/.npmrc b/_generated/UseDotNetV2_Node20/.npmrc index 5fca0d518be7..d5c7fef620a3 100644 --- a/_generated/UseDotNetV2_Node20/.npmrc +++ b/_generated/UseDotNetV2_Node20/.npmrc @@ -1 +1,5 @@ scripts-prepend-node-path=true + +registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/ + +always-auth=true \ No newline at end of file diff --git a/_generated/UseDotNetV2_Node20/task.json b/_generated/UseDotNetV2_Node20/task.json index b9bce65efa70..2240b845f86f 100644 --- a/_generated/UseDotNetV2_Node20/task.json +++ b/_generated/UseDotNetV2_Node20/task.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 248, + "Minor": 250, "Patch": 1 }, "satisfies": [ @@ -207,7 +207,8 @@ "DepricatedVersionNetCore": "NET Core version you specfied %s is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy." }, "_buildConfigMapping": { - "Default": "2.248.0", - "Node20_229_3": "2.248.1" + "Default": "2.250.0", + "LocalPackages": "2.249.4", + "Node20_229_3": "2.250.1" } } \ No newline at end of file diff --git a/_generated/UseDotNetV2_Node20/task.loc.json b/_generated/UseDotNetV2_Node20/task.loc.json index f012e197d3a9..22f447a116c5 100644 --- a/_generated/UseDotNetV2_Node20/task.loc.json +++ b/_generated/UseDotNetV2_Node20/task.loc.json @@ -13,7 +13,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 248, + "Minor": 250, "Patch": 1 }, "satisfies": [ @@ -207,7 +207,8 @@ "DepricatedVersionNetCore": "ms-resource:loc.messages.DepricatedVersionNetCore" }, "_buildConfigMapping": { - "Default": "2.248.0", - "Node20_229_3": "2.248.1" + "Default": "2.250.0", + "LocalPackages": "2.249.4", + "Node20_229_3": "2.250.1" } } \ No newline at end of file diff --git a/_generated/UseDotNetV2_Node20/versioninstaller.ts b/_generated/UseDotNetV2_Node20/versioninstaller.ts index 205fd968ca2d..a11a75d07576 100644 --- a/_generated/UseDotNetV2_Node20/versioninstaller.ts +++ b/_generated/UseDotNetV2_Node20/versioninstaller.ts @@ -38,10 +38,14 @@ export class VersionInstaller { var downloadPath = await toolLib.downloadToolWithRetries(downloadUrl) } catch (ex) { - tl.warning(tl.loc("CouldNotDownload", downloadUrl, ex)); - let fallBackUrl = `https://dotnetcli.azureedge.net/dotnet/${this.packageType === "runtime" ? "Runtime" : "Sdk"}/${version}/${downloadUrl.substring(downloadUrl.lastIndexOf('/') + 1)}`; - console.log("Using fallback url for download: " + fallBackUrl); - var downloadPath = await toolLib.downloadToolWithRetries(fallBackUrl) + let feedFallbackUrl = "https://builds.dotnet.microsoft.com/dotnet"; + try { + tl.warning(tl.loc("CouldNotDownload", downloadUrl, ex)); + var downloadPath = await this.downloadFromFallbackUrl(feedFallbackUrl, this.packageType, version, downloadUrl); + } catch(ex) { + tl.warning(tl.loc("CouldNotDownload", feedFallbackUrl, ex)); + var downloadPath = await this.downloadFromFallbackUrl("https://dotnetcli.azureedge.net/dotnet", this.packageType, version, downloadUrl); + } } // Extract @@ -176,6 +180,13 @@ export class VersionInstaller { throw tl.loc("FileNameNotCorrectCompleteFileName", name); } + private async downloadFromFallbackUrl(fallBackUrl: string, packageType: string, version: string, downloadUrl: string) : Promise { + let url = `${fallBackUrl}/${packageType === "runtime" ? "Runtime" : "Sdk"}/${version}/${downloadUrl.substring(downloadUrl.lastIndexOf('/') + 1)}`; + console.log("Using fallback url for download: " + url); + var downloadPath = await toolLib.downloadToolWithRetries(url) + return downloadPath; + } + private packageType: string; private installationPath: string; } \ No newline at end of file