parameters:
  FolderForUpload: ''
  TargetLanguage: ''
  BlobName: '' # To be removed once all usages are removed in the languages
  BlobAccountName: 'https://azuresdkdocs.blob.core.windows.net'
  ScriptPath: 'eng/common/scripts/copy-docs-to-blobstorage.ps1'
  ArtifactLocation: ''
  RepoId: $(Build.Repository.Name)

steps:
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml

- task: AzurePowerShell@5
  displayName: 'Copy Docs to Blob Storage'
  continueOnError: false
  inputs:
    azureSubscription: 'Azure SDK Artifacts'
    ScriptType: 'FilePath'
    ScriptPath: ${{ parameters.ScriptPath }}
    ScriptArguments: >
      -DocLocation "${{ parameters.FolderForUpload }}"
      -BlobAccountName "${{ parameters.BlobAccountName }}"
      -PublicArtifactLocation "${{ parameters.ArtifactLocation }}"
      -RepoReplaceRegex "(https://github.com/${{ parameters.RepoId }}/(?:blob|tree)/)$(DefaultBranch)"
    azurePowerShellVersion: latestVersion
    pwsh: true
  env:
    AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED'
