0

I have created a nuget server project.

nuget/hosting-packages/nuget-server

and published it as an Azure App Service. So far, everything has worked fine. I added the server to Visual Studio and pushed some libraries to the server.

The NuGet.Server Azure App Service and the NuGet-server Package source in Visual Studio require a single-tenant login.

I have created a Microsoft identity provider to enable App Service Authentication with a redirect to Microsoft, which returns HTTP 302 Found for unauthorized requests. This works fine for the App Service.

In Visual Studio Professional, after adding the package source https://xxxx.azurewebsites.net/nuget

I get a login prompt for login credentials where i have inserted my company's Microsoft account details. 

which results in the following error:

[AzureNugetServer] The V2 feed at 'https://xxxxxx.azurewebsites.net/nuget/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net5.0'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '401 Unauthorized'.

Is it possible to use Microsoft single tenant to connect the NuGet server in Visual Studio, did I do something wrong here?

Is there another option without adding usernames and passwords to the web.config file?

Thanks in Advance,

1 Answers1

0
  • Try Closing VS2019
  • Go to windows management credentials and remove all those that where related with your packages
  • Reopen VS2019 and restore the Nuget Packages for your solution. It asks for your credentials, set it up.
    Or
  • Close Visual Studio, then remove any credentials relating to the Azure DevOps server (e.g., [domain], VSCredentials_[domain]) in Credential Manager. Then reopen Visual Studio, open NuGet Package Manager again and this time (on the 'Installed' tab) enter credentials including the domain (domain/username)