![]() ![]() It is time to understand how nuget configuration is done. Now the question is: how can I made TeamCity agent to use that token? Actually TeamCity has some special section where you can specify username and password, or where you can add external feed, but I want a general way to solve for every external tool, not only for Team City. This the easiest and more secure way to login in Azure DevOps with command line tools, especially because to access the feed I’ve generated a token that have a really reduced permission.įigure 5: Access token with only packaging read permissionĪs you can see in Figure 5, I created a token that has only read access to packaging, if someone stoles it, he/she can only access packages and nothing more. Now, as for everything that involves Azure DevOps, when you are asked for credential, you can use anything for the username and provide an Access Token as a password.įigure 4: Specifying anything for user and my accesstoken I can read the feed. Lets start from the basic, if I use NuGet command line to list packages for my private source I got prompted for a user.įigure 3: NuGet asking for credential to access a feed I must admit that this information is scattered in various resources and Azure DevOps, simply tells you to add a nfig in your project and you are ready to go, but this is true only if we are using Visual Studio connected to the account.įigure 1: Standard configuration for nuget config to point to the new feedīasic documentation forget to mention authentication, except from Get The Tool instruction, where you are suggested to download the Credential Provider if you do not have Visual Studio.įigure 2: Instruction to get NuGet and Credential ProviderĬredential provider is useful, but is really not the solution, because I want a more Nuget Friendly solution, the goal is: when the agent in TeamCity is issuing a Nuget restore, it should just work.Ī better alternative is to use standard NuGet authentication mechanism, where you simply add a source with both user and password. The question is: How can I consume an Azure DevOps nuget feed from agent or tools that are not related to Azure Devops site itself? This project still have some old build in TeamCity, but when it starts consuming packages published in Azure Devops, TeamCity builds start failing due 401 (unauthorized) error. The problem with Azure DevOps NuGet feeds, is how to authenticate other toolchain or build server. ![]() Today I had a little problem setting up a build in Team City that uses a feed in Azure Devops, because it failed with 201 (unauthorized) Azure DevOps has an integrated feed management you can use for nuget, npm, etc the feed is private and only authorized users can download / upload packages. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |