5
votes

We have an Azure Entreprise Agreement with a main subscription to which a VSTS account is bound. We have setup the Package Management extension in order to host some usefull packages for diferent projects. For each customer, we create a subscription in this EA and a VSTS account bound to it. We build our customer projects on the Hosted build agent of the latter subscription. But when it's time for the build process to restore NuGet packages (using Nuget Installer task) that are stored on the main package feed, it looks like that the build service cannot access this feed (probably because it's not part of the same subscription).

Is there a way to allow an external build service in the main feed permissions, or even use an api key in the NuGet Installer task of the customer build definition, in order to be able to restore packages from the main feed ?

EDIT: i tryed to use a specific nuget.config with either the apiKey (with the same api key that is locally set on my dev machine) or the packageSourceCredentials tag. None of the 2 let the build agent restore the packages.

EDIT: build agent screenshot (COETools.Testing comes from custom feed on another subscription) enter image description here

EDIT: nuget.config enter image description here

EDIT: I changed the build task to use the default agent supplied nuget.exe (i was previously using one in source control) and i managed to have the packages from nuget official feed to be restored. But i'm still unable to have the one from custom feed to restore.

1
did you see any error on the build agent?Peter
The agent says that it cannot find the packages. I'll post a screenshot as soon as I can.Loul G.

1 Answers

0
votes

OK, i had it to work, but i don't like the way i did it because i had to use my personal access token in the packageSourceCredentials tag.

Here is the nuget.config i used:

enter image description here

A better way to do it would be to use the API key (as the one that is generated in the dev local machine nuget.config instead of the personal access token.