Skip to content

Commit 90d0799

Browse files
committed
Merged PR 41167: Temporarily work around '/' in dSAS
Temporarily work around '/' in dSAS When dSAS tokens contain a forward /, helix will incorrectly name the file target for a correlation payload, and then fail to unpack it. ---- #### AI description (iteration 1) #### PR Classification Bug fix to address an issue with SAS tokens containing '/' causing incorrect downloads. #### PR Summary This pull request implements a workaround for a Helix issue where SAS tokens with '/' result in incorrect downloads of correlation payloads. - `eng/common/templates-official/steps/get-delegation-sas.yml`: Added a loop to regenerate SAS tokens until one without '/' is obtained.
1 parent e7f0165 commit 90d0799

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

eng/common/templates-official/steps/get-delegation-sas.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,17 @@ steps:
2828
# Calculate the expiration of the SAS token and convert to UTC
2929
$expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
3030
31-
$sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv
31+
# Temporarily work around a helix issue where SAS tokens with / in them will cause incorrect downloads
32+
# of correlation payloads.
33+
$sas = ""
34+
do {
35+
$sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv
3236
33-
if ($LASTEXITCODE -ne 0) {
34-
Write-Error "Failed to generate SAS token."
35-
exit 1
36-
}
37+
if ($LASTEXITCODE -ne 0) {
38+
Write-Error "Failed to generate SAS token."
39+
exit 1
40+
}
41+
} while($sas.IndexOf('/') -ne -1)
3742
3843
if ('${{ parameters.base64Encode }}' -eq 'true') {
3944
$sas = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($sas))

0 commit comments

Comments
 (0)