In this article, I am going to show how we can make a CI & CD Build and Release Pipeline for an Azure Function. Below is my process.
- Code Repository = Azure Repo Git
- Build Pipeline
- Release Pipeline
- Finally Azure Function in Portal with CI & CD

Prerequisites
An existing Azure Functions App.

Create an Azure Function App through Code
Open Visual Studio 2017 and go to New -> Project.
Select Cloud => Azure Functions.

Click OK.

Select the HTTP Trigger Function. Click OK.

Leave everything as default. I just renamed the Function Name to (SayHelloFunction).
In addition, if we pass the Name as a query string, then the “Hello From Noida – Welcome – {Name}” Message will return.
Check-in Your Code to Azure Repos
Now, our Visual Studio Code is ready.
The next step is to create a project in Azure. Open here.
Log in with your credentials.
Create an organization here if you do not have.
I have rahsaxen1 (Organization)

Click on + New Project.

Click on "Create".
Now, we will commit our code into Azure Repos Git.
So, click on Repos from the left side menu.

Copy the Azure Repo Git URL.
https://dev.azure.com/rahsaxen1/_git/RAHULTestFunctionAppCICD
Now, open your Functions App code location.
We will commit our code into Azure Repo Git through Git Command.

Type cmd.exe and hit Enter - the command window will open.
Execute the below Git commands.
> git init
> git add .
> git commit -am "Add your app"
> git remote add origin <git Repo Url>
> git push -u origin –all
> git add .
> git commit -am "Add your app"
> git remote add origin <git Repo Url>
> git push -u origin –all

Now, check your Azure DevOps Project (Repos).

Build Pipeline For Azure Function
Now, click on Pipeline from the left-side menu.
Pipeline -> Build -> New Pipeline



Click on "Continue". Now, select a Template.

Select ASP.NET Core here and "Apply". Some default jobs will add.

Keep everything as default. Select Publish,
In Publish Job -> DeSelect Publish Web Projects because if this option is enabled, the Publish task will look for a web project in the repository and run the publish command.
Now, select the Triggers option.
Now, select the Triggers option.



























Gopaiah NekarukantiPosted Nov 15, 2019, 8:22 AM
Excellent information !!!
Pritesh MaturkarPosted Oct 7, 2019, 7:35 AM
it is very nice article. Thanks for sharing.