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.
700 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,920 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pramod Valavala 20,656 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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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