Sibeesh Passion

Top Menu

  • Home
  • Search
  • About
  • Privacy Policy

Main Menu

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Home
  • Search
  • About
  • Privacy Policy

logo

Sibeesh Passion

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment

  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins

  • Post Messages to Microsoft Teams Using Python

  • Get Azure Blob Storage Blob Metadata Using PowerShell

  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines

Azure
Home›Azure›Azure Function Build and Release Pipeline in Azure DevOps CI CD

Azure Function Build and Release Pipeline in Azure DevOps CI CD

By SibeeshVenu
July 9, 2019
0
0
Share:

[toc]

Introduction

Playing with Azure Function is always a nice feeling, and it is very important to configure both build and release pipeline for all of your applications, Azure Functions are not different. In this article, we will see how we can create both build and release pipeline in Azure DevOps for our Azure Function application. I hope you will like it.

Prerequisites

You should have an Azure Function application to configure the build and release pipeline for the same. You can either create a new one in the Azure portal, or you can use any existing azure functions available in internet, for example you can see one here.

Setting Build Pipeline for Azure Function

Go to your Azure DevOps and click on Builds

Select Builds

Now you should see an option to select where your code is available. You can choose accordingly.

Select Code Source

As my project is in Azure repository, I will select that. Please be noted that I will be using the classic editor to create the pipeline now, so that I can show the steps with the screenshots. You should be able to see the final yml file at the end of the configuration.

Now you can select the template of your project, I will select .Net Core as the template as my Azure Function is in .Net Core.

Asp.Net Core as Template

Now you can see that our Pipeline is created with some default tasks and settings as follows.

Pipeline Taks
Pipeline Settings for Azure Function

As everything is already created for us, let us save and queue the build. Please make sure that your source code branch is valid and you had verified the build. I forgot to do this, and I was getting the below error, as there was some issue with my code (there was an additional dot(.) in my code, I added it by mistake).

Initial Build Error

So I edited my code and build, and then initiate a manual build again. But even after that I was getting an error as “No web project was found in the repository. Web projects are identified by presence of either a web.config file or wwwroot folder in the directory”.

Second Build Error

The reason for this is, that by default the “Publish Web Projects” is enabled in the Publish task. As ours is not a web project, and if this option is enabled the Publish task will look for a web project in the repository and run the publish command. If we have a web.config file or a wwwroot folder in the directory, it is been treated as a web project.

We have to disable this option as it is not applicable for our project, as it is not a web project. To do so, please go to your Publish task.

All Tasks

Now you should deselect the “Publish Web Projects” option.

Deselect Publish Web Projects

Now save your build configuration and queue a new build. If everything goes well, you should see that your build is successful.

Build Success

If you wish to see the YAML code of a task, you should be able to see it if you click on “View YAML” link.

Please do not forget to enable if you need to trigger the build automatically when there is a check in happened in the repository.

Enable or Disable Continuous Integration

Setting Release Pipeline for Azure Function

Now that we have got our build successful, let us go ahead and create a release pipeline for our Azure Function. But before we do that, we need to create a service connection in our Azure DevOps project. To create one, please go to your Azure DevOps projects settings -> Pipelines -> Service Connections.

Azure Resource Manager Connection

Once it is created, you should see the same under your service connections slab. Now go to the Pipelines section of your Azure DevOps project and click on Releases and the click on New pipeline and select Azure App Service Deployment as the template.

Azure App Service Deployment

You should see this task in the Task section of your pipeline. If you are unable to see the service connection that you had created on the right panel, just remove the task and add the same again and then check. Your task definition should be looking as below.

Azure App Service Deploy Task

Once you are done, save your pipeline. And before you create a release, make sure that you had assigned the right build artifacts. Click on Add an artifact.

Add an Artifact Option

Now you should set the artifacts properties.

Assign Artifacts Properties

Click on Add and Save your pipeline and then queue a release by clicking on the button Create release. You may get the error ” Error: More than one package matched with specified pattern: d:\a\r1\a\**\*.zip. Please restrain the search pattern” now.

Error

The reason behind this is, that your solution has many projects in it and each projects will be having its own zip folder in the artifacts, so to fix this we should specify our Azure Function Project in the Package section of our pipeline task.

Click on the Azure App service Deploy task and the go to the Package or Folder section and then click on the three dots.

Package or Folder Option

Now you should have an option to select the right zip file.

Choose the Right Zip File

Now Create the release again and you should see that the release is successful. You can also see my StackOverflow answer here.

Release Dev

Enabling Continuous Deployment

If you wish you can always enable the continuous delivery or deployment. This will trigger whenever there is a build. To set up this, please go to your Release pipeline and click on the trigger.

Continuous Deployment Trigger

Now you should see an option to enable the Continuous Deployment.

Enable Continuous Deployment

Now all you have to is change something in the code, and not worry about the build and releases. How cool that is?

Conclusion

In this article, we have learned,

  • How to configure Build Pipeline Configuration for Azure Function in Azure DevOps
  • How to configure Release Pipeline Configuration for Azure Function in Azure DevOps
  • About fixing errors in Pipeline configurations in Azure DevOps
  • How to enable Continuous Delivery/Deployment in Azure DevOps
  • How to enable Continuous Integration in Azure DevOps

Please let me know what else you had learned from this Article.

Your turn. What do you think?

Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post as useful? Kindly do not forget to share me your feedback.

Kindest Regards
Sibeesh Venu

TagsAzureAzure DevOpsAzure FunctionBuild PipelineCI and CDContinuous DeploymentContinuous IntegrationDevOpsRelease Pipeline
Previous Article

Secure Serverless Azure Functions AppSetting Using Key ...

Next Article

TimerTrigger Azure Function to Upload to Azure ...

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0

SibeeshVenu

I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer.

Related articles More from author

  • Send Temperature, Humidity, Pressure from MXChip Output
    ArduinoAzureIoT

    MXChip Device with Pressure, Humidity, Temperature Info using Azure IoT Workbench

    January 4, 2019
    By SibeeshVenu
  • Azure

    Deploy Angular App Using Azure DevOps Build and Release Pipelines

    January 7, 2019
    By SibeeshVenu
  • Send MXChip Data to Cloud
    ArduinoAzureIoT

    Detect Noise Level Audio Decibels in MXChip Azure IoT DevKit

    January 14, 2019
    By SibeeshVenu
  • Azure Face API
    AzureVideos

    Webinar: Azure Cognitive Service Face API

    July 23, 2017
    By SibeeshVenu
  • AzurePowerShell

    Get Azure Blob Storage Blob Metadata Using PowerShell

    May 20, 2022
    By SibeeshVenu
  • Azure

    Creating a Simple Windows Application Using Azure

    April 29, 2015
    By SibeeshVenu
0

My book

Asp Net Core and Azure with Raspberry Pi Sibeesh Venu

YouTube

MICROSOFT MVP (2016-2022)

profile for Sibeesh Venu - Microsoft MVP

Recent Posts

  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment
  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins
  • Easily move data from one COSMOS DB to another
  • .NET 8 New and Efficient Way to Check IP is in Given IP Range
  • Async Client IP safelist for Dot NET
  • Post Messages to Microsoft Teams Using Python
  • Get Azure Blob Storage Blob Metadata Using PowerShell
  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines
  • Integrate Azure App Insights in 1 Minute to .Net6 Application
  • Azure DevOps Service Connection with Multiple Azure Resource Group

Tags

Achievements (35) Angular (14) Angular 5 (7) Angular JS (15) article (10) Article Of The Day (13) Asp.Net (14) Azure (65) Azure DevOps (10) Azure Function (10) Azure IoT (7) C# (17) c-sharp corner (13) Career Advice (11) chart (11) CSharp (7) CSS (7) CSS3 (6) HighChart (10) How To (9) HTML5 (10) HTML5 Chart (11) Interview (6) IoT (11) Javascript (10) JQuery (82) jquery functions (9) JQWidgets (15) JQX Grid (17) Json (7) Microsoft (8) MVC (20) MVP (9) MXChip (7) News (18) Office 365 (7) Products (10) SQL (20) SQL Server (15) Visual Studio (10) Visual Studio 2017 (7) VS2017 (7) Web API (12) Windows 10 (7) Wordpress (9)
  • .NET
  • Achievements
  • ADO.NET
  • Android
  • Angular
  • Arduino
  • Article Of The Day
  • ASP.NET
  • Asp.Net Core
  • Automobile
  • Awards
  • Azure
  • Azure CDN
  • azure devops
  • Blockchain
  • Blog
  • Browser
  • C-Sharp Corner
  • C#
  • Career Advice
  • Code Snippets
  • CodeProject
  • Cognitive Services
  • Cosmos DB
  • CSS
  • CSS3
  • Data Factory
  • Database
  • Docker
  • Drawings
  • Drill Down Chart
  • English
  • Excel Programming
  • Exporting
  • Facebook
  • Fun
  • Gadgets
  • GitHub
  • GoPro
  • High Map
  • HighChart
  • How to
  • HTML
  • HTML5
  • Ignite UI
  • IIS
  • Interview
  • IoT
  • JavaScript
  • JQuery
  • jQuery UI
  • JQWidgets
  • JQX Grid
  • Json
  • Knockout JS
  • Linux
  • Machine Learning
  • Malayalam
  • Malayalam Poems
  • MDX Query
  • Microsoft
  • Microsoft ADOMD
  • Microsoft MVP
  • Microsoft Office
  • Microsoft Technologies
  • Microsoft Windows
  • Microsoft Windows Server
  • Mobile
  • MongoDB
  • Monthly Winners
  • MVC
  • MVC Grid
  • MySQL
  • News
  • Node JS
  • npm
  • Number Conversions
  • October 2015
  • Office 365
  • Office Development
  • One Plus
  • Outlook
  • Page
  • PHP
  • Poems
  • PowerShell
  • Products
  • Q&A
  • Raspberry PI
  • React
  • SEO
  • SharePoint
  • Skype
  • Social Media
  • Software
  • Spire.Doc
  • Spire.PDF
  • Spire.XLS
  • SQL
  • SQL Server
  • SSAS
  • SSMS
  • Storage In HTML5
  • Stories
  • Third Party Software Apps
  • Tips
  • Tools
  • Translator Text
  • Uncategorized
  • Unit Testing
  • UWP
  • VB.Net
  • Videos
  • Virtual Machine
  • Visual Studio
  • Visual Studio 2017
  • Wamp Server
  • Web API
  • Web Platform Installer
  • Webinars
  • WebMatrix
  • Windows 10
  • Windows 7
  • Windows 8.1
  • Wordpress
  • Writing

ABOUT ME

I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer. If you would like to know more about me, you can read my story here.

Contact Me

  • info@sibeeshpassion.com

Pages

  • About
  • Search
  • Privacy Policy
  • About
  • Search
  • Privacy Policy
© Copyright Sibeesh Passion 2014-2025. All Rights Reserved.
Go to mobile version