This topic describes handlers and how to configure handlers in the C# runtime in Function Compute.

What is a handler?

A handler for a function in FC is the method that is used to process requests in function code. When you invoke a function in FC, Function Compute uses the handler that you configured to process requests.

You can configure a handler for a function when you create or update the function in the Function Compute console. For more information, see Manage functions.

For FC functions in C#, the handler is in the format of Assembly::Namespace.ClassName::MethodName.
Parameter Description
Assembly The name of the assembly that is created.
Namespace The name of the namespace.
ClassName The name of the class.
MethodName The name of the method.
If the assembly name is HelloFcApp, the handler must be configured as HelloFcApp::Example.HelloFC::StreamHandler. Sample code:
using System.IO;

namespace Example
{
    public class HelloFC
  {
      public async Task<Stream> StreamHandler(Stream input)
    {
        //function logic
    }
  }
}

Configure a handler

When you configure a handler, make sure that you follow the configuration specifications that are described in Function Compute. The configuration specifications vary based on the handler type.

Handlers are classified into event handlers and HTTP handlers. Event requests are generated by event sources, and HTTP requests are generated by HTTP triggers. For more information, see Function types.

For information about how to configure an event handler, see Event handlers. For information about how to configure an HTTP handler, see HTTP handlers.