As part of my personal development, I’ve created a personal health platform that uses various different microservices (Built using Azure Functions) that extract data from my Fitbit account and store them in an Azure Cosmos DB database. I have other microservices that pass messages between different services via Azure Service Bus.

For this project, I use Azure DevOps to build my artifacts, run my unit tests and deploy my microservices to Azure. The great thing about DevOps is that we can do all of this within the YAML pipeline.

Yes I said YAML. Honestly, I don’t know what the fuss is all about 😂

In a previous post, I talked about how we can deploy NuGet packages to a private feed in Azure Artifacts using YAML pipelines. If you haven’t read that post yet, you can check it out below!

https://dev.to/willvelida/publishing-nuget-packages-to-a-private-azure-artifacts-feed-with-yaml-build-files-3bnb

In this article, we will turn our attention to building and deploying C## Azure Functions using a single build file.

#What we’ll cover

We’ve got quite a bit to cover, so I’ll break down my YAML file and talk about each stage in the following order:

  • Triggering a Build 👷‍♂️👷‍♀️
  • Using User-Defined Variables in our pipelines 👨‍🔬👩‍🔬
  • Defining Stages 💻
  • Building our project 🔨
  • Running our tests 🧪
  • Getting code coverage 🧾
  • Producing a Build Artifact 🏠
  • Using Secrets from Key Vault 🔑
  • Deploying our Function to Azure ⚡
  • Running our build pipeline 🚀

#azure #azure-devops #azure-functions #dotnet #devops #c#

How to Build and Deploy C# Azure Functions using Multi-Stage Pipelines in Azure DevOps
1.70 GEEK