0
votes

I'm trying to set up a simple CI pipeline in Azure Devops

I have found it super easy to to do a Build -> Publish from within VS2019 to an Azure App Service, and it works flawlessly.

However, when trying to set up a CI pipeline which does the exact same thing from Azure Devops, I am presented with a YAML file, and options which I can drop into it.

I managed to get my pipeline to reach the "build" part, but then it couldn't find my custom nuget feed, so I updated my yaml to include this nuget restore:

trigger:
- master

pool:
  vmImage: 'ubuntu-latest'

variables:
  buildConfiguration: 'Release'

steps:
- task: NuGetCommand@2
  inputs:
    command: 'restore'
    restoreSolution: '**/*.sln'
    feedsToUse: 'select'
    vstsFeed: 'feed-id'
- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'

But the build fails again, with this error:

##[error]The nuget command failed with exit code(1) and error(Unable to load the service index for source https://MYVSTSADDRESS.pkgs.visualstudio.com/_packaging/THE_GUID/nuget/v3/index.json.

My question is, can't I just import the exact process that I follow from vs 2019?

Why is it so annoyingly complicated to do the exact same thing from devops?

Why would I need to complete this YAML document in devops, if its not required from VS??

1
Hi @Bassie. Please check if the answer could give you some help. If it doesn't work, could you share more error message with us? This can help me understand more accurate error messages. ThanksKevin Lu-MSFT
Hi @Bassie. Is there any update about this ticket? Feel free to let me know if the answer could give you some help.Kevin Lu-MSFT

1 Answers

1
votes

##[error]The nuget command failed with exit code(1) and error(Unable to load the service index for source https://MYVSTSADDRESS.pkgs.visualstudio.com/_packaging/THE_GUID/nuget/v3/index.json.

From the URL in the error message, it seems that the task is using the Organization Scope Feed.

Based on my test, some pipeline settings will affect the use of this feed.

First, please check if your error message is similar to the following:

enter image description here

If yes, you could check the Limit job authorization scope to current project for non-release pipelines option is Enabled in Project Settings -> Pipelines.

You could try to disable the option.

Note: To disable this option, you need to disable the option in Organization Settings-> Settings first. Then you could disable the option in Project level.

Then you could navigate to Artifacts -> Feed Settings -> Permissions->... to enable the option Allow Project-Scoped builds.

enter image description here