Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a class inside Microsoft Azure Function?

May be it's a wrong question, but I need to create a Model/class and access same in azure function. I could not able to find how can I create a class.

like image 510
Ravi Anand Avatar asked May 16 '17 16:05

Ravi Anand


People also ask

Does Azure functions support Java?

Java function basicsA single package is deployed to a function app in Azure. When running in Azure, the function app provides the deployment, execution, and management context for your individual Java functions.

How do you use the ILogger in Azure function?

The ILogger becomes available within your code, and you can access the Log methods (LogInformation, and so on). In case you want to use the ILogger in various other classes in your function you can do Dependency Injection using Azure Function Autofac.


1 Answers

Classes may be created inline as it would typically define a class in a regular C# project. Here's an example of a function that defines a class.

You can also define classes in separate files and reference those files using the #load directive as documented here.

Another option is to reference an assembly where your classes are defined, as documented here.

And, a different approach, and yet another option, is to use the newly announced Visual Studio 2017 Tools for Azure Functions

like image 190
Fabio Cavalcante Avatar answered Nov 13 '22 06:11

Fabio Cavalcante