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 <djurek@microsoft.com>
This commit is contained in:
Azure SDK Bot 2025-10-16 20:52:53 -07:00 committed by GitHub
parent 9023c03ee8
commit f0b5bfd684
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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"