Mike
Mike

Reputation: 131

Combine serverless Azure functions in code but run independently

If you need to create 5 related serverless azure functions that have similar dependencies and a large portion of the code would be the same, do you have to create and maintain 5 separate Visual Studio solutions/projects? Is it possible to create one solution/project in Visual Studio but then spawn 5 instances (passing in a different parameter to each one)?

For example, 1 is timer based and runs Function1 another is queue based and runs Function2 etc.

Upvotes: 0

Views: 30

Answers (1)

Thiago Custodio
Thiago Custodio

Reputation: 18387

Yes, you can have one function App with multiple types of triggers and share the logic between them.

There's even support for Dependency Injection:

https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection

Upvotes: 1

Related Questions