Azure Function App: Reference a Custom DLL

Hello,

In this post, I’m explaining you how to reference a custom “private” DLL in your Azure Function App. In a previous post, I taught you how to reference DLL using NuGet (https://loicsterckx.wordpress.com/2017/02/17/how-to-retrieve-nugget-packages-in-azure-functions ).

Here it’s about a custom DLL that you want to keep private. A company framework for instance.

I’m assuming in this post that you know “what is” and “how to” use an Azure Function App.

  1. Create your Azure Function App. Here: LoicBlogDemo
  2. Create your function inside. Here: MyDemoFunction
  3. Open Kudu
    a. Select your Azure Function App
    b. Select “Platform Features“
    c. Select “Advanced tools (Kudu)1
  4. On the Kudu’s page, select “Debug console”
  5. Select “PowerShell”2
  6. In the console, navigate to site -> wwwroot. There you will see the name of your function created in point 2. In my case “MyDemoFunction”, open this folder3
  7. Create a new folder called “bin”
  8. Upload (drag&drog) your wanted DLL into this bin folder4
  9. You can close Kudu and open your function again, open the run.csx file. At the first line of this file, insert :

#r “%MYCUSTOMDLLNAME%.dll”

            Where of course, %MYCUSTOMDLLNAME% equal the name of your uploaded DLL.

You’re now ready to code with your custom DLL.

Happy Function 🙂

Advertisements
This entry was posted in Azure. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s