InvocationContext class
Contains metadata and helper methods specific to this invocation
Constructors
Invocation |
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime |
Properties
extra |
An object used to get secondary inputs |
extra |
An object used to set secondary outputs |
function |
The name of the function that is being invoked |
invocation |
A unique guid specific to this invocation |
options | The options used when registering the function NOTE: This value may differ slightly from the original because it has been validated and defaults may have been explicitly added |
retry |
The retry context of the current function execution if the retry policy is defined |
trace |
TraceContext information to enable distributed tracing scenarios |
trigger |
Metadata about the trigger or undefined if the metadata is already represented elsewhere For example, this will be undefined for http and timer triggers because you can find that information on the request & timer object instead |
Methods
debug(any[]) | The recommended way to log debug data (level 1) during invocation.
Similar to Node.js's |
error(any[]) | The recommended way to log error data (level 4) during invocation.
Similar to Node.js's |
info(any[]) | The recommended way to log information data (level 2) during invocation.
Similar to Node.js's |
log(any[]) | The recommended way to log data during invocation.
Similar to Node.js's |
trace(any[]) | The recommended way to log trace data (level 0) during invocation.
Similar to Node.js's |
warn(any[]) | The recommended way to log warning data (level 3) during invocation.
Similar to Node.js's |
Constructor Details
InvocationContext(InvocationContextInit)
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
new InvocationContext(init?: InvocationContextInit)
Parameters
Property Details
extraInputs
An object used to get secondary inputs
extraInputs: InvocationContextExtraInputs
Property Value
extraOutputs
An object used to set secondary outputs
extraOutputs: InvocationContextExtraOutputs
Property Value
functionName
The name of the function that is being invoked
functionName: string
Property Value
string
invocationId
A unique guid specific to this invocation
invocationId: string
Property Value
string
options
The options used when registering the function NOTE: This value may differ slightly from the original because it has been validated and defaults may have been explicitly added
options: EffectiveFunctionOptions
Property Value
retryContext
The retry context of the current function execution if the retry policy is defined
retryContext?: RetryContext
Property Value
traceContext
TraceContext information to enable distributed tracing scenarios
traceContext?: TraceContext
Property Value
triggerMetadata
Metadata about the trigger or undefined if the metadata is already represented elsewhere For example, this will be undefined for http and timer triggers because you can find that information on the request & timer object instead
triggerMetadata?: TriggerMetadata
Property Value
Method Details
debug(any[])
The recommended way to log debug data (level 1) during invocation.
Similar to Node.js's console.debug
, but has integration with Azure features like application insights
function debug(args: any[])
Parameters
- args
-
any[]
error(any[])
The recommended way to log error data (level 4) during invocation.
Similar to Node.js's console.error
, but has integration with Azure features like application insights
function error(args: any[])
Parameters
- args
-
any[]
info(any[])
The recommended way to log information data (level 2) during invocation.
Similar to Node.js's console.info
, but has integration with Azure features like application insights
function info(args: any[])
Parameters
- args
-
any[]
log(any[])
The recommended way to log data during invocation.
Similar to Node.js's console.log
, but has integration with Azure features like application insights
Uses the 'information' log level
function log(args: any[])
Parameters
- args
-
any[]
trace(any[])
The recommended way to log trace data (level 0) during invocation.
Similar to Node.js's console.trace
, but has integration with Azure features like application insights
function trace(args: any[])
Parameters
- args
-
any[]
warn(any[])
The recommended way to log warning data (level 3) during invocation.
Similar to Node.js's console.warn
, but has integration with Azure features like application insights
function warn(args: any[])
Parameters
- args
-
any[]