How to refer custom dll or assemblies in Azure Function

Ahamed Fazil Buhari
 
Senior Developer
November 19, 2018
 
Rate this article
 
Views
16493

Hello everyone,

In this article we will see how to refer dll or assemblies in your azure function.

To add custom dll or assemblies:

Let’s consider we’ve a dll named as MySharePointSiteProvision.dll and it needs to be referenced in Azure Function.

clip_image001

Step 1: For the demo I created simple httptrigger azure function and choose language as C#

clip_image003

clip_image005

Step 2: To add the dll, we need to go to the root folder called wwwroot and create bin folder. From Kudu tools, it’s very easy to switching between folders. Click on Azure Function app -> Platform features -> Advanced tools(Kudu) (under Development tools).

clip_image007

Step 3: Kudu tool will open in new tab and navigate to PowerShell available under Debug console menu

clip_image008

Step 4: Navigate to wwwroot folder

clip_image010

Step 5: Create a folder inside wwwroot folder and name it as bin

clip_image011

clip_image012

Step 6: Drag and drop our custom dll inside the bin folder which is created in the above step,

clip_image014

clip_image016

Step 7: Just fort testing, I’ve a class called SiteInfoQ in MySharePointSiteProvision assembly To check whether our custom assembly is referred successfully, I just created an instance from SiteInfoQ class and it works fine, as you we can see from below screenshot.

clip_image018

clip_image020

Happy Coding

Ahamed

Category : Azure, Function APP

Author Info

Ahamed Fazil Buhari
 
Senior Developer
 
Rate this article
 
Ahamed is a Senior Developer and he has very good experience in the field of Microsoft Technologies, especially SharePoint, Azure, M365, SPFx, .NET and client side scripting - JavaScript, TypeScript, ...read more
 

Leave a comment