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.
Step 1: For the demo I created simple httptrigger azure function and choose language as C#
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).
Step 3: Kudu tool will open in new tab and navigate to PowerShell available under Debug console menu
Step 4: Navigate to wwwroot folder
Step 5: Create a folder inside wwwroot folder and name it as bin
Step 6: Drag and drop our custom dll inside the bin folder which is created in the above step,
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.