Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use external assemblies with Microsoft Azure Function Apps?

Tags:

The documentation says that you can put a DLL in a bin folder and reference it using a special #r syntax, however in the Azure portal I cannot find how to upload these DLLs. Is this possible, and if so, how is that supposed to be accomplished?

like image 786
Josh Avatar asked Apr 11 '16 21:04

Josh


People also ask

Should function apps have their own storage account?

For best performance, your function app should use a storage account in the same region, which reduces latency. The Azure portal enforces this best practice. If for some reason you need to use a storage account in a region different than your function app, you must create your function app outside of the portal.


2 Answers

This is possible.

You can use Kudu to upload your binaries:

  1. Open the app's Kudu portal. If your Functions App's URL is samplefunctions.azurewebsites.net, then go to samplefunctions.scm.azurewebsites.net.

  2. Click on the Debug console menu and select PowerShell. This will open up a PowerShell console plus a file explorer. Navigate to D:\home\site\wwwroot.

  3. There you should see a folder which is named after your existing function. Navigate to that folder and drag-n-drop your binaries inside bin folder.

  4. Now you can use them with #r directive.

I think you should also be able to configure the continuous deployment of your libraries to Functions (e.g. from a Git repo). Go to Function app settings -> Configure Continuous Integration.

like image 80
Mikhail Shilkov Avatar answered Sep 21 '22 03:09

Mikhail Shilkov


Azure functions now has runtime support for precompiled functions. https://blogs.msdn.microsoft.com/appserviceteam/2017/03/16/publishing-a-net-class-library-as-a-function-app/

You’ll need to use a web project which will provide the full development experience of IntelliSense, local debugging, and publishing to Azure. The instructions above detail how.

like image 21
Irwin Avatar answered Sep 21 '22 03:09

Irwin