0

This article shows one step closer to an efficient and effective continuous integration workflow for an Azure function. (Thanks to Donna M from Microsoft).

https://blogs.msdn.microsoft.com/appserviceteam/2017/03/16/publishing-a-net-class-library-as-a-function-app/

Rather than re-create our azure functions as web applications, we would like to know exactly what needs to be included in a repository for Kudu or the Azure Function Runtime to automatically perform Nuget Restore and then build the project. Ideally, we could just add whatever is needed to our projects to satisfy the build system.

Previously we had a deploy.cmd script in our repositories according to the Azure Web App convention to orchestrate the restore and build ourselves. It worked in January because Azure Functions are built on web apps, however that has stopped working recently and we found that the folder structure has been rearranged a bit (probably due to the fixes they implemented for locking of .dll files). We understand that deploy.cmd was never officially supported, so we'd just like to know how to modify our existing projects to work in the current version of Azure Functions.

solvingJ
  • 1,321
  • 1
  • 19
  • 30

1 Answers1

0

Here's a really good answer on all things nuget & functions deployment: How can I use NuGet packages in my Azure Functions?

Nuget restore and project build should happen automatically for .csx function apps.

All you need is to follow the folder structure conventions. Here's an example:

Function1/
  function.json
  run.csx
  other.csx
  project.json
Function2/
  function.json
  run.csx
  project.json
Shared/
  shared.csx
host.json

To make sure that Shared folder code is watched for changes, add Shared to watchDirectories in host.json.

Community
  • 1
  • 1
Matt Mason
  • 2,676
  • 9
  • 22
  • Thanks for the fast and detailed response, however this does not really answer my question. The article was about implementing functions as class libraries rather than .csx files. By using a "Web Application" project in visual studio rather than a ".funproj", it demonstrates how to get autorestore and autobuild of all the projects in a traditional .NET solution, including shared assemblies etc. There are apparently standard features of the "Web Application" project that Kudu looks for. We really want to know what those are specifically. – solvingJ Apr 05 '17 at 19:21
  • This is probably the best Kudu resource: https://github.com/projectkudu/kudu/wiki – Matt Mason Apr 05 '17 at 20:21
  • Right, this article speaks about customizing deployments, but doesn't answer our questions unfortunately. https://github.com/projectkudu/kudu/wiki/Customizing-deployments – solvingJ Apr 05 '17 at 22:22
  • The Kudu deployment process will build your project/solution, which will include the step to restore packages. You may need to customize the output structure so it meets the Azure Functions expectations, and that is something that can be done with build steps or a custom deployment script, documented on the Wiki linked above. – Fabio Cavalcante Apr 06 '17 at 16:12
  • As I said in the original post, we were using a custom deployment script and it was working with Azure functions until recently when it stopped. I did a simpler test yesterday before I posted this to verify, and it also failed to build/restored. However, I just did a test of our original repo project and it built/restored successfully... so, something in our project must be breaking it. I will post back if I figure it out, but thanks to all for looking into this. – solvingJ Apr 06 '17 at 22:20