Azure Function Trigger Basic Code Template Style

vincent219 256 Reputation points
2021-09-14T02:28:45.647+00:00

In Azure Function Isolate Process, what is the reason that Functions are created as Static Class and Static Method by default? Even if it is not static, it works normally.

Is there any reason it must be static?

Azure Service Bus
Azure Service Bus

An Azure service that provides cloud messaging as a service and hybrid integration.

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

0 comments No comments

Answer accepted by question author

Pramod Valavala 20,661 Reputation points Microsoft Employee Moderator
2021-09-14T08:51:39.02+00:00

@vincent219 Like you've mentioned, both work and its completely up to you. Originally, only static functions were supported and later support for instance functions were added.

Dependency Injection requires non-static classes but for most simpler use cases, you could get away with static classes. For example, simple transformations, routing scenarios, etc.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.