Azure Function CI – 2. Create a CI Build for the 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

Removing the Classis Hybrid Connections from Azure (Azure BizTalk Service) As you know the classic hybrid connections that are build upon Azure BizTalk Services are deprecated. These connection will have to be replaced by the...
Restricting access to your Azure Web Application As you may know almost everything that is deployed to Azure is publicly available. As with Azure SQL Database you do not have a firewall available for...
Configure access to a private network for a Azure App Services On-Premise connections for Azure App Services can be created by using Hybrid Connections. Hybrid connections do not need any development or re-configu...
Extensions and Tips for deploying with Azure Resource Templates Working with Azure Services in different subscriptions means that the Azure Services need to run in different subscriptions. This often occurs when we...
Part 2 – Azure API Application to query the Azure SQL Database This post is the second in a series of three posts and will help you with the creation of identity pass-through authentication from a client applicati...
Part 1 – Azure SQL Database with Azure Active Directory Authentication This post is the first post in a series of three posts and will help you with the creation of identity pass-through authentication from a client appli...

Leave a Reply

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