Custom IoC in Azure Functions, and user context

Stephen Montgomery 1 Reputation point
2021-01-04T12:55:27.047+00:00

I want to use a custom IoC Container in Azure Functions to decorate my commands with aspects and subscribe to event handlers. Unfortunately MS.DI does not handle Decorator or Composite and so want to use SimpleInjector or Autofac instead.

Also would like to inject HttpContextAccessor in a UserContext to my domain layer rather than pass into Command Parameter Objects. But Functions seems to demand reading Request message manually. Am thinking WebAPI might be a better suited platform for developing an enterprise system with Command Query AoP and complex authorisation of Command logic? Any good reading resources or advice?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,020 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,631 Reputation points Microsoft Employee
    2021-01-05T05:18:28.36+00:00

    While WebAPI would give you maximum flexibility for your requirements, another option you could consider is Custom Handlers.

    This approach allows you to implement your WebAPI as required while still running on a serverless consumption plan.

    0 comments No comments

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.