Error in azure pipeline while running restore task .Net Core 3.1

Shetty Gunaprasad (Consultant) 21 Reputation points
2022-07-29T09:07:39.09+00:00

Hello,

I am trying to running a normal pipeline for my application which is using .Net Core 3.1, for some reason on running the pipeline it gives me below error. Any help would be appreicable.

226027-image.png

Below is my Yaml file

Starter pipeline

Start with a minimal pipeline that you can customize to build and deploy your code.

Add steps that build, run tests, deploy, and more:

https://aka.ms/yaml

trigger:

  • feature/BugFix271818
  • feature/testpipeline

pool:
vmImage: ubuntu-latest

variables:
buildConfiguration: 'Release'

steps:

  • task: UseDotNet@2
    displayName: 'Use .NET Core sdk'
    inputs:
    packageType: sdk
    version: 3.x
    installationPath: $(Agent.ToolsDirectory)/dotnet
  • task: NodeTool@0
    inputs:
    versionSpec: '6.x'
    checkLatest: true
  • task: DotNetCoreCLI@2
    displayName: Restore
    inputs:
    command: restore
    projects: '$(Parameters.RestoreBuildProjects)'
  • task: DotNetCoreCLI@2
    inputs:
    command: 'build'
    projects: '**/*.csproj'
  • task: DotNetCoreCLI@2
    inputs:
    command: 'test'
    projects: '**/PentaCPQ.Tests.csproj'
    arguments: '--collect "XPlat Code coverage"'
  • task: CmdLine@2
    inputs:
    script: |
    dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8
    displayName: 'Install ReportGenerator tool'
    failOnStderr: true
  • task: CmdLine@2
    inputs:
    script: |
    reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"
    displayName: 'Create Reports'
    failOnStderr: true
  • task: PublishCodeCoverageResults@1
    inputs:
    codeCoverageTool: 'Cobertura'
    summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml'
    failIfCoverageEmpty: true
  • task: VSTest@2
    inputs:
    testSelector: 'testAssemblies'
    testAssemblyVer2: |
    *test*.dll
    !
    *TestAdapter.dll
    !**\obj**
    searchFolder: '$(System.DefaultWorkingDirectory)'
    codeCoverageEnabled: true
  • task: DotNetCoreCLI@2
    displayName: 'dotnet publish'
    inputs:
    command: publish
    publishWebProjects: false
    projects: |
    **/PentaCPQ.FunctionApp.csproj
    **/PentaCPQ.AzureResources.csproj
    **/PentaCPQ.HealthCheckWebApp.csproj
    **/PentaCPQ.OrderMonitoring.Frontend.csproj
    arguments: '--no-restore --configuration Release --output $(Build.ArtifactStagingDirectory)'
  • task: CopyFiles@2
    displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
    inputs:
    SourceFolder: PentaCPQ.AzureResources
    Contents: '**/*.json'
    TargetFolder: '$(Build.ArtifactStagingDirectory)'
  • task: PublishBuildArtifacts@1
    inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'
    StoreAsTar: true
  • script: echo Hello, world!
    displayName: 'Run a one-line script'
  • script: |
    echo Add other tasks to build, test, and deploy your project.
    echo See https://aka.ms/yaml
    displayName: 'Run a multi-line script'
Community Center | Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 20,772 Reputation points Microsoft Employee Moderator
    2022-07-29T23:02:56.467+00:00

    Currently, Azure DevOps is not supported on Microsoft Q&A. Please check this supported products list here (more to be added later on).

    The Azure DevOps team and community are active and answering questions on https://developercommunity.visualstudio.com/spaces/21/index.html Please post your question there and experts will guide you.

    You can also ask for help on Stack overflow: https://stackoverflow.com/questions/tagged/azure-devops
    or request for support here : https://azure.microsoft.com/en-us/support/devops/

    215816-image.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.