Search code examples
authenticationnuget-package-restoreazure-artifacts

Can not restore nuget package from private Azure Artifact on mac OS


Everything works well on windows:

  1. Publish nuget packages to my private Azure Artifact
  2. Log in my account into Visual Studio 2019
  3. Config my private feed in my project
  4. Restore my project
  5. It automatically authenticates my account since I already logged in in step 2

But when I using mac OS(visual studio 2019): I always failed at step 5 with error: 401 Unauthorized

Is there any command to check the current status of my account or login into Visual?

Note: My Microsoft account using 2FA


Solution

  • Had the same problem and fixed it with OP's solution. Here are the steps I took:

    • Create PAT in Azure Devops.
    • Open solution that uses a private nuget.
    • Restore nugets and get prompted login and password.
    • Use Devops-account email as username and PAT as password.