This article talks about building and creating pipelines on Azure DevOps for Azure functions .NET core/.NET 6
The steps to build a build and release pipelines are follows:
- Select your Repo
- Configure a pipeline template ex. ASP.NET, ASP.NET core, Starter
- Under a starter pipeline – There are 3 steps to create a starter pipeline.
- Build a script for compiling and building the code
- A script to archive code files in a zip folder
- Publish the artifact
The first step is to create a build pipeline.
In Azure DevOps -> create a new pipeline -> Select Azure Repos Git -> Select the Repository -> Select a starter pipeline
In Review your pipeline step, remove the default steps from the script. We will use the assistant to build the scripts. From the assistant on the right side, select .NET core task and add the command, path to project, and arguments, and click on the Add button
You can also make a variable for the argument value and use the variable.
Let’s add the code to archive this project into a zip file.
Select Archive files from the Task assistant. Archive the files under publish_output folder and uncheck the prepend option
This is going to create an archive under the staging directory.
Let’s go ahead and publish this artifact. Select “publish build artifacts” from the Task assistant
Click “Save and Run”