I want to create access to my private feed from pipeline (Project A), but everytime when i try run dotnet restore
to restore .net project with nugets from private feed (project scoped feed in Project B) i got
error NU1301: Unable to load the service index for source <<url_to_my_feed>>
My pipeline.yml looks like:
[previous jobs]
- task: NuGetAuthenticate@0
- task: Docker@2
displayName: Build image
inputs:
command: build
containerRegistry: $(dockerRegistryServiceConnection)
repository: $(contentHostRepositoryName)
Dockerfile: "$(Build.SourcesDirectory)/src/modules/content/src/Dockerfile"
arguments: '--build-arg PAT=$(VSS_NUGET_ACCESSTOKEN)'
tags: |
$(tag)
[next jobs]
My dockerfile looks like:
...
ARG PAT
RUN dotnet nuget add source <<url_to_my_feed>> --name <<name>> --username <<username>> --password $PAT --store-password-in-clear-text
...
When i replace '--build-arg PAT=$(VSS_NUGET_ACCESSTOKEN)'
to '--build-arg PAT=<<pat_token>>'
where <<pat_token>>
is token, who i generate manualty to my personal account in Azure Devops - everythink work fine.
What i try:
Limit job authorization scope to current project for non-release pipelines
and Limit job authorization scope to current project for release pipelines
NuGetAuthenticate@0
and NuGetAuthenticate@1
Add the Project Collection Build Service (Organization)
and let it has related permission.
Since you use yml file pipeline, and you disable Limit job authorization scope to current project for non-release pipelines
, so project build service account will change to project collection build service account.
And please use $(System.AccessToken) to auth.