Perform the following steps:
- Create a new Class Library application using Visual Studio. I have used Visual Studio 2017:

- Create a new class named Helper and paste the following code in the new class file:
namespace Utilities
{
public class Helper
{
public static string GetReusableFunctionOutput()
{
return "This is an output from a Resuable Library across functions";
}
}
}
- Change Build Configuration to Release and build the application to create the .dll file, which will be used in our Azure Functions.
- Navigate to the App Service Editor of the function app by clicking on the App Service Editor button, which is available under Platform Features.
- Now create a new bin folder by right-clicking in the empty area below the files located in WWWROOT.
- After clicking on the New Folder item in the obtained screen, a new textbox will appear, wherein you will need to provide the name as bin.
- Next, right-click on the bin folder and select the Upload Files option to upload the .dll file that we created in Visual Studio
- This is how it looks after we upload the .dll file to the bin folder:

- Navigate to the Azure Function where you would like to use the shared method. To demonstrate, I have created two Azure Functions (one HTTP trigger and one timer trigger):
- Let's navigate to the ReusableMethodCaller1 function and make the following changes:
- Add a new #r directive, as follows, to the run.csx method of the ReusableMethodCaller1 Azure Function. Note that .dll is required in this case:
#r "../bin/Utilities.dll"
-
- Add a new namespace, as follows:
using Utilities;
- We are now ready to use the GetReusableFunctionOutput shared method in our Azure Function. Now replace the code of the HTTP trigger with the following:
log.LogInformation(Helper.GetReusableFunctionOutput());
- When you run the application, you should see the following message in the logs:
- Repeat the same steps of adding the reference and the namespace of the utilities library even in the second Azure Function, ReusableMethodCaller2. If you have made the changes successfully, you should see something like what follows: