Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Function in library

I've created an Azure Function project in S2017 and added two function classes Func1 & Func2... when I run this it pickup both functions.... Now I've tried moving Func2 into a class library and reference it from the first project... but now func2 is not picked up.... I've tried to move func2 to another Azure Function project and then reference this from the first project.. but again Func2 is not picked up

Is it not possible to reference function in an assembly making them part of my function app??

like image 960
smolesen Avatar asked May 16 '18 05:05

smolesen


People also ask

What is an Azure function?

Azure Functions is a serverless solution that allows you to write less code, maintain less infrastructure, and save on costs. Instead of worrying about deploying and maintaining servers, the cloud infrastructure provides all the up-to-date resources needed to keep your applications running.

How do I call Azure function locally?

Copy the settings file to the root of the Functions project next to the DLL, open a command prompt from there, and run “func start.” The Function will run based off the same trigger it would use if hosted in Azure or it can be manually triggered for testing using a local HTTP endpoint.


1 Answers

Assuming Visual Studio is being used, if you add:

<FunctionsInDependencies>true</FunctionsInDependencies>

to the <PropertyGroup> in your .csproj it will look for functions in external libraries and generate the correct metadata.

like image 172
Lee Gunn Avatar answered Nov 14 '22 12:11

Lee Gunn