0

Azure Function CI – 2. Create a CI Build for the Azure Function

Azure Function

This post is the second one in a series of three posts and will help you by creating a CI build for a Azure Function.

Prerequisites

This blog post is totally written using the Azure Function Visual Studio template. Information and the Azure Function tools download are listed below:

Source Control

The solution created in the previous steps needs to be added and committed to Source Control. When it is added open Visual Studio Team Services in the browser and navigate to the build tab.

 

image_thumb60

 

 

When you do not have build within your project VSTS will show a large button to add a new build definition. Click this button (“New Definition” ) or use the smaller button within the top bar.

image_thumb68

Next up is the template selection for the build definition. Select the Visual Studio Template.

image_thumb77

This will create a Build definition with some default build steps. Save the the template as your build definition by clicking on “Save & Queue”

 

image_thumb93

 

A queue build window will open with the default settings. Keep these settings to create a release build for every CPU type.

image_thumb85

You will notice that this build will fail. This is because the “.funproj” is not known by the build agent (mainly because the template is still in preview). You can notice this by the following error.

MSFTPlayground Function\MSFT.Function\MSFT.Function.funproj(8,3): Error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AzureFunctions\Microsoft.AzureFunctions.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

The “.funproj” itself does not need to be build so to make the Build server run correctly we can and will exclude the project from the build. In order to get this done perform the following steps.

  1. Open Visual Studio and right click the solution.
  2. In the menu click on “Configuration Manager”
  3. Deselect the build checkbox for your Functions project. Do this for the debug and release configuration.

image_thumb167

 

When the Function project is exclude from the build Commit the sources and queue the build again and you will see that this build will run successful.

Next post will be on: Deploying the Azure Function from the Build within VSTS.

Related Posts

Azure DevOps Automation A couple of weeks ago the rename / rebranding of Visual Studio Team Services to Azure DevOps was announced. The rebranding is a great step forward int...
AKS (Kubernetes) and no connection could be made because the target machine acti... A client of my had an error while connecting to different resources within their Kubernetes cluster in Azure (AKS). Kubectl error On the kubectl com...
Kubernetes (AKS) attached to Azure Storage (Files) Kubernetes (AKS) can be used for many situations. For a client we needed to make files available trough a Kubernetes Pod. The files needed to be share...
Resource Group deployment via ARM templates When deploying an Azure Resource Manager (ARM) template you have to create a resource group within Azure. To deploy a template via script your script ...
Azure Managed Service Identity and Local Development Instead of storing user credentials of an external system in a configuration file, you should store them in the Azure Key Vault. Before MSI (Managed S...
Updates to my VSTS extensions Since a couple of months I have been developing extensions for Visual Studio Team Service (VSTS). I created extensions for task I had to do manual a c...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.