title: Best way to authenticate in Azure DevOps YAML pipeline to access my Azure DevOps package feed (used by Paket commands)
body: <p>When calling Paket install via a command line step the script issues an unauthorized exception (401) when trying to access my Azure DevOps package feed (with upstream sources).</p>
  
  <p>Running the build steps on my local system works using the Git Credentials Manager to login and authenticate for resolving and publishing packages via my Azure DevOps package feed.</p>
  
  <p>I am aiming at a solution in which I do not have to specify the plain user name and password in the Azure DevOps Yaml script file.
  So far I have tried to authenticate via a private access token using the "az devops login" command but until now I failed to get it running.</p>
  
  <p>I also read about Azure DevOps "Service connections" but this seems to be overkill for my problem.</p>
  
  <p>Yaml script without authentication logic:</p>
  
  <pre><code>trigger:
  - develop
  
  pool:
    vmImage: 'windows-latest'
  
  variables:
    solution: './*.sln'
    buildPlatform: 'Any CPU'
    buildConfiguration: 'Release'
  
  steps:
  - task: NuGetToolInstaller@1
  
  - task: CmdLine@2
    inputs:
      script: 'InstallPackages.cmd'
  
  - task: NuGetCommand@2
    inputs:
      restoreSolution: '$(solution)'
  
  - task: VSBuild@1
    inputs:
      solution: '$(solution)'
      platform: '$(buildPlatform)'
      configuration: '$(buildConfiguration)'
  
  - task: VSTest@2
    inputs:
      platform: '$(buildPlatform)'
      configuration: '$(buildConfiguration)'
  </code></pre>
  
  <pre><code>Paket version 5.215.0
  Resolving packages for group Main:
  Performance:
   - Resolver: 544 milliseconds (1 runs)
      - Runtime: 111 milliseconds
      - Blocked (retrieving package versions): 433 milliseconds (1 times)
   - Average Request Time: 57 milliseconds
   - Number of Requests: 4
   - Runtime: 1 second
  Paket failed with
  -&gt; Unable to retrieve package versions for 'Microsoft.VisualStudio.Threading.Analyzers'
  ...
  -&gt; Could not load resources from 'https://worues.pkgs.visualstudio.com/_packaging/Fact4CoreFeed/nuget/v3/index.json': Unauthorized (401)
  </code></pre>