Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

FunctionContext Class

Definition

Namespace:
Microsoft.Azure.Functions.Worker
Assembly:
Microsoft.Azure.Functions.Worker.Core.dll
Package:
Microsoft.Azure.Functions.Worker.Core v1.11.0
Source:
FunctionContext.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Encapsulates the information about a function execution.

public abstract class FunctionContext
type FunctionContext = class
Public MustInherit Class FunctionContext
Inheritance
FunctionContext

Constructors

Name Description
FunctionContext()

Properties

Name Description
BindingContext

Gets the binding context for the current function invocation. This context is used to retrieve binding data.

CancellationToken

Gets the CancellationToken that signals a function invocation is being cancelled.

Features

Gets a collection containing the features supported by this context.

FunctionDefinition

Gets the FunctionDefinition that describes the function being executed.

FunctionId

Gets the function ID, typically assigned by the host. This identifier is unique to a function and stable across invocations.

InstanceServices

Gets or sets the IServiceProvider that provides access to this execution's services.

InvocationId

Gets the invocation ID. This identifier is unique to an invocation.

Items

Gets or sets a key/value collection that can be used to share data within the scope of this invocation.

RetryContext

Gets the retry context containing information about retry acvitity for the event that triggered the current function invocation.

TraceContext

Gets the distributed tracing context.

Extension Methods

Name Description
BindInputAsync<T>(FunctionContext, BindingMetadata)

Binds an input binding item for the requested BindingMetadata instance.

GetHttpRequestDataAsync(FunctionContext)

Gets the HttpRequestData instance if the invocation is for an http trigger.

GetHttpResponseData(FunctionContext)

Gets the HttpResponseData instance if the invocation is for an http trigger.

GetInvocationResult(FunctionContext)

Gets the invocation result of the current function invocation.

GetInvocationResult<T>(FunctionContext)

Gets the invocation result of the current function invocation.

GetLogger(FunctionContext, String)

Creates a new ILogger instance for the specified FunctionContext.

GetLogger<T>(FunctionContext)

Creates a new ILogger instance using the full name of the given type.

GetOutputBindings<T>(FunctionContext)

Gets the output binding entries for the current function invocation.

Applies to


Feedback

Was this page helpful?