Closed hangy closed 11 months ago
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
Not done, yet.
We discovered the same problem. We cannot get this to run. Is there any attention on this issue? We would like to restore our own dotnet tool from the internal feed using the authentication.
Same
Current workaround for this is to add a nuget.config
file to the repository root:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear /> <!-- ensure only the sources defined below are used -->
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="contoso" value="https://pkgs.dev.azure.com/contoso/_packaging/my-feed/nuget/v3/index.json" />
</packageSources>
</configuration>
The alter the pipeline to include a NuGetAuthenticate@1
task before restoration:
steps:
- task: UseDotNet@2
displayName: 'Install .NET SDK'
inputs:
packageType: 'sdk'
version: '7.x'
- task: NuGetAuthenticate@1
displayName: 'NuGet Authentication'
- script: 'dotnet tool restore --interactive'
displayName: dotnet tool restore
- task: DotNetCoreCLI@2
displayName: 'dotnet publish'
inputs:
command: publish
publishWebProjects: false # defaults to true
zipAfterPublish: false # defaults to true
projects: '**/*.csproj'
All tasks/operation requiring authentication to the private feed work after adding NuGetAuthentication@1
meaning you might
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
Question, Bug, or Feature?
Type: Feature
Enter Task Name: DotNetCoreCLI@2
Environment
Issue Description
When using a tool manifest (
.config\dotnet-tools.json
in the current directory), you can restore tools usingdotnet tool restore
. Unfortunately, the DotNetCoreCLI task requires you to execute it as acustom
command, and doesn't apply any feed settings.https://github.com/microsoft/azure-pipelines-tasks/blob/1fe93c42be2b82105c5b2e1c236dae1cbfe2ed9b/Tasks/DotNetCoreCLIV2/dotnetcore.ts#L47-L50
Thus, unlike the
restore
command, it doesn't use the agent's current accessToken to access any private NuGet feed. (restore
picutred below for reference): https://github.com/microsoft/azure-pipelines-tasks/blob/acc64cc7292c98597908325e53af9f898a896189/Tasks/DotNetCoreCLIV2/restorecommand.ts#L58-L61Consequently, if any private feed, which the agent has access to, is referenced in
NuGet.config
, thendotnet tool restore
tends to fail, because it cannot access that feed.Task logs
Note that the user does not need the permission (or access level), because
dotnet tool restore
could just use the agent'saccessToken
.Additional Information
The
custom
command does not respect theselectOrConfig
orincludeNuGetOrg
task parameters, so that it is not possible to simply exclude the private feed (Azure Artifacts hosted on the same instance of Azure DevOps Server, btw) by setting task parameters. There are probably ways to work around this, if you don't need tools from Azure Artifacts, but even then, the experience is not as expected.I believe, the
dotnet tool restore
should be built-in and should respect the same feed settings asdotnet restore
does.