From 4eba6f303bee6bcb208c2ede99e2a614081d6cc8 Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Tue, 21 May 2024 10:13:40 -0700 Subject: [PATCH 1/3] Remove SAS token usage from apiview-sync-staging --- src/dotnet/APIView/apiview-sync-staging.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/dotnet/APIView/apiview-sync-staging.yml b/src/dotnet/APIView/apiview-sync-staging.yml index 02bdff56acd..416782efc2f 100644 --- a/src/dotnet/APIView/apiview-sync-staging.yml +++ b/src/dotnet/APIView/apiview-sync-staging.yml @@ -24,13 +24,21 @@ stages: displayName: Download and Extract azcopy Zip - ${{ each c in parameters.containers }}: - - pwsh: | - $azcopy = $(Resolve-Path "$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe")[0] - $sourceUrl = "https://$(apiview-prod-storageaccount).blob.core.windows.net/${{c}}$(apiview-production-storage-sas)" - $destUrl = "https://$(apiview-staging-storageaccount).blob.core.windows.net/${{c}}$(apiview-staging-storage-sas)" - &($azcopy) sc $sourceUrl $destUrl --recursive=true - workingDirectory: $(Build.BinariesDirectory) + - task: AzurePowerShell@5 displayName: Copy Blobs in ${{c}} + workingDirectory: $(Build.BinariesDirectory) + inputs: + azureSubscription: 'Azure SDK Engineering System' + ScriptType: 'InlineScript' + azurePowerShellVersion: LatestVersion + pwsh: true + Inline: | + $azcopy = $(Resolve-Path "$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe")[0] + $sourceUrl = "https://$(apiview-prod-storageaccount).blob.core.windows.net/${{c}}$(apiview-production-storage-sas)" + $destUrl = "https://$(apiview-staging-storageaccount).blob.core.windows.net/${{c}}$(apiview-staging-storage-sas)" + &($azcopy) sc $sourceUrl $destUrl --recursive=true + env: + AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED' - task: UsePythonVersion@0 displayName: 'Use Python 3.6' From 0faaaad1f0963021aceff75a017ed499a8e5e65c Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Tue, 21 May 2024 10:26:10 -0700 Subject: [PATCH 2/3] No, seriously, remove the SAS from the URLs --- src/dotnet/APIView/apiview-sync-staging.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dotnet/APIView/apiview-sync-staging.yml b/src/dotnet/APIView/apiview-sync-staging.yml index 416782efc2f..5b5b501c260 100644 --- a/src/dotnet/APIView/apiview-sync-staging.yml +++ b/src/dotnet/APIView/apiview-sync-staging.yml @@ -34,8 +34,8 @@ stages: pwsh: true Inline: | $azcopy = $(Resolve-Path "$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe")[0] - $sourceUrl = "https://$(apiview-prod-storageaccount).blob.core.windows.net/${{c}}$(apiview-production-storage-sas)" - $destUrl = "https://$(apiview-staging-storageaccount).blob.core.windows.net/${{c}}$(apiview-staging-storage-sas)" + $sourceUrl = "https://$(apiview-prod-storageaccount).blob.core.windows.net/${{c}}" + $destUrl = "https://$(apiview-staging-storageaccount).blob.core.windows.net/${{c}}" &($azcopy) sc $sourceUrl $destUrl --recursive=true env: AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED' From 2f86b40e672253feeb9222f45640ae208d1d65f1 Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Tue, 21 May 2024 10:29:04 -0700 Subject: [PATCH 3/3] workingDirectory needs to be under inputs --- src/dotnet/APIView/apiview-sync-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotnet/APIView/apiview-sync-staging.yml b/src/dotnet/APIView/apiview-sync-staging.yml index 5b5b501c260..9ab4033a893 100644 --- a/src/dotnet/APIView/apiview-sync-staging.yml +++ b/src/dotnet/APIView/apiview-sync-staging.yml @@ -26,11 +26,11 @@ stages: - ${{ each c in parameters.containers }}: - task: AzurePowerShell@5 displayName: Copy Blobs in ${{c}} - workingDirectory: $(Build.BinariesDirectory) inputs: azureSubscription: 'Azure SDK Engineering System' ScriptType: 'InlineScript' azurePowerShellVersion: LatestVersion + workingDirectory: $(Build.BinariesDirectory) pwsh: true Inline: | $azcopy = $(Resolve-Path "$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe")[0]