References in Azure Functions – custom DLLs – how to
When you want to call methods or objects in C# code, you must declare them with “using” statement. But what if the package is not available? Then you must first make a reference to it. When programming in local environment it just require to upload needed dlls into the project. But what when you are not using desktop IDE, but through the Azure console?
Uploading DLLs to reference them from Azure Function
The process is not complicated at all. But not very intuitive for the first time. Step by step below:
- Open App Services in your Azure (or Function Apps, doesn’t matter);
- Click your Function’s name;
- Click “Platform Features”;
- Click “Advanced tools (Kudu)” – will open in a new tab:
- Then “Tools” –> “ZIP Push Deploy”;
- Then click the folder with your Function’s name and go to the “bin” folder;
- Being there, drag&drop the dll’s you want to make reference to in your Azure Function:
That’s it. Now you can reference your dlls from your Azure Function:
Vivek Jayachandran
Thank You, this post was helpful.
Tomasz Poszytek
You’re welcome! 🙂
Nilton
Excelente publicacion me sirvio de mucho.
Tomasz Poszytek
Estoy muy disfrutando y gracias! 🙂
Human
Thank You !
Zack Ayeri
Tomasz thank you for the article, helpful. In VS2022 i have my azure function and works fine. When I deploy (publish) to Azure portal, it rejects bunch of assembly missing…etc.(I use AWSSDK, Sytem.DATA.SqlClient…). any suggestion during publish process. Thank you
Tomasz Poszytek
I’m afraid I don’t have the knowledge to help you with that.