Skip to content
  • English Deutsch

benjamin-abt.com

Performance is a feature | Cloud - AI - Azure - .NET - Sustainability

  • Home
  • Blog
  • Portfolio
    • Overview
    • Workshops & Training
    • Publications
  • Contact
  • Home
  • Blog

Setup VSTS YAML builds for your ASP.NET Core app

Setup VSTS YAML builds for your ASP.NET Core app
June 25, 2018 2 min read BEN ABT
ASP.NET Core Visual Studio Team Services DevOps

This article was written in 2018. Versions, tools and recommendations may have changed since then. Newer posts are collected under ASP.NET Core.

Idea

YAML builds are a very common way to define builds in AppVeyor, but in Visual Studio Team Services (VSTS) this feature is pretty new - and still in beta.

But it gives you the most powerful way to have your build definitions as close as possible to your source code.

Enable YAML builds

Because it is still in preview (June 2018), you have to enable YAML builds for your team (you need admin permissions!). VSTS: Enable preview features

Create your YAML definition.

VSTS automatically creates the definition, if you add a file to your master branch named .vsts-ci.yml

A simple definition for ASP.NET Core could look like:

YAML
 1
 2queue:
 3  name: Hosted 2017
 4
 5steps:
 6
 7# Download the latest recommended NuGet exe
 8
 9- task: NuGetToolInstaller@0
10  displayName: "NuGet use 4.6.2"
11  inputs:
12    versionSpec: 4.6.2
13
14# Restore NuGet packages
15
16- task: NuGetCommand@2
17  displayName: "NuGet Restore"
18  inputs:
19    restoreSolution: '**/*.csproj'
20    feedsToUse: config
21    nugetConfigPath: NuGet.config # you should always have a NuGet.config file!
22
23# Build your .NET Core project (but avoid restore your packages again)
24
25- task: DotNetCoreCLI@2
26  displayName: ".NET build"
27  inputs:
28    projects: '**/*.csproj'
29    arguments: --configuration $(BuildConfiguration) --no-restore
30
31# Run your unit tests
32
33- task: DotNetCoreCLI@2
34  displayName: ".NET test"
35  inputs:
36    command: test
37    projects: 'test\**.csproj'
38
39# Create the deployment package for your web project
40
41- task: DotNetCoreCLI@2
42  displayName: ".NET publish package"
43  inputs:
44    command: publish
45    arguments: '--configuration $(BuildConfiguration) --no-restore --output $(Build.ArtifactStagingDirectory)/app/pkg'
46
47# Publish your web project deployment packages as named artifact 'app'
48
49- task: PublishBuildArtifacts@1
50  displayName: "Publish artifacts"
51  inputs:
52    PathtoPublish: '$(Build.ArtifactStagingDirectory)/app'
53    ArtifactName: app
54    publishLocation: Container

Use YAML exports

With the enabled YAML build preview feature you can export your existing VSTS build definitions as YAML builds. Just open the definition and click on View YAML

Right now, you get a warning about undefined variables in your YAML builds - but you can ignore this error, if you are just using the VSTS default variables.

Official documentation

YAML builds are still in prview, so some features of VSTS dont work with YAML build (like build badges): VSTS: How to use YAML builds

Abel Wang from Microsoft uploaded a great video about VSTS YAML builds on YouTube:

Related articles

Modern versioning for ASP.NET Core and web apps and how to produce idempotent artifacts

Jul 3, 2026 - 7 min read

Modern versioning for ASP.NET Core and web apps and how to produce idempotent artifacts

ASP.NET Core applications are usually released often enough that versioning stops being a documentation concern and turns into delivery …

Setup VSTS YAML builds for your Angular app

Jun 25, 2018 - 2 min read

Setup VSTS YAML builds for your Angular app

Idea According to the ASP.NET Core YAML build sample, this sample covers the Angular part. I recommend an own build agent, because the …

Aktivieren der Code-Coverage-Überwachung in Visual Studio Team Services

Feb 19, 2017 - 1 min read

Aktivieren der Code-Coverage-Überwachung in Visual Studio Team Services

Code Coverage Die Code Coverage ist ein wirklich nützlicher Anhaltspunkt um für die Abdeckung von Software Tests ein Gefühl zu bekommen.


BEN ABT

BEN ABT

Ben is Chief Engineering Officer and Principal Software Engineer at Medialesson.de, with a strong focus on .NET and Microsoft Azure. In his professional role, he designs and builds highly scalable platforms for hybrid and cloud-based scenarios. He also advises companies and C-levels on migrating to the sovereign cloud.

He runs myCSharp.de, the largest and most active German-speaking C# community forum, actively contributes to both his own and external open-source projects and regularly shares his knowledge through his blog, at community events, conferences and as a writer for technical magazines.

Let's Work Together

Looking for an experienced Platform Architect or Engineer for your next project? Whether it's cloud migration, platform modernization or building new solutions from scratch - I'm here to help you succeed.

New Platforms

Modernization

Training & Consulting

Contact Me
X Facebook LinkedIn WhatsApp
Back Next Blog Post

Open for work!

Contact Me
BEN ABT BEN ABT Software Engineer · Microsoft MVP Passionate about .NET, Azure, performance optimization and sustainable software engineering.

Medialesson GmbH Logo

Microsoft MVP Logo

Recent posts

View all
Stop Using nginx as Your Default Static File Server in Docker

Stop Using nginx as Your Default Static File Server in …

Oct 24, 2026
Containerizing .NET in 2026 Without a Dockerfile

Containerizing .NET in 2026 Without a Dockerfile

Oct 20, 2026
Problem Details in ASP.NET Core and .NET 11

Problem Details in ASP.NET Core and .NET 11

Oct 5, 2026
Resilience in .NET with Microsoft.Extensions.Resilience

Resilience in .NET with Microsoft.Extensions.Resilience

Sep 21, 2026
What Matters in ASP.NET Core 11

What Matters in ASP.NET Core 11

Sep 14, 2026

Tags

.NET (192) Csharp (96) ASP.NET Core (48) Azure (41) DevOps (17) Docker (14) Microsoft (14) EF Core (11) Microsoft MVP (11) AI (10) GitHub (10) GitHub Copilot (10) ASP.NET (9) Security (9) Synology (9) Architecture (8) Raspberry (8) Azure Functions (7) Cloudflare (7) Bicep (6)
benjamin-abt.com

About BEN

Benjamin Abt is a Software Engineer, Platform Architect and Microsoft MVP specializing in .NET, Azure, cloud architecture, performance optimization and sustainable software development.

Connect

  • Follow me on GitHub
  • Follow me on LinkedIn
  • Follow me on Mastodon
  • Microsoft MVP profile
  • Follow SchwabenCode on GitHub
  • Follow me on X

Quick Links

  • Portfolio
  • Blog
  • Workshops & Training
  • Publications
  • Get in Touch
  • Sitemap
Open for Work

© Copyright Benjamin Abt & SchwabenCode | 2011 - 2026

Content licensed under CC BY 4.0 unless otherwise noted.

  • Impressum
  • Privacy
  • Contact