From 57290353089581e3d936bdf5eda293192a04ea26 Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Thu, 3 Oct 2024 18:38:41 -0700 Subject: [PATCH] Use DotNetStaging service connection credentials to gather drop (#7410) --- eng/pipelines/stages/preparerelease.yml | 25 +------------------------ eng/release/Scripts/AcquireBuild.ps1 | 5 ++--- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/eng/pipelines/stages/preparerelease.yml b/eng/pipelines/stages/preparerelease.yml index 4ae175a1142..2fab2d7e469 100644 --- a/eng/pipelines/stages/preparerelease.yml +++ b/eng/pipelines/stages/preparerelease.yml @@ -49,39 +49,16 @@ stages: -BarId $(BARBuildId) -TaskVariableName 'BuildVersion' - # Populate dotnetbuilds-internal-container-read-token - - template: /eng/common/templates-official/steps/get-delegation-sas.yml - parameters: - federatedServiceConnection: 'dotnetbuilds-internal-read' - outputVariableName: 'dotnetbuilds-internal-checksums-container-read-token' - expiryInHours: 1 - base64Encode: false - storageAccount: dotnetbuilds - container: internal-checksums - permissions: rl - - # Populate dotnetbuilds-internal-container-read-token - - template: /eng/common/templates-official/steps/get-delegation-sas.yml - parameters: - federatedServiceConnection: 'dotnetbuilds-internal-read' - outputVariableName: 'dotnetbuilds-internal-container-read-token' - expiryInHours: 1 - base64Encode: false - storageAccount: dotnetbuilds - container: internal - permissions: rl - - task: AzureCLI@2 displayName: 'Download Build Assets' inputs: - azureSubscription: 'Darc: Maestro Production' + azureSubscription: 'DotNetStaging' scriptType: ps scriptPath: '$(Build.Repository.LocalPath)/eng/release/Scripts/AcquireBuild.ps1' arguments: >- -BarBuildId "$(BARBuildId)" -AzdoToken "$(dn-bot-all-drop-rw-code-rw-release-all)" -DownloadTargetPath "$(System.ArtifactsDirectory)\BuildAssets" - -SasSuffixes "$(dotnetbuilds-internal-checksums-container-read-token),$(dotnetbuilds-internal-container-read-token)" -ReleaseVersion "$(Build.BuildNumber)" workingDirectory: '$(Build.Repository.LocalPath)' continueOnError: true diff --git a/eng/release/Scripts/AcquireBuild.ps1 b/eng/release/Scripts/AcquireBuild.ps1 index 220c6ff13fd..71382e413a6 100644 --- a/eng/release/Scripts/AcquireBuild.ps1 +++ b/eng/release/Scripts/AcquireBuild.ps1 @@ -2,7 +2,6 @@ param( [Parameter(Mandatory=$true)][int] $BarBuildId, [Parameter(Mandatory=$true)][string] $ReleaseVersion, [Parameter(Mandatory=$true)][string] $DownloadTargetPath, - [Parameter(Mandatory=$true)][string] $SasSuffixes, [Parameter(Mandatory=$true)][string] $AzdoToken, [Parameter(Mandatory=$false)][string] $DarcVersion = $null, [Parameter(Mandatory=$false)][bool] $Separated = $true, @@ -14,7 +13,6 @@ function Write-Help() { Write-Host " -BarBuildId BAR Build ID of the diagnostics build to publish." Write-Host " -ReleaseVersion Name to give the diagnostics release." Write-Host " -DownloadTargetPath Path to download the build to." - Write-Host " -SasSuffixes Comma separated list of potential uri suffixes that can be used if anonymous access to a blob uri fails. Appended directly to the end of the URI. Use full SAS syntax with ?." Write-Host " -AzdoToken Azure DevOps token to use for builds queries" Write-Host " -Separated <`$true|`$false> Download files to their repo separated locations." Write-Host "" @@ -55,11 +53,12 @@ try { --release-name $ReleaseVersion ` --output-dir $DownloadTargetPath ` --overwrite ` - --sas-suffixes $SasSuffixes ` + --use-azure-credential-for-blobs ` --azdev-pat $AzdoToken ` --verbose ` --continue-on-error ` --ci ` + --verbose ` $separatedArgs if ($LastExitCode -ne 0) {