diff --git a/eng/pipelines/templates/steps/apiview-review-gen.yml b/eng/pipelines/templates/steps/apiview-review-gen.yml index fad2705a3c3..a2ac6035571 100644 --- a/eng/pipelines/templates/steps/apiview-review-gen.yml +++ b/eng/pipelines/templates/steps/apiview-review-gen.yml @@ -1,7 +1,7 @@ parameters: - name: Reviews type: string - default: '' + default: '' - name: APIViewURL type: string default: '' @@ -16,19 +16,23 @@ parameters: default: '' steps: -- task: Powershell@2 +- task: AzurePowerShell@5 displayName: 'Generate APIView Token files' inputs: - pwsh: true - filePath: $(Build.SourcesDirectory)/eng/scripts/Create-Apiview-Token-Files.ps1 - arguments: > + azureSubscription: 'Azure SDK Engineering System' + ScriptType: 'FilePath' + ScriptPath: $(Build.SourcesDirectory)/eng/scripts/Create-Apiview-Token-Files.ps1 + ScriptArguments: > -ReviewDetailsJson "${{ parameters.Reviews }}" -StagingPath "$(Build.ArtifactStagingDirectory)" -WorkingDir "$(Pipeline.Workspace)" -StorageBaseUrl "${{ parameters.StorageContainerUrl }}" -ApiviewGenScript "${{ parameters.ApiviewGenScript }}" - -ContainerSas "$(apiview-originals-sas)" -ParserPath "${{ parameters.ParserPath }}" + azurePowerShellVersion: latestVersion + pwsh: true + env: + AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED' - task: PublishBuildArtifacts@1 inputs: diff --git a/eng/scripts/Create-Apiview-Token-Files.ps1 b/eng/scripts/Create-Apiview-Token-Files.ps1 index f76a1fb5c3e..bc5e249bd0e 100644 --- a/eng/scripts/Create-Apiview-Token-Files.ps1 +++ b/eng/scripts/Create-Apiview-Token-Files.ps1 @@ -9,8 +9,6 @@ param ( [Parameter(Mandatory = $true)] [string]$StorageBaseUrl, [Parameter(Mandatory = $true)] - [string]$ContainerSas, - [Parameter(Mandatory = $true)] [string]$ApiviewGenScript, [string]$ParserPath = "" ) @@ -28,7 +26,7 @@ if ($reviews -ne $null) $pkgWorkingDir = Join-Path -Path $WorkingDir $r.ReviewID | Join-Path -ChildPath $r.RevisionID $codeDir = New-Item -Path $pkgWorkingDir -ItemType Directory - $sourcePath = $StorageBaseUrl + "/" + $r.FileID + "?"+ $ContainerSas + $sourcePath = $StorageBaseUrl + "/" + $r.FileID Write-Host "Copying $($sourcePath)" azcopy cp "$sourcePath" $codeDir/$($r.FileName) --recursive=true