Skip to content

Commit and Validate

Once you add all four tasks, select Save to commit your changes. Your pipeline should automatically kick off a run and should take less than a minute to execute (since we are using Microsoft's hosted agents, as defined by the pool block, we cannot execute parallel builds. As such your build wait in the queue).

A successful pipeline will pass on the build, run four tasks, and store an artifact in ADO Artifacts under your feed.

How to validate your successful pipeline

If your pipeline fails or does not behave as expected, compare your pipeline file against the working complete pipeline.

1. Passing build

Pipeline Success

2. Four completed tasks: 3 DotNetCoreCLI and 1 UniversalPackages

Pipeline Success

3. Your pipeline should also generate an artifact

Pipeline Success

Solution

If your pipeline did not run successfully, there are many possible reasons. There could be broken syntax for the YAML format, missing steps or tasks, incomplete or incorrect arguments within a task, just to name a few.

Below is the solution that was used for the walk-through. If your build was failing, or you had any other problems with ultimately publishing an artifact, compare your azure-pipelines.yml with the solution (not the unique values of artifact name and feed).

Complete azure-pipelines.yml code
pool:
  vmImage: 'ubuntu-latest'

steps:
- task: DotNetCoreCLI@2
  inputs:
    command: 'build'
    projects: '**/*.sln'
    arguments: '--configuration Release'

- task: DotNetCoreCLI@2
  inputs:
    command: 'test'
    arguments: '--configuration Release --no-build --no-restore'

- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    publishWebProjects: true
    arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory) --no-build --no-restore'

- task: UniversalPackages@0
  inputs:
    command: 'publish'
    publishDirectory: '$(Build.ArtifactStagingDirectory)'
    feedsToUsePublish: 'internal'
    ## Auto-generated from your selected feed
    vstsFeedPublish: 'c214cc40-9426-4e8f-8a0a-8e71c2a297fe/ed532ff1-b477-49de-b9ca-3790eb2fda1e'
    ## Define the name of your artifact
    vstsFeedPackagePublish: 'my-app'
    versionOption: 'patch'