1

I want to set up Continuous Delivery using Azure Dev Ops.

In Github, the repository directory structure looks like below:

  • FunctionAppProject/
  • AspMvcProject/
  • Project.sln

The FunctionApp Project references objects from the AspMvc Project, and vice versa.

I want to create a .yaml file that triggers a build when a merge to master occurs. I then want to build and deploy the Function App to an Azure Function App, and the AspMvc project to deploy to an Azure Web App, if possible.

I'm a beginner with yaml and Azure Dev Ops, any help would be appreciated!

Kevin Tran
  • 137
  • 1
  • 8

1 Answers1

1

Since you are a beginner with yaml and Azure DevOps. I would suggest you first set up a classic editor CI/CD pipeline for your solution.

This will help you quick be familiar with the process of Azure DevOps. Then you could learn how to use yaml in Azure DevOps. Finally try to convert your classic pipeline to yaml pipeline.

For multiple projects, you just need to use a single build pipeline for CI. A single release pipeline for CD with multiple deploy tasks or multiple release pipelines for CD corresponding to each project(recommend).

In build pipeline, we need to use filters, Branch Filters and Path Filters

  • Under Branch Filters, click Add and add the master branch. Anytime there is a commit to the master branch a build will start.
  • Under Path Filters, we need to specify the paths to look for file changes, you will want to include /FunctionAppProject and /AspMvcProject. If you shared code with either of these projects you would want to be sure to include those project paths.

enter image description here

Path filters allow the build pipeline creator the convenience to decide whether to trigger a build based on paths of modified files in any given commit. Consequently, if the path does not match a specific path, it also prevents the build from trigger.

Some blogs may benefit to you:

  1. Create a CI/CD pipeline for .NET with the Azure DevOps Project (how to use CI/CD in Azure DevOps)
  2. Multiple Project Deployment with Azure DevOps (how to handle multiple project in Azure DevOps)
  3. How to publish artifacts separately for each project in solution from VSTS CI pipeline? (Publish your two project built artifacts separately)

After you set up and deployed your projects with Azure DevOps succeed.

Then, you could learn YAML schema reference, this is a detailed reference guide to Azure Pipelines YAML pipelines. It includes a catalog of all supported YAML capabilities and the available options.

Finally just convert your classic pipeline to yaml pipeline. For example, when using yaml of Branch and Path filters, should looks like:

# specific path build
trigger:
  branches:
    include:
    - master
    - releases/*
  paths:
    include:
    - FunctionAppProject/*
    - AspMvcProject/*
    exclude:
    - docs/README.md

Hope this helps.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62