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.


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.





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.


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


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




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


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.



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

VSTS Extension for Azure Role Based Access Control Today I published an extension for Visual Studio Team Services (VSTS) that gives you the ability to add and remove role based access assignments in Az...
Publish PowerBI files with Visual Studio Team Services Today I published an extension for Visual Studio Team Services (VSTS) that gives you the ability to deploy PowerBI files (pbix) to It use...
VSTS build or release agent on a self hosted machine in Azure or on premise You can think of many situations where you would like to create a self hosted machine for Visual Studio team services (VSTS). Installing and configuri...
My first public VSTS Extension A couple of days ago I started developing extensions for Build and Release pipelines of Visual Studio Team Services (VSTS). One of these extensions is...
Listing Azure Services within a CSV file In some situations you will look into a current Azure Environment and the setup/governance of it and need to migrate or move resources around. The ...
Protect your master Branch in VSTS You can set up permissions and policies to control who can read and update code in a branch on your Git repo within VSTS. You can set permissions for ...

Leave a Reply

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