From f0b5bfd68411a9c25f65f6435b226c98f6b68425 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 16 Oct 2025 20:52:53 -0700 Subject: [PATCH] Set-VcpkgWriteModeCache -- add token timeout param for cmake generate's that exceed 1 hour (this can happen in C++ API View) (#6796) Co-authored-by: Daniel Jurek --- .../pipelines/templates/steps/set-vcpkg-cache-vars.yml | 7 +++++++ eng/common/scripts/Set-VcpkgWriteModeCache.ps1 | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/eng/common/pipelines/templates/steps/set-vcpkg-cache-vars.yml b/eng/common/pipelines/templates/steps/set-vcpkg-cache-vars.yml index 7ba4d9018..c7ece396e 100644 --- a/eng/common/pipelines/templates/steps/set-vcpkg-cache-vars.yml +++ b/eng/common/pipelines/templates/steps/set-vcpkg-cache-vars.yml @@ -1,3 +1,9 @@ + +parameters: + - name: TokenTimeoutInHours + type: number + default: 1 + steps: - pwsh: | Write-Host "Setting vcpkg cache variables for read only access to vcpkg binary and asset caches" @@ -12,6 +18,7 @@ steps: azureSubscription: 'Azure SDK Artifacts' ScriptType: FilePath ScriptPath: eng/common/scripts/Set-VcpkgWriteModeCache.ps1 + ScriptArguments: -TokenTimeoutInHours ${{ parameters.TokenTimeoutInHours }} azurePowerShellVersion: LatestVersion pwsh: true # This step is idempotent and can be run multiple times in cases of diff --git a/eng/common/scripts/Set-VcpkgWriteModeCache.ps1 b/eng/common/scripts/Set-VcpkgWriteModeCache.ps1 index 51bfab05c..37bca9001 100755 --- a/eng/common/scripts/Set-VcpkgWriteModeCache.ps1 +++ b/eng/common/scripts/Set-VcpkgWriteModeCache.ps1 @@ -1,7 +1,8 @@ #!/bin/env pwsh param( [string] $StorageAccountName = 'azuresdkartifacts', - [string] $StorageContainerName = 'public-vcpkg-container' + [string] $StorageContainerName = 'public-vcpkg-container', + [int] $TokenTimeoutInHours = 1 ) $ctx = New-AzStorageContext ` @@ -12,7 +13,7 @@ $vcpkgBinarySourceSas = New-AzStorageContainerSASToken ` -Name $StorageContainerName ` -Permission "rwcl" ` -Context $ctx ` - -ExpiryTime (Get-Date).AddHours(1) + -ExpiryTime (Get-Date).AddHours($TokenTimeoutInHours) # Ensure redaction of SAS tokens in logs Write-Host "##vso[task.setvariable variable=VCPKG_BINARY_SAS_TOKEN;issecret=true;]$vcpkgBinarySourceSas"