How to refer nuget package in Azure Function v2.x

Ahamed Fazil Buhari
Senior Developer
Published On :   15 Dec 2018
Visit Count
Today :  3    Total :   355

Hello everyone,

In this article we will see how to refer nuget package in your azure function v2.x. Please make sure that your Azure function is version 2, because nuget package is referred differently in version 1 please refer my other article for v1.x - How to refer nuget package in Azure Function v1.x. To check your current azure function version, please follow the below step.

Go to Azure Portal ( ) -> open Function App, under Overview or Platform features tab there will be link Function app settings



In my function app, I’ve already created a simple HttpTrigger function as you can see from below screenshot


Now, I want to add the following nuget package - to my azure function, to do that we need to create a File called function.proj (but in v1.x this file name should be project.json) clip_image008

paste the below XML in newly created function.proj file

 <Project Sdk="Microsoft.NET.Sdk">
     <PackageReference Include="SharePointPnPCoreOnline" Version="3.2.1810"/>

And click on Save, if you need more than one nuget package to be installed, then please add another <PackageReference Include="package-name " Version="version-num"/>

inside <ItemGroup> tag.


Once it’s saved, you can see from the log that the package is getting installed


After installation is over (it takes few seconds based on size of the package), I just referred Microsoft.SharePoint.Client dll to check and it worked.


Happy Coding