Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions eng/common/scripts/Set-VcpkgWriteModeCache.ps1
Original file line number Diff line number Diff line change
@@ -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 `
Expand All @@ -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"
Expand Down
Loading