Skip to content

Commit 1e2884d

Browse files
authored
Remove SAS token usage from apiview-sync-staging (#8311)
* Remove SAS token usage from apiview-sync-staging * No, seriously, remove the SAS from the URLs * workingDirectory needs to be under inputs
1 parent d5b8343 commit 1e2884d

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

src/dotnet/APIView/apiview-sync-staging.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,21 @@ stages:
2424
displayName: Download and Extract azcopy Zip
2525
2626
- ${{ each c in parameters.containers }}:
27-
- pwsh: |
28-
$azcopy = $(Resolve-Path "$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe")[0]
29-
$sourceUrl = "https://$(apiview-prod-storageaccount).blob.core.windows.net/${{c}}$(apiview-production-storage-sas)"
30-
$destUrl = "https://$(apiview-staging-storageaccount).blob.core.windows.net/${{c}}$(apiview-staging-storage-sas)"
31-
&($azcopy) sc $sourceUrl $destUrl --recursive=true
32-
workingDirectory: $(Build.BinariesDirectory)
27+
- task: AzurePowerShell@5
3328
displayName: Copy Blobs in ${{c}}
29+
inputs:
30+
azureSubscription: 'Azure SDK Engineering System'
31+
ScriptType: 'InlineScript'
32+
azurePowerShellVersion: LatestVersion
33+
workingDirectory: $(Build.BinariesDirectory)
34+
pwsh: true
35+
Inline: |
36+
$azcopy = $(Resolve-Path "$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe")[0]
37+
$sourceUrl = "https://$(apiview-prod-storageaccount).blob.core.windows.net/${{c}}"
38+
$destUrl = "https://$(apiview-staging-storageaccount).blob.core.windows.net/${{c}}"
39+
&($azcopy) sc $sourceUrl $destUrl --recursive=true
40+
env:
41+
AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED'
3442

3543
- task: UsePythonVersion@0
3644
displayName: 'Use Python 3.6'

0 commit comments

Comments
 (0)