@azure/functions
- Version 4.1.0
- Published
- 566 kB
- 2 dependencies
- MIT license
Install
npm i @azure/functions
yarn add @azure/functions
pnpm add @azure/functions
Overview
Microsoft Azure Functions NodeJS Framework
Index
Classes
Interfaces
CosmosDBv3TriggerOptions
- checkpointDocumentCount
- checkpointInterval
- collectionName
- connectionStringSetting
- createLeaseCollectionIfNotExists
- databaseName
- feedPollDelay
- leaseAcquireInterval
- leaseCollectionName
- leaseCollectionPrefix
- leaseCollectionThroughput
- leaseConnectionStringSetting
- leaseDatabaseName
- leaseExpirationInterval
- leaseRenewInterval
- maxItemsPerInvocation
- preferredLocations
- startFromBeginning
- useMultipleWriteLocations
CosmosDBv4TriggerOptions
- connection
- containerName
- createLeaseContainerIfNotExists
- databaseName
- feedPollDelay
- leaseAcquireInterval
- leaseConnection
- leaseContainerName
- leaseContainerPrefix
- leaseDatabaseName
- leaseExpirationInterval
- leaseRenewInterval
- leasesContainerThroughput
- maxItemsPerInvocation
- preferredLocations
- startFromBeginning
- startFromTime
Type Aliases
- AppStartHandler
- AppTerminateHandler
- CosmosDBFunctionOptions
- CosmosDBHandler
- CosmosDBInput
- CosmosDBInputOptions
- CosmosDBOutput
- CosmosDBOutputOptions
- CosmosDBTrigger
- CosmosDBTriggerOptions
- CosmosDBv3Handler
- CosmosDBv3Input
- CosmosDBv3Output
- CosmosDBv3Trigger
- CosmosDBv4Handler
- CosmosDBv4Input
- CosmosDBv4Output
- CosmosDBv4Trigger
- EventGridHandler
- EventGridOutput
- EventGridOutputOptions
- EventGridTrigger
- EventHubHandler
- EventHubOutput
- EventHubTrigger
- FunctionHandler
- FunctionResult
- HttpHandler
- HttpMethod
- HttpMethodFunctionOptions
- HttpOutput
- HttpRequestParams
- HttpRequestUserType
- LogHandler
- LogLevel
- PostInvocationHandler
- PreInvocationHandler
- RetryOptions
- ServiceBusQueueHandler
- ServiceBusQueueOutput
- ServiceBusQueueTrigger
- ServiceBusTopicHandler
- ServiceBusTopicOutput
- ServiceBusTopicTrigger
- SqlInput
- SqlOutput
- StorageBlobHandler
- StorageBlobInput
- StorageBlobInputOptions
- StorageBlobOutput
- StorageBlobOutputOptions
- StorageBlobTrigger
- StorageQueueHandler
- StorageQueueOutput
- StorageQueueOutputOptions
- StorageQueueTrigger
- StorageQueueTriggerOptions
- TableInput
- TableOutput
- TimerHandler
- TimerTrigger
- TriggerMetadata
- WarmupHandler
- WarmupTrigger
Namespaces
Classes
class AppStartContext
class AppStartContext extends HookContext {}
Context on a function app during app startup.
constructor
constructor(init?: AppStartContextInit);
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
class AppTerminateContext
class AppTerminateContext extends HookContext {}
Context on a function app during app termination.
constructor
constructor(init?: AppTerminateContextInit);
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
class Disposable
class Disposable {}
Represents a type which can release resources, such as event listening or a timer.
constructor
constructor(callOnDispose: () => any);
Creates a new disposable that calls the provided function on dispose. *Note* that an asynchronous function is not awaited.
Parameter callOnDispose
Function that disposes something.
method dispose
dispose: () => any;
Dispose this object.
method from
static from: (...disposableLikes: { dispose: () => any }[]) => Disposable;
Combine many disposable-likes into one. You can use this method when having objects with a dispose function which aren't instances of
Disposable
.Parameter disposableLikes
Objects that have at least a
dispose
-function member. Note that asynchronous dispose-functions aren't awaited. Returns a new disposable which, upon dispose, will dispose all provided disposables.
class HookContext
class HookContext {}
Base class for all hook context objects
constructor
constructor(init?: HookContextInit);
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
property hookData
readonly hookData: Record<string, unknown>;
The recommended place to store and share data between hooks in the same scope (app-level vs invocation-level). You should use a unique property name so that it doesn't conflict with other hooks' data. This object is readonly. You may modify it, but attempting to overwrite it will throw an error
class HttpRequest
class HttpRequest {}
HTTP request object. Provided to your function when using HTTP Bindings.
constructor
constructor(httpRequestInit: HttpRequestInit);
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
property arrayBuffer
readonly arrayBuffer: () => Promise<ArrayBuffer>;
Returns a promise fulfilled with the body as an ArrayBuffer
property blob
readonly blob: () => Promise<Blob>;
Returns a promise fulfilled with the body as a Blob
property body
readonly body: any;
Returns the body as a ReadableStream
property bodyUsed
readonly bodyUsed: boolean;
Returns whether the body has been read from
property formData
readonly formData: () => Promise<FormData>;
Returns a promise fulfilled with the body as FormData
property headers
readonly headers: Headers;
HTTP request headers.
property json
readonly json: () => Promise<unknown>;
Returns a promise fulfilled with the body parsed as JSON
property method
readonly method: string;
HTTP request method used to invoke this function.
property params
readonly params: HttpRequestParams;
Route parameter keys and values.
property query
readonly query: URLSearchParams;
Query string parameter keys and values from the URL.
property text
readonly text: () => Promise<string>;
Returns a promise fulfilled with the body as a string
property url
readonly url: string;
Request URL.
property user
readonly user: HttpRequestUser;
Object representing logged-in user, either through AppService/Functions authentication, or SWA Authentication null when no such user is logged in.
class HttpResponse
class HttpResponse {}
HTTP response class
constructor
constructor(responseInit?: HttpResponseInit);
property arrayBuffer
readonly arrayBuffer: () => Promise<ArrayBuffer>;
Returns a promise fulfilled with the body as an ArrayBuffer
property blob
readonly blob: () => Promise<Blob>;
Returns a promise fulfilled with the body as a Blob
property body
readonly body: any;
Returns the body as a ReadableStream
property bodyUsed
readonly bodyUsed: boolean;
Returns whether the body has been read from
property cookies
readonly cookies: Cookie[];
HTTP response cookies
property enableContentNegotiation
readonly enableContentNegotiation: boolean;
Enable content negotiation of response body if true If false, treat response body as raw false
property formData
readonly formData: () => Promise<FormData>;
Returns a promise fulfilled with the body as FormData
property headers
readonly headers: Headers;
HTTP response headers.
property json
readonly json: () => Promise<unknown>;
Returns a promise fulfilled with the body parsed as JSON
property status
readonly status: number;
HTTP response status code 200
property text
readonly text: () => Promise<string>;
Returns a promise fulfilled with the body as a string
class InvocationContext
class InvocationContext {}
Contains metadata and helper methods specific to this invocation
constructor
constructor(init?: InvocationContextInit);
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
property extraInputs
extraInputs: InvocationContextExtraInputs;
An object used to get secondary inputs
property extraOutputs
extraOutputs: InvocationContextExtraOutputs;
An object used to set secondary outputs
property functionName
functionName: string;
The name of the function that is being invoked
property invocationId
invocationId: string;
A unique guid specific to this invocation
property options
options: EffectiveFunctionOptions;
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
property retryContext
retryContext?: RetryContext;
The retry context of the current function execution if the retry policy is defined
property traceContext
traceContext?: TraceContext;
TraceContext information to enable distributed tracing scenarios
property triggerMetadata
triggerMetadata?: 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
method debug
debug: (...args: any[]) => void;
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
method error
error: (...args: any[]) => void;
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
method info
info: (...args: any[]) => void;
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
method log
log: (...args: any[]) => void;
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
method trace
trace: (...args: any[]) => void;
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
method warn
warn: (...args: any[]) => void;
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
class InvocationHookContext
class InvocationHookContext extends HookContext {}
Base class for all invocation hook context objects
constructor
constructor(init?: InvocationHookContextInit);
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
property invocationContext
readonly invocationContext: InvocationContext;
The context object passed to the function. This object is readonly. You may modify it, but attempting to overwrite it will throw an error
class PostInvocationContext
class PostInvocationContext extends InvocationHookContext {}
Context on a function after it executes.
constructor
constructor(init?: PostInvocationContextInit);
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
property error
error: {};
The error thrown by the function, or null/undefined if there is no error. Changes to this value _will_ affect the overall result of the function
property inputs
inputs: unknown[];
The arguments passed to this specific invocation.
property result
result: {};
The result of the function. Changes to this value _will_ affect the overall result of the function
class PreInvocationContext
class PreInvocationContext extends InvocationHookContext {}
Context on a function before it executes.
constructor
constructor(init?: PreInvocationContextInit);
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
property functionHandler
functionHandler: FunctionHandler;
The function handler for this specific invocation. Changes to this value _will_ affect the function itself
property inputs
inputs: unknown[];
The arguments passed to this specific invocation. Changes to this array _will_ affect the inputs passed to your function
Interfaces
interface AppStartContextInit
interface AppStartContextInit extends HookContextInit {}
Object passed to AppStartContext constructors. For testing purposes only
interface AppTerminateContextInit
interface AppTerminateContextInit extends HookContextInit {}
Object passed to AppTerminateContext constructors. For testing purposes only
interface Cookie
interface Cookie {}
Http response cookie object to "Set-Cookie"
property domain
domain?: string;
Specifies allowed hosts to receive the cookie
property expires
expires?: Date | number;
NOTE: It is generally recommended that you use maxAge over expires. Sets the cookie to expire at a specific date instead of when the client closes. This can be a Javascript Date or Unix time in milliseconds.
property httpOnly
httpOnly?: boolean;
Sets the cookie to be inaccessible to JavaScript's Document.cookie API
property maxAge
maxAge?: number;
Number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately.
property name
name: string;
property path
path?: string;
Specifies URL path that must exist in the requested URL
property sameSite
sameSite?: 'Strict' | 'Lax' | 'None' | undefined;
Can restrict the cookie to not be sent with cross-site requests
property secure
secure?: boolean;
Sets the cookie to only be sent with an encrypted request
property value
value: string;
interface CosmosDBv3FunctionOptions
interface CosmosDBv3FunctionOptions extends CosmosDBv3TriggerOptions, Partial<FunctionOptions> {}
property handler
handler: CosmosDBv3Handler;
property retry
retry?: RetryOptions;
An optional retry policy to rerun a failed execution until either successful completion occurs or the maximum number of retries is reached. Learn more [here](https://learn.microsoft.com/azure/azure-functions/functions-bindings-error-pages)
property trigger
trigger?: CosmosDBv3Trigger;
interface CosmosDBv3InputOptions
interface CosmosDBv3InputOptions {}
property collectionName
collectionName: string;
The name of the collection being monitored
property connectionStringSetting
connectionStringSetting: string;
An app setting (or environment variable) with the Cosmos DB connection string
property databaseName
databaseName: string;
The name of the Azure Cosmos DB database with the collection being monitored
property id
id?: string;
The ID of the document to retrieve. This property supports [binding expressions](https://docs.microsoft.com/azure/azure-functions/functions-bindings-expressions-patterns). Don't set both the id and sqlQuery properties. If you don't set either one, the entire collection is retrieved.
property partitionKey
partitionKey?: string;
Specifies the partition key value for the lookup. May include binding parameters. It is required for lookups in partitioned collections
property preferredLocations
preferredLocations?: string;
Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. For example, East US,South Central US,North Europe
property sqlQuery
sqlQuery?: string;
An Azure Cosmos DB SQL query used for retrieving multiple documents. The property supports runtime bindings, as in this example:
SELECT * FROM c where c.departmentId = {departmentId}
Don't set both the id and sqlQuery properties. If you don't set either one, the entire collection is retrieved.
interface CosmosDBv3OutputOptions
interface CosmosDBv3OutputOptions {}
property collectionName
collectionName: string;
The name of the collection being monitored
property collectionThroughput
collectionThroughput?: number;
When createIfNotExists is true, it defines the [throughput](https://docs.microsoft.com/azure/cosmos-db/set-throughput) of the created collection
property connectionStringSetting
connectionStringSetting: string;
An app setting (or environment variable) with the Cosmos DB connection string
property createIfNotExists
createIfNotExists?: boolean;
A boolean value to indicate whether the collection is created when it doesn't exist. The default is false because new collections are created with reserved throughput, which has cost implications. For more information, see the [pricing page](https://azure.microsoft.com/pricing/details/cosmos-db/).
property databaseName
databaseName: string;
The name of the Azure Cosmos DB database with the collection being monitored
property partitionKey
partitionKey?: string;
When
createIfNotExists
is true, it defines the partition key path for the created collection. May include binding parameters.
property preferredLocations
preferredLocations?: string;
Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. For example, East US,South Central US,North Europe
property useMultipleWriteLocations
useMultipleWriteLocations?: boolean;
When set to true along with preferredLocations, supports multi-region writes in the Azure Cosmos DB service.
interface CosmosDBv3TriggerOptions
interface CosmosDBv3TriggerOptions {}
property checkpointDocumentCount
checkpointDocumentCount?: number;
Customizes the amount of documents between lease checkpoints. Default is after every function call.
property checkpointInterval
checkpointInterval?: number;
When set, it defines, in milliseconds, the interval between lease checkpoints. Default is always after each Function call.
property collectionName
collectionName: string;
The name of the collection being monitored
property connectionStringSetting
connectionStringSetting: string;
An app setting (or environment variable) with the Cosmos DB connection string
property createLeaseCollectionIfNotExists
createLeaseCollectionIfNotExists?: boolean;
Checks for existence and automatically creates the leases collection. Default is
false
property databaseName
databaseName: string;
The name of the Azure Cosmos DB database with the collection being monitored
property feedPollDelay
feedPollDelay?: number;
The time (in milliseconds) for the delay between polling a partition for new changes on the feed, after all current changes are drained. Default is 5,000 milliseconds, or 5 seconds.
property leaseAcquireInterval
leaseAcquireInterval?: number;
When set, it defines, in milliseconds, the interval to kick off a task to compute if partitions are distributed evenly among known host instances. Default is 13000 (13 seconds).
property leaseCollectionName
leaseCollectionName?: string;
The name of the collection to store leases. If not set, it will use "leases"
property leaseCollectionPrefix
leaseCollectionPrefix?: string;
When set, the value is added as a prefix to the leases created in the Lease collection for this function. Using a prefix allows two separate Azure Functions to share the same Lease collection by using different prefixes.
property leaseCollectionThroughput
leaseCollectionThroughput?: number;
When
createLeaseCollectionIfNotExists
is set totrue
, defines the amount of Request Units to assign to the created lease collection
property leaseConnectionStringSetting
leaseConnectionStringSetting?: string;
The name of an app setting that contains the connection string to the service which holds the lease collection. If not set it will connect to the service defined by
connectionStringSetting
property leaseDatabaseName
leaseDatabaseName?: string;
The name of the database that holds the collection to store leases. If not set, it will use the value of
databaseName
property leaseExpirationInterval
leaseExpirationInterval?: number;
When set, it defines, in milliseconds, the interval for which the lease is taken on a lease representing a partition. If the lease is not renewed within this interval, it will cause it to expire and ownership of the partition will move to another instance. Default is 60000 (60 seconds).
property leaseRenewInterval
leaseRenewInterval?: number;
When set, it defines, in milliseconds, the renew interval for all leases for partitions currently held by an instance. Default is 17000 (17 seconds).
property maxItemsPerInvocation
maxItemsPerInvocation?: number;
When set, this property sets the maximum number of items received per Function call. If operations in the monitored container are performed through stored procedures, transaction scope is preserved when reading items from the change feed. As a result, the number of items received could be higher than the specified value so that the items changed by the same transaction are returned as part of one atomic batch.
property preferredLocations
preferredLocations?: string;
Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. For example, East US,South Central US,North Europe
property startFromBeginning
startFromBeginning?: boolean;
This option tells the Trigger to read changes from the beginning of the container's change history instead of starting at the current time. Reading from the beginning only works the first time the trigger starts, as in subsequent runs, the checkpoints are already stored. Setting this option to true when there are leases already created has no effect.
property useMultipleWriteLocations
useMultipleWriteLocations?: boolean;
Enables multi-region accounts for writing to the leases collection.
interface CosmosDBv4FunctionOptions
interface CosmosDBv4FunctionOptions extends CosmosDBv4TriggerOptions, Partial<FunctionOptions> {}
property handler
handler: CosmosDBv4Handler;
property retry
retry?: RetryOptions;
An optional retry policy to rerun a failed execution until either successful completion occurs or the maximum number of retries is reached. Learn more [here](https://learn.microsoft.com/azure/azure-functions/functions-bindings-error-pages)
property trigger
trigger?: CosmosDBv4Trigger;
interface CosmosDBv4InputOptions
interface CosmosDBv4InputOptions {}
property connection
connection: string;
An app setting (or environment variable) with the Cosmos DB connection string
property containerName
containerName: string;
The name of the container being monitored
property databaseName
databaseName: string;
The name of the Azure Cosmos DB database with the container being monitored
property id
id?: string;
The ID of the document to retrieve. This property supports [binding expressions](https://docs.microsoft.com/azure/azure-functions/functions-bindings-expressions-patterns). Don't set both the id and sqlQuery properties. If you don't set either one, the entire container is retrieved.
property partitionKey
partitionKey?: string;
Specifies the partition key value for the lookup. May include binding parameters. It is required for lookups in partitioned containers
property preferredLocations
preferredLocations?: string;
Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. For example, East US,South Central US,North Europe
property sqlQuery
sqlQuery?: string;
An Azure Cosmos DB SQL query used for retrieving multiple documents. The property supports runtime bindings, as in this example:
SELECT * FROM c where c.departmentId = {departmentId}
Don't set both the id and sqlQuery properties. If you don't set either one, the entire container is retrieved.
interface CosmosDBv4OutputOptions
interface CosmosDBv4OutputOptions {}
property connection
connection: string;
An app setting (or environment variable) with the Cosmos DB connection string
property containerName
containerName: string;
The name of the collection being monitored
property containerThroughput
containerThroughput?: number;
When createIfNotExists is true, it defines the [throughput](https://docs.microsoft.com/azure/cosmos-db/set-throughput) of the created collection
property createIfNotExists
createIfNotExists?: boolean;
A boolean value to indicate whether the collection is created when it doesn't exist. The default is false because new collections are created with reserved throughput, which has cost implications. For more information, see the [pricing page](https://azure.microsoft.com/pricing/details/cosmos-db/).
property databaseName
databaseName: string;
The name of the Azure Cosmos DB database with the collection being monitored
property partitionKey
partitionKey?: string;
When
createIfNotExists
is true, it defines the partition key path for the created collection. May include binding parameters.
property preferredLocations
preferredLocations?: string;
Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. For example, East US,South Central US,North Europe
interface CosmosDBv4TriggerOptions
interface CosmosDBv4TriggerOptions {}
property connection
connection: string;
An app setting (or environment variable) with the Cosmos DB connection string
property containerName
containerName: string;
The name of the container being monitored
property createLeaseContainerIfNotExists
createLeaseContainerIfNotExists?: boolean;
Checks for existence and automatically creates the leases container. Default is
false
property databaseName
databaseName: string;
The name of the Azure Cosmos DB database with the container being monitored
property feedPollDelay
feedPollDelay?: number;
The time (in milliseconds) for the delay between polling a partition for new changes on the feed, after all current changes are drained. Default is 5,000 milliseconds, or 5 seconds.
property leaseAcquireInterval
leaseAcquireInterval?: number;
When set, it defines, in milliseconds, the interval to kick off a task to compute if partitions are distributed evenly among known host instances. Default is 13000 (13 seconds).
property leaseConnection
leaseConnection?: string;
The name of an app setting that contains the connection string to the service which holds the lease container. If not set it will connect to the service defined by
connection
property leaseContainerName
leaseContainerName?: string;
The name of the container to store leases. If not set, it will use "leases"
property leaseContainerPrefix
leaseContainerPrefix?: string;
When set, the value is added as a prefix to the leases created in the Lease container for this function. Using a prefix allows two separate Azure Functions to share the same Lease container by using different prefixes.
property leaseDatabaseName
leaseDatabaseName?: string;
The name of the database that holds the container to store leases. If not set, it will use the value of
databaseName
property leaseExpirationInterval
leaseExpirationInterval?: number;
When set, it defines, in milliseconds, the interval for which the lease is taken on a lease representing a partition. If the lease is not renewed within this interval, it will cause it to expire and ownership of the partition will move to another instance. Default is 60000 (60 seconds).
property leaseRenewInterval
leaseRenewInterval?: number;
When set, it defines, in milliseconds, the renew interval for all leases for partitions currently held by an instance. Default is 17000 (17 seconds).
property leasesContainerThroughput
leasesContainerThroughput?: number;
When
createLeaseContainerIfNotExists
is set totrue
, defines the amount of Request Units to assign to the created lease container
property maxItemsPerInvocation
maxItemsPerInvocation?: number;
When set, this property sets the maximum number of items received per Function call. If operations in the monitored container are performed through stored procedures, transaction scope is preserved when reading items from the change feed. As a result, the number of items received could be higher than the specified value so that the items changed by the same transaction are returned as part of one atomic batch.
property preferredLocations
preferredLocations?: string;
Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. For example, East US,South Central US,North Europe
property startFromBeginning
startFromBeginning?: boolean;
This option tells the Trigger to read changes from the beginning of the container's change history instead of starting at the current time. Reading from the beginning only works the first time the trigger starts, as in subsequent runs, the checkpoints are already stored. Setting this option to true when there are leases already created has no effect.
property startFromTime
startFromTime?: string;
Gets or sets the date and time from which to initialize the change feed read operation. The recommended format is ISO 8601 with the UTC designator, such as 2021-02-16T14:19:29Z. This is only used to set the initial trigger state. After the trigger has a lease state, changing this value has no effect.
interface Duration
interface Duration {}
property hours
hours?: number;
property milliseconds
milliseconds?: number;
property minutes
minutes?: number;
property seconds
seconds?: number;
interface EffectiveFunctionOptions
interface EffectiveFunctionOptions {}
The options used when registering the function, as passed to a specific invocation NOTE: This value may differ slightly from the original because it has been validated and defaults may have been explicitly added
property extraInputs
extraInputs: FunctionInput[];
Configuration for an optional set of secondary inputs During invocation, get these values with
context.extraInputs.get()
property extraOutputs
extraOutputs: FunctionOutput[];
Configuration for an optional set of secondary outputs During invocation, set these values with
context.extraOutputs.set()
property return
return?: FunctionOutput;
Configuration for the optional primary output of the function This is the main output that you should set as the return value of the function handler during invocation
property trigger
trigger: FunctionTrigger;
Configuration for the primary input to the function, aka the reason it will be triggered This is the only input that is passed as an argument to the function handler during invocation
interface EventGridEvent
interface EventGridEvent extends EventGridPartialEvent {}
[Link to docs and examples](https://docs.microsoft.com/azure/event-grid/event-schema)
property dataVersion
dataVersion: string;
The schema version of the data object. The publisher defines the schema version.
property metadataVersion
metadataVersion: string;
The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value.
property topic
topic: string;
Full resource path to the event source. This field isn't writeable. Event Grid provides this value
interface EventGridFunctionOptions
interface EventGridFunctionOptions extends EventGridTriggerOptions, Partial<FunctionOptions> {}
interface EventGridOutputConnectionOptions
interface EventGridOutputConnectionOptions {}
property connection
connection: string;
The value of the common prefix for the app setting that contains the
topicEndpointUri
. When setting theconnection
property, thetopicEndpointUri
andtopicKeySetting
properties should NOT be set.
interface EventGridOutputKeyOptions
interface EventGridOutputKeyOptions {}
property topicEndpointUri
topicEndpointUri: string;
An app setting (or environment variable) that contains the URI for the custom topic
property topicKeySetting
topicKeySetting: string;
An app setting (or environment variable) that contains an access key for the custom topic
interface EventGridPartialEvent
interface EventGridPartialEvent {}
[Link to docs and examples](https://docs.microsoft.com/azure/event-grid/event-schema) This "partial" interface is meant to be used when creating an event yourself and allows some properties to be left out
property data
data?: Record<string, unknown>;
Event data specific to the resource provider
property dataVersion
dataVersion?: string;
The schema version of the data object. The publisher defines the schema version. If not included, will be stamped with an empty value
property eventTime
eventTime: string;
The time the event is generated based on the provider's UTC time
property eventType
eventType: string;
One of the registered event types for this event source
property id
id: string;
Unique identifier for the event
property metadataVersion
metadataVersion?: string;
The schema version of the event metadata. Event Grid defines the schema of the top-level properties. Event Grid provides this value. If included, must match the Event Grid Schema
metadataVersion
exactly (currently, only 1). If not included, Event Grid will stamp onto the event.
property subject
subject: string;
Publisher-defined path to the event subject
property topic
topic?: string;
Full resource path to the event source. This field isn't writeable. Event Grid provides this value If included, must match the Event Grid topic Azure Resource Manager ID exactly. If not included, Event Grid will stamp onto the event.
interface EventGridTriggerOptions
interface EventGridTriggerOptions {}
At this point in time there are no event grid trigger-specific options
interface EventHubFunctionOptions
interface EventHubFunctionOptions extends EventHubTriggerOptions, Partial<FunctionOptions> {}
property handler
handler: EventHubHandler;
property retry
retry?: RetryOptions;
An optional retry policy to rerun a failed execution until either successful completion occurs or the maximum number of retries is reached. Learn more [here](https://learn.microsoft.com/azure/azure-functions/functions-bindings-error-pages)
property trigger
trigger?: EventHubTrigger;
interface EventHubOutputOptions
interface EventHubOutputOptions {}
property connection
connection: string;
An app setting (or environment variable) with the event hub connection string
property eventHubName
eventHubName: string;
The name of the event hub. When the event hub name is also present in the connection string, that value overrides this property at runtime.
interface EventHubTriggerOptions
interface EventHubTriggerOptions {}
property cardinality
cardinality?: 'many' | 'one';
Set to
many
in order to enable batching. If omitted or set toone
, a single message is passed to the function.
property connection
connection: string;
An app setting (or environment variable) with the event hub connection string
property consumerGroup
consumerGroup?: string;
An optional property that sets the [consumer group](https://docs.microsoft.com/azure/event-hubs/event-hubs-features#event-consumers) used to subscribe to events in the hub. If omitted, the
$Default
consumer group is used.
property eventHubName
eventHubName: string;
The name of the event hub. When the event hub name is also present in the connection string, that value overrides this property at runtime.
interface Exception
interface Exception {}
property message
message?: string;
property source
source?: string;
property stackTrace
stackTrace?: string;
interface ExponentialBackoffRetryOptions
interface ExponentialBackoffRetryOptions {}
property maximumInterval
maximumInterval: Duration | number;
The maximum retry delay. This can be a number in milliseconds, or a Duration object
property maxRetryCount
maxRetryCount: number;
The maximum number of retries allowed per function execution. -1 means to retry indefinitely.
property minimumInterval
minimumInterval: Duration | number;
The minimum retry delay. This can be a number in milliseconds, or a Duration object
property strategy
strategy: 'exponentialBackoff';
The first retry waits for the minimum delay. On subsequent retries, time is added exponentially to the initial duration for each retry, until the maximum delay is reached. Exponential back-off adds some small randomization to delays to stagger retries in high-throughput scenarios.
interface FixedDelayRetryOptions
interface FixedDelayRetryOptions {}
property delayInterval
delayInterval: Duration | number;
The delay that's used between retries. This can be a number in milliseconds or a Duration object
property maxRetryCount
maxRetryCount: number;
The maximum number of retries allowed per function execution. -1 means to retry indefinitely.
property strategy
strategy: 'fixedDelay';
A specified amount of time is allowed to elapse between each retry.
interface FunctionInput
interface FunctionInput extends Record<string, unknown> {}
Full configuration for the secondary input to a function ("trigger" is the primary input) NOTE: Not all triggers can be used as secondary inputs
property name
name: string;
Must be unique within this function. If using the
input
namespace to create this object, the name will be auto-generated for you
property type
type: string;
The type for this trigger ('blob', 'cosmosDB', etc.) If using the
input
namespace to create this object, the type will be set for you
interface FunctionOptions
interface FunctionOptions {}
Configures the inputs, outputs, and handler for an Azure Function
property extraInputs
extraInputs?: FunctionInput[];
Configuration for an optional set of secondary inputs During invocation, get these values with
context.extraInputs.get()
property extraOutputs
extraOutputs?: FunctionOutput[];
Configuration for an optional set of secondary outputs During invocation, set these values with
context.extraOutputs.set()
property handler
handler: FunctionHandler;
The code that will be executed when your function is triggered
property return
return?: FunctionOutput;
Configuration for the optional primary output of the function This is the main output that you should set as the return value of the function handler during invocation
property trigger
trigger: FunctionTrigger;
Configuration for the primary input to the function, aka the reason it will be triggered This is the only input that is passed as an argument to the function handler during invocation
interface FunctionOutput
interface FunctionOutput extends Record<string, unknown> {}
Full configuration for the output to a function
property name
name: string;
Must be unique within this function. If using the
output
namespace to create this object, the name will be auto-generated for you
property type
type: string;
The type for this output ('http', 'blob', 'queue', etc.) If using the
output
namespace to create this object, the type will be set for you
interface FunctionTrigger
interface FunctionTrigger extends Record<string, unknown> {}
Full configuration for the primary input to a function
property name
name: string;
Must be unique within this function. If using the
trigger
namespace to create this object, the name will be auto-generated for you
property type
type: string;
The type for this trigger ('httpTrigger', 'timerTrigger', etc.) If using the
trigger
namespace to create this object, the type will be set for you
interface GenericFunctionOptions
interface GenericFunctionOptions extends FunctionOptions {}
property retry
retry?: RetryOptions;
An optional retry policy to rerun a failed execution until either successful completion occurs or the maximum number of retries is reached. Learn more [here](https://learn.microsoft.com/azure/azure-functions/functions-bindings-error-pages)
interface GenericInputOptions
interface GenericInputOptions extends Record<string, unknown> {}
property type
type: string;
interface GenericOutputOptions
interface GenericOutputOptions extends Record<string, unknown> {}
property type
type: string;
interface GenericTriggerOptions
interface GenericTriggerOptions extends Record<string, unknown> {}
property type
type: string;
interface HookContextInit
interface HookContextInit {}
Base interface for objects passed to HookContext constructors. For testing purposes only.
property hookData
hookData?: Record<string, unknown>;
interface HttpFunctionOptions
interface HttpFunctionOptions extends HttpTriggerOptions, Partial<FunctionOptions> {}
property handler
handler: HttpHandler;
property return
return?: FunctionOutput;
Configuration for the optional primary output of the function. If not set, this will default to a standard http response output This is the main output that you should set as the return value of the function handler during invocation
property trigger
trigger?: HttpTrigger;
interface HttpOutputOptions
interface HttpOutputOptions {}
At this point in time there are no http output specific options
interface HttpRequestBodyInit
interface HttpRequestBodyInit {}
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
interface HttpRequestInit
interface HttpRequestInit {}
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
interface HttpRequestUser
interface HttpRequestUser {}
Object representing logged-in user, either through AppService/Functions authentication, or SWA Authentication
property claimsPrincipalData
claimsPrincipalData: Record<string, unknown>;
Extra authentication information, dependent on auth type and auth provider
property id
id: string;
unique user GUID
property identityProvider
identityProvider: string;
provider of authentication service
property type
type: HttpRequestUserType;
Type of authentication, either AppService or StaticWebApps
property username
username: string;
unique username
interface HttpResponseInit
interface HttpResponseInit {}
property body
body?: BodyInit;
HTTP response body
property cookies
cookies?: Cookie[];
HTTP response cookies
property enableContentNegotiation
enableContentNegotiation?: boolean;
Enable content negotiation of response body if true If false, treat response body as raw false
property headers
headers?: HeadersInit;
HTTP response headers
property jsonBody
jsonBody?: any;
A JSON-serializable HTTP Response body. If set, the
HttpResponseInit.body
property will be ignored in favor of this property
property status
status?: number;
HTTP response status code 200
interface HttpTrigger
interface HttpTrigger extends FunctionTrigger {}
interface HttpTriggerOptions
interface HttpTriggerOptions {}
property authLevel
authLevel?: 'anonymous' | 'function' | 'admin';
The function HTTP authorization level Defaults to 'anonymous' if not specified
property methods
methods?: HttpMethod[];
An array of the http methods for this http input Defaults to ["get", "post"] if not specified
property route
route?: string;
The route for this http input. If not specified, the function name will be used
interface InvocationContextExtraInputs
interface InvocationContextExtraInputs {}
An object used to get secondary inputs
method get
get: { (input: StorageBlobInput): unknown; (input: TableInput): unknown; (input: CosmosDBInput): unknown; (input: SqlInput): unknown; (inputOrName: string | FunctionInput): unknown;};
Get a secondary storage blob entry input for this invocation the configuration object for this storage blob input
Get a secondary table input for this invocation the configuration object for this table input
Get a secondary Cosmos DB documents input for this invocation the configuration object for this Cosmos DB input
Get a secondary SQL items input for this invocation the configuration object for this SQL input
Get a secondary generic input for this invocation the configuration object or name for this input
method set
set: (inputOrName: FunctionInput | string, value: unknown) => void;
Set a secondary generic input for this invocation the configuration object or name for this input the input value
interface InvocationContextExtraOutputs
interface InvocationContextExtraOutputs {}
An object used to set secondary outputs
method get
get: (outputOrName: FunctionOutput | string) => unknown;
Get a secondary generic output for this invocation the configuration object or name for this output
method set
set: { (output: HttpOutput, response: HttpResponse): void; (output: StorageBlobOutput, blob: unknown): void; (output: TableOutput, tableEntity: unknown): void; (output: StorageQueueOutput, queueItem: unknown): void; (output: CosmosDBOutput, documents: unknown): void; (output: SqlOutput, items: unknown): void; (output: ServiceBusQueueOutput, messages: unknown): void; (output: ServiceBusTopicOutput, messages: unknown): void; (output: EventHubOutput, messages: unknown): void; ( output: EventGridOutput, events: EventGridPartialEvent | EventGridPartialEvent[] ): void; (outputOrName: string | FunctionOutput, value: unknown): void;};
Set a secondary http response output for this invocation the configuration object for this http output the http response output value
Set a secondary storage blob entry output for this invocation the configuration object for this storage blob output the blob output value
Set a secondary table output for this invocation the configuration object for this table output the table output value
Set a secondary storage queue entry output for this invocation the configuration object for this storage queue output the queue entry output value
Set a secondary Cosmos DB documents output for this invocation the configuration object for this Cosmos DB output the output document(s) value
Set a secondary SQL items output for this invocation the configuration object for this SQL output the output item(s) value
Set a secondary Service Bus queue output for this invocation the configuration object for this Service Bus output the output message(s) value
Set a secondary Service Bus topic output for this invocation the configuration object for this Service Bus output the output message(s) value
Set a secondary Event Hub output for this invocation the configuration object for this EventHub output the output message(s) value
Set a secondary Event Grid output for this invocation the configuration object for this Event Grid output the output event(s) value
Set a secondary generic output for this invocation the configuration object or name for this output the output value
interface InvocationContextInit
interface InvocationContextInit {}
For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
property functionName
functionName?: string;
Defaults to 'unknown' if not specified
property invocationId
invocationId?: string;
Defaults to 'unknown' if not specified
property logHandler
logHandler?: LogHandler;
Defaults to Node.js console if not specified
property options
options?: Partial<EffectiveFunctionOptions>;
Defaults to a trigger with 'unknown' type and name if not specified
property retryContext
retryContext?: RetryContext;
property traceContext
traceContext?: TraceContext;
property triggerMetadata
triggerMetadata?: TriggerMetadata;
interface InvocationHookContextInit
interface InvocationHookContextInit extends HookContextInit {}
Object passed to InvocationHookContext constructors. For testing purposes only
property inputs
inputs?: unknown[];
property invocationContext
invocationContext?: InvocationContext;
interface PostInvocationContextInit
interface PostInvocationContextInit extends InvocationHookContextInit {}
Object passed to PostInvocationContext constructors. For testing purposes only
interface PreInvocationContextInit
interface PreInvocationContextInit extends InvocationHookContextInit {}
Object passed to PreInvocationContext constructors. For testing purposes only
property functionCallback
functionCallback?: FunctionHandler;
interface RetryContext
interface RetryContext {}
property exception
exception?: Exception;
Exception that caused the retry
property maxRetryCount
maxRetryCount: number;
Max retry count is the maximum number of times an execution is retried before eventual failure. A value of -1 means to retry indefinitely.
property retryCount
retryCount: number;
Current retry count of the function executions.
interface ServiceBusQueueFunctionOptions
interface ServiceBusQueueFunctionOptions extends ServiceBusQueueTriggerOptions, Partial<FunctionOptions> {}
interface ServiceBusQueueOutputOptions
interface ServiceBusQueueOutputOptions {}
property connection
connection: string;
An app setting (or environment variable) with the service bus connection string
property queueName
queueName: string;
The name of the queue to monitor
interface ServiceBusQueueTriggerOptions
interface ServiceBusQueueTriggerOptions {}
property cardinality
cardinality?: 'many' | 'one';
Set to
many
in order to enable batching. If omitted or set toone
, a single message is passed to the function.
property connection
connection: string;
An app setting (or environment variable) with the service bus connection string
property isSessionsEnabled
isSessionsEnabled?: boolean;
true
if connecting to a [session-aware](https://docs.microsoft.com/azure/service-bus-messaging/message-sessions) queue. Default isfalse
property queueName
queueName: string;
The name of the queue to monitor
interface ServiceBusTopicFunctionOptions
interface ServiceBusTopicFunctionOptions extends ServiceBusTopicTriggerOptions, Partial<FunctionOptions> {}
interface ServiceBusTopicOutputOptions
interface ServiceBusTopicOutputOptions {}
property connection
connection: string;
An app setting (or environment variable) with the service bus connection string
property topicName
topicName: string;
The name of the topic to monitor
interface ServiceBusTopicTriggerOptions
interface ServiceBusTopicTriggerOptions {}
property cardinality
cardinality?: 'many' | 'one';
Set to
many
in order to enable batching. If omitted or set toone
, a single message is passed to the function.
property connection
connection: string;
An app setting (or environment variable) with the service bus connection string
property isSessionsEnabled
isSessionsEnabled?: boolean;
true
if connecting to a [session-aware](https://docs.microsoft.com/azure/service-bus-messaging/message-sessions) subscription. Default isfalse
property subscriptionName
subscriptionName: string;
The name of the subscription to monitor
property topicName
topicName: string;
The name of the topic to monitor
interface SqlInputOptions
interface SqlInputOptions {}
property commandText
commandText: string;
The Transact-SQL query command or name of the stored procedure executed by the binding.
property commandType
commandType: 'Text' | 'StoredProcedure';
The command type value
property connectionStringSetting
connectionStringSetting: string;
An app setting (or environment variable) with the connection string for the database against which the query or stored procedure is being executed
property parameters
parameters?: string;
Zero or more parameter values passed to the command during execution as a single string. Must follow the format @param1=param1,@param2=param2. Neither the parameter name nor the parameter value can contain a comma (,) or an equals sign (=).
interface SqlOutputOptions
interface SqlOutputOptions {}
property commandText
commandText: string;
The name of the table being written to by the binding.
property connectionStringSetting
connectionStringSetting: string;
An app setting (or environment variable) with the connection string for the database to which data is being written
interface StorageBlobFunctionOptions
interface StorageBlobFunctionOptions extends StorageBlobTriggerOptions, Partial<FunctionOptions> {}
interface StorageBlobOptions
interface StorageBlobOptions {}
property connection
connection: string;
An app setting (or environment variable) with the storage connection string to be used by this blob input or output
property path
path: string;
The path to the blob container, for example "samples-workitems/{name}"
interface StorageBlobTriggerOptions
interface StorageBlobTriggerOptions extends StorageBlobOptions {}
property source
source?: 'EventGrid' | 'LogsAndContainerScan';
The source of the triggering event. Use
EventGrid
for an Event Grid-based blob trigger, which provides much lower latency. The default isLogsAndContainerScan
, which uses the standard polling mechanism to detect changes in the container.
interface StorageQueueFunctionOptions
interface StorageQueueFunctionOptions extends StorageQueueTriggerOptions, Partial<FunctionOptions> {}
interface StorageQueueOptions
interface StorageQueueOptions {}
property connection
connection: string;
An app setting (or environment variable) with the storage connection string to be used by this queue input or output
property queueName
queueName: string;
The queue name
interface TableInputOptions
interface TableInputOptions {}
property connection
connection: string;
An app setting (or environment variable) with the storage connection string to be used by this table input
property filter
filter?: string;
An OData filter expression for the entities to return from the table. Can't be used with
rowKey
.
property partitionKey
partitionKey?: string;
The partition key of the table entity to read.
property rowKey
rowKey?: string;
The row key of the table entity to read. Can't be used with
take
orfilter
.
property tableName
tableName: string;
The table name
property take
take?: number;
The maximum number of entities to return. Can't be used with
rowKey
interface TableOutputOptions
interface TableOutputOptions {}
property connection
connection: string;
An app setting (or environment variable) with the storage connection string to be used by this table output
property partitionKey
partitionKey?: string;
The partition key of the table entity to write.
property rowKey
rowKey?: string;
The row key of the table entity to write.
property tableName
tableName: string;
The table name
interface Timer
interface Timer {}
Timer schedule information. Provided to your function when using a timer binding.
property isPastDue
isPastDue: boolean;
Whether this timer invocation is due to a missed schedule occurrence.
property schedule
schedule: { /** * Whether intervals between invocations should account for DST. */ adjustForDST: boolean;};
property scheduleStatus
scheduleStatus: { /** * The last recorded schedule occurrence. Date ISO string. */ last: string; /** * The expected next schedule occurrence. Date ISO string. */ next: string; /** * The last time this record was updated. This is used to re-calculate `next` with the current schedule after a host restart. Date ISO string. */ lastUpdated: string;};
interface TimerFunctionOptions
interface TimerFunctionOptions extends TimerTriggerOptions, Partial<FunctionOptions> {}
property handler
handler: TimerHandler;
property retry
retry?: RetryOptions;
An optional retry policy to rerun a failed execution until either successful completion occurs or the maximum number of retries is reached. Learn more [here](https://learn.microsoft.com/azure/azure-functions/functions-bindings-error-pages)
property trigger
trigger?: TimerTrigger;
interface TimerTriggerOptions
interface TimerTriggerOptions {}
property runOnStartup
runOnStartup?: boolean;
If
true
, the function is invoked when the runtime starts. For example, the runtime starts when the function app wakes up after going idle due to inactivity, when the function app restarts due to function changes, and when the function app scales out. _Use with caution_. runOnStartup should rarely if ever be set totrue
, especially in production.
property schedule
schedule: string;
A [cron expression](https://docs.microsoft.com/azure/azure-functions/functions-bindings-timer?pivots=programming-language-javascript#ncrontab-expressions) of the format '{second} {minute} {hour} {day} {month} {day of week}' to specify the schedule
property useMonitor
useMonitor?: boolean;
When true, schedule will be persisted to aid in maintaining the correct schedule even through restarts. Defaults to true for schedules with interval >= 1 minute
interface TraceContext
interface TraceContext {}
TraceContext information to enable distributed tracing scenarios
property attributes
attributes?: Record<string, string>;
Holds additional properties being sent as part of request telemetry
property traceParent
traceParent?: string | undefined;
Describes the position of the incoming request in its trace graph in a portable, fixed-length format
property traceState
traceState?: string | undefined;
Extends traceparent with vendor-specific data
interface WarmupContext
interface WarmupContext {}
interface WarmupFunctionOptions
interface WarmupFunctionOptions extends WarmupTriggerOptions, Partial<FunctionOptions> {}
interface WarmupTriggerOptions
interface WarmupTriggerOptions {}
Type Aliases
type AppStartHandler
type AppStartHandler = (context: AppStartContext) => void | Promise<void>;
Handler for app start hooks
type AppTerminateHandler
type AppTerminateHandler = (context: AppTerminateContext) => void | Promise<void>;
Handler for app terminate hooks
type CosmosDBFunctionOptions
type CosmosDBFunctionOptions = CosmosDBv3FunctionOptions | CosmosDBv4FunctionOptions;
type CosmosDBHandler
type CosmosDBHandler = CosmosDBv3Handler | CosmosDBv4Handler;
type CosmosDBInput
type CosmosDBInput = CosmosDBv3Input | CosmosDBv4Input;
type CosmosDBInputOptions
type CosmosDBInputOptions = CosmosDBv3InputOptions | CosmosDBv4InputOptions;
type CosmosDBOutput
type CosmosDBOutput = CosmosDBv3Output | CosmosDBv4Output;
type CosmosDBOutputOptions
type CosmosDBOutputOptions = CosmosDBv3OutputOptions | CosmosDBv4OutputOptions;
type CosmosDBTrigger
type CosmosDBTrigger = CosmosDBv3Trigger | CosmosDBv4Trigger;
type CosmosDBTriggerOptions
type CosmosDBTriggerOptions = CosmosDBv3TriggerOptions | CosmosDBv4TriggerOptions;
type CosmosDBv3Handler
type CosmosDBv3Handler = ( documents: unknown[], context: InvocationContext) => FunctionResult;
type CosmosDBv3Input
type CosmosDBv3Input = FunctionInput & CosmosDBv3InputOptions;
type CosmosDBv3Output
type CosmosDBv3Output = FunctionOutput & CosmosDBv3OutputOptions;
type CosmosDBv3Trigger
type CosmosDBv3Trigger = FunctionTrigger & CosmosDBv3TriggerOptions;
type CosmosDBv4Handler
type CosmosDBv4Handler = ( documents: unknown[], context: InvocationContext) => FunctionResult;
type CosmosDBv4Input
type CosmosDBv4Input = FunctionInput & CosmosDBv4InputOptions;
type CosmosDBv4Output
type CosmosDBv4Output = FunctionOutput & CosmosDBv4OutputOptions;
type CosmosDBv4Trigger
type CosmosDBv4Trigger = FunctionTrigger & CosmosDBv4TriggerOptions;
type EventGridHandler
type EventGridHandler = ( event: EventGridEvent, context: InvocationContext) => FunctionResult;
type EventGridOutput
type EventGridOutput = FunctionOutput & EventGridOutputOptions;
type EventGridOutputOptions
type EventGridOutputOptions = | EventGridOutputKeyOptions | EventGridOutputConnectionOptions;
type EventGridTrigger
type EventGridTrigger = FunctionTrigger & EventGridTriggerOptions;
type EventHubHandler
type EventHubHandler = ( messages: unknown, context: InvocationContext) => FunctionResult;
type EventHubOutput
type EventHubOutput = FunctionOutput & EventHubOutputOptions;
type EventHubTrigger
type EventHubTrigger = FunctionTrigger & EventHubTriggerOptions;
type FunctionHandler
type FunctionHandler = ( triggerInput: any, context: InvocationContext) => FunctionResult<any>;
type FunctionResult
type FunctionResult<T = unknown> = T | Promise<T>;
Void if no
return
output is registered Otherwise, the registeredreturn
output
type HttpHandler
type HttpHandler = ( request: HttpRequest, context: InvocationContext) => FunctionResult<HttpResponseInit | HttpResponse>;
type HttpMethod
type HttpMethod = | 'GET' | 'POST' | 'DELETE' | 'HEAD' | 'PATCH' | 'PUT' | 'OPTIONS' | 'TRACE' | 'CONNECT';
Possible values for an HTTP request method.
type HttpMethodFunctionOptions
type HttpMethodFunctionOptions = Omit<HttpFunctionOptions, 'methods'>;
type HttpOutput
type HttpOutput = FunctionOutput & HttpOutputOptions;
type HttpRequestParams
type HttpRequestParams = Record<string, string>;
Route parameter keys and values.
type HttpRequestUserType
type HttpRequestUserType = 'AppService' | 'StaticWebApps';
Possible values for an HTTP Request user type
type LogHandler
type LogHandler = (level: LogLevel, ...args: unknown[]) => void;
type LogLevel
type LogLevel = | 'trace' | 'debug' | 'information' | 'warning' | 'error' | 'critical' | 'none';
type PostInvocationHandler
type PostInvocationHandler = ( context: PostInvocationContext) => void | Promise<void>;
Handler for post-invocation hooks
type PreInvocationHandler
type PreInvocationHandler = (context: PreInvocationContext) => void | Promise<void>;
Handler for pre-invocation hooks.
type RetryOptions
type RetryOptions = FixedDelayRetryOptions | ExponentialBackoffRetryOptions;
type ServiceBusQueueHandler
type ServiceBusQueueHandler = ( messages: unknown, context: InvocationContext) => FunctionResult;
type ServiceBusQueueOutput
type ServiceBusQueueOutput = FunctionOutput & ServiceBusQueueOutputOptions;
type ServiceBusQueueTrigger
type ServiceBusQueueTrigger = FunctionTrigger & ServiceBusQueueTriggerOptions;
type ServiceBusTopicHandler
type ServiceBusTopicHandler = ( message: unknown, context: InvocationContext) => FunctionResult;
type ServiceBusTopicOutput
type ServiceBusTopicOutput = FunctionOutput & ServiceBusTopicOutputOptions;
type ServiceBusTopicTrigger
type ServiceBusTopicTrigger = FunctionTrigger & ServiceBusTopicTriggerOptions;
type SqlInput
type SqlInput = FunctionInput & SqlInputOptions;
type SqlOutput
type SqlOutput = FunctionOutput & SqlOutputOptions;
type StorageBlobHandler
type StorageBlobHandler = ( blob: unknown, context: InvocationContext) => FunctionResult;
type StorageBlobInput
type StorageBlobInput = FunctionInput & StorageBlobInputOptions;
type StorageBlobInputOptions
type StorageBlobInputOptions = StorageBlobOptions;
type StorageBlobOutput
type StorageBlobOutput = FunctionOutput & StorageBlobOutputOptions;
type StorageBlobOutputOptions
type StorageBlobOutputOptions = StorageBlobOptions;
type StorageBlobTrigger
type StorageBlobTrigger = FunctionTrigger & StorageBlobTriggerOptions;
type StorageQueueHandler
type StorageQueueHandler = ( queueEntry: unknown, context: InvocationContext) => FunctionResult;
type StorageQueueOutput
type StorageQueueOutput = FunctionOutput & StorageQueueOutputOptions;
type StorageQueueOutputOptions
type StorageQueueOutputOptions = StorageQueueOptions;
type StorageQueueTrigger
type StorageQueueTrigger = FunctionTrigger & StorageQueueTriggerOptions;
type StorageQueueTriggerOptions
type StorageQueueTriggerOptions = StorageQueueOptions;
type TableInput
type TableInput = FunctionInput & TableInputOptions;
type TableOutput
type TableOutput = FunctionOutput & TableOutputOptions;
type TimerHandler
type TimerHandler = (myTimer: Timer, context: InvocationContext) => FunctionResult;
type TimerTrigger
type TimerTrigger = FunctionTrigger & TimerTriggerOptions;
type TriggerMetadata
type TriggerMetadata = Record<string, unknown>;
Metadata related to the input that triggered your function
type WarmupHandler
type WarmupHandler = ( warmupContext: WarmupContext, context: InvocationContext) => FunctionResult;
type WarmupTrigger
type WarmupTrigger = FunctionTrigger & WarmupTriggerOptions;
Namespaces
namespace app
module 'types/app.d.ts' {}
Registers an http function in your app that will be triggered by making a request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function cosmosDB
cosmosDB: (name: string, options: CosmosDBFunctionOptions) => void;
Registers a Cosmos DB function in your app that will be triggered whenever inserts and updates occur (not deletions)
Parameter name
The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function deleteRequest
deleteRequest: { (name: string, handler: HttpHandler): void; (name: string, options: HttpMethodFunctionOptions): void;};
Registers an http function in your app that will be triggered by making a 'DELETE' request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter handler
The handler for this function
Registers an http function in your app that will be triggered by making a 'DELETE' request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function eventGrid
eventGrid: (name: string, options: EventGridFunctionOptions) => void;
Registers a function in your app that will be triggered whenever an event is sent by an event grid source
Parameter name
The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function eventHub
eventHub: (name: string, options: EventHubFunctionOptions) => void;
Registers a function in your app that will be triggered whenever a message is added to an event hub
Parameter name
The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function generic
generic: (name: string, options: GenericFunctionOptions) => void;
Registers a generic function in your app that will be triggered based on the type specified in
options.trigger.type
Use this method if your desired trigger type does not already have its own methodParameter name
The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function get
get: { (name: string, handler: HttpHandler): void; (name: string, options: HttpMethodFunctionOptions): void;};
Registers an http function in your app that will be triggered by making a 'GET' request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter handler
The handler for this function
Registers an http function in your app that will be triggered by making a 'GET' request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function http
http: (name: string, options: HttpFunctionOptions) => void;
Registers an http function in your app that will be triggered by making a request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function patch
patch: { (name: string, handler: HttpHandler): void; (name: string, options: HttpMethodFunctionOptions): void;};
Registers an http function in your app that will be triggered by making a 'PATCH' request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter handler
The handler for this function
Registers an http function in your app that will be triggered by making a 'PATCH' request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function post
post: { (name: string, handler: HttpHandler): void; (name: string, options: HttpMethodFunctionOptions): void;};
Registers an http function in your app that will be triggered by making a 'POST' request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter handler
The handler for this function
Registers an http function in your app that will be triggered by making a 'POST' request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function put
put: { (name: string, handler: HttpHandler): void; (name: string, options: HttpMethodFunctionOptions): void;};
Registers an http function in your app that will be triggered by making a 'PUT' request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter handler
The handler for this function
Registers an http function in your app that will be triggered by making a 'PUT' request to the function url
Parameter name
The name of the function. This will be the route unless a route is explicitly configured in the
HttpTriggerOptions
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function serviceBusQueue
serviceBusQueue: (name: string, options: ServiceBusQueueFunctionOptions) => void;
Registers a function in your app that will be triggered whenever a message is added to a service bus queue
Parameter name
The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function serviceBusTopic
serviceBusTopic: (name: string, options: ServiceBusTopicFunctionOptions) => void;
Registers a function in your app that will be triggered whenever a message is added to a service bus topic
Parameter name
The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function storageBlob
storageBlob: (name: string, options: StorageBlobFunctionOptions) => void;
Registers a function in your app that will be triggered whenever an item is added to a storage blob path
Parameter name
The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function storageQueue
storageQueue: (name: string, options: StorageQueueFunctionOptions) => void;
Registers a function in your app that will be triggered whenever an item is added to a storage queue
Parameter name
The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function timer
timer: (name: string, options: TimerFunctionOptions) => void;
Registers a timer function in your app that will be triggered on a schedule
Parameter name
The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
function warmup
warmup: (name: string, options: WarmupFunctionOptions) => void;
Registers a function in your app that will be triggered when an instance is added to scale a running function app. The warmup trigger is only called during scale-out operations, not during restarts or other non-scale startups. Make sure your logic can load all required dependencies without relying on the warmup trigger. Lazy loading is a good pattern to achieve this goal. The warmup trigger isn't available to apps running on the Consumption plan. For more information, please see the [Azure Functions warmup trigger documentation](https://learn.microsoft.com/azure/azure-functions/functions-bindings-warmup?tabs=isolated-process&pivots=programming-language-javascript).
Parameter name
The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
Parameter options
Configuration options describing the inputs, outputs, and handler for this function
namespace hook
module 'types/hooks/registerHook.d.ts' {}
Register a hook to be run at the start of your application
Parameter handler
the handler for the hook
Returns
a
Disposable
object that can be used to unregister the hook
function appStart
appStart: (handler: AppStartHandler) => Disposable;
Register a hook to be run at the start of your application
Parameter handler
the handler for the hook
Returns
a
Disposable
object that can be used to unregister the hook
function appTerminate
appTerminate: (handler: AppTerminateHandler) => Disposable;
Register a hook to be run during graceful shutdown of your application. This hook will not be executed if your application is terminated forcefully. Hooks have a limited time to execute during the termination grace period.
Parameter handler
the handler for the hook
Returns
a
Disposable
object that can be used to unregister the hook
function postInvocation
postInvocation: (handler: PostInvocationHandler) => Disposable;
Register a hook to be run after a function is invoked.
Parameter handler
the handler for the hook
Returns
a
Disposable
object that can be used to unregister the hook
function preInvocation
preInvocation: (handler: PreInvocationHandler) => Disposable;
Register a hook to be run before a function is invoked.
Parameter handler
the handler for the hook
Returns
a
Disposable
object that can be used to unregister the hook
namespace input
module 'types/input.d.ts' {}
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-input?pivots=programming-language-javascript)
function cosmosDB
cosmosDB: (options: CosmosDBInputOptions) => CosmosDBInput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-cosmosdb-v2-input?pivots=programming-language-javascript)
function generic
generic: (options: GenericInputOptions) => FunctionInput;
A generic option that can be used for any input type Use this method if your desired input type does not already have its own method
function sql
sql: (options: SqlInputOptions) => SqlInput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-azure-sql-input?pivots=programming-language-javascript)
function storageBlob
storageBlob: (options: StorageBlobInputOptions) => StorageBlobInput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-input?pivots=programming-language-javascript)
function table
table: (options: TableInputOptions) => TableInput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-table-input?pivots=programming-language-javascript)
namespace output
module 'types/output.d.ts' {}
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-http-webhook-output?&pivots=programming-language-javascript)
function cosmosDB
cosmosDB: (options: CosmosDBOutputOptions) => CosmosDBOutput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-cosmosdb-v2-output?pivots=programming-language-javascript)
function eventGrid
eventGrid: (options: EventGridOutputOptions) => EventGridOutput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-event-grid-output?pivots=programming-language-javascript)
function eventHub
eventHub: (options: EventHubOutputOptions) => EventHubOutput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-event-hubs-output?pivots=programming-language-javascript)
function generic
generic: (options: GenericOutputOptions) => FunctionOutput;
A generic option that can be used for any output type Use this method if your desired output type does not already have its own method
function http
http: (options: HttpOutputOptions) => HttpOutput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-http-webhook-output?&pivots=programming-language-javascript)
function serviceBusQueue
serviceBusQueue: ( options: ServiceBusQueueOutputOptions) => ServiceBusQueueOutput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-service-bus-output?pivots=programming-language-javascript)
function serviceBusTopic
serviceBusTopic: ( options: ServiceBusTopicOutputOptions) => ServiceBusTopicOutput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-service-bus-output?pivots=programming-language-javascript)
function sql
sql: (options: SqlOutputOptions) => SqlOutput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-azure-sql-output?pivots=programming-language-javascript)
function storageBlob
storageBlob: (options: StorageBlobOutputOptions) => StorageBlobOutput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-output?pivots=programming-language-javascript)
function storageQueue
storageQueue: (options: StorageQueueOutputOptions) => StorageQueueOutput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-queue-output?pivots=programming-language-javascript)
function table
table: (options: TableOutputOptions) => TableOutput;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-table-output?pivots=programming-language-javascript)
namespace trigger
module 'types/trigger.d.ts' {}
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-http-webhook-trigger?&pivots=programming-language-javascript)
function cosmosDB
cosmosDB: (options: CosmosDBTriggerOptions) => CosmosDBTrigger;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-cosmosdb-v2-trigger?pivots=programming-language-javascript)
function eventGrid
eventGrid: (options: EventGridTriggerOptions) => EventGridTrigger;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-event-grid-trigger?pivots=programming-language-javascript)
function eventHub
eventHub: (options: EventHubTriggerOptions) => EventHubTrigger;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-event-hubs-trigger?pivots=programming-language-javascript)
function generic
generic: (options: GenericTriggerOptions) => FunctionTrigger;
A generic option that can be used for any trigger type Use this method if your desired trigger type does not already have its own method
function http
http: (options: HttpTriggerOptions) => HttpTrigger;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-http-webhook-trigger?&pivots=programming-language-javascript)
function serviceBusQueue
serviceBusQueue: ( options: ServiceBusQueueTriggerOptions) => ServiceBusQueueTrigger;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-service-bus-trigger?pivots=programming-language-javascript)
function serviceBusTopic
serviceBusTopic: ( options: ServiceBusTopicTriggerOptions) => ServiceBusTopicTrigger;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-service-bus-trigger?pivots=programming-language-javascript)
function storageBlob
storageBlob: (options: StorageBlobTriggerOptions) => StorageBlobTrigger;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-trigger?pivots=programming-language-javascript)
function storageQueue
storageQueue: (options: StorageQueueTriggerOptions) => StorageQueueTrigger;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-storage-queue-trigger?pivots=programming-language-javascript)
function timer
timer: (options: TimerTriggerOptions) => TimerTrigger;
[Link to docs and examples](https://docs.microsoft.com/azure/azure-functions/functions-bindings-timer?pivots=programming-language-javascript)
function warmup
warmup: (options: WarmupTriggerOptions) => WarmupTrigger;
[Link to docs and examples](https://learn.microsoft.com/azure/azure-functions/functions-bindings-warmup?tabs=isolated-process&pivots=programming-language-javascript)
Package Files (23)
- types/InvocationContext.d.ts
- types/app.d.ts
- types/cosmosDB.d.ts
- types/cosmosDB.v3.d.ts
- types/cosmosDB.v4.d.ts
- types/eventGrid.d.ts
- types/eventHub.d.ts
- types/generic.d.ts
- types/hooks/HookContext.d.ts
- types/hooks/appHooks.d.ts
- types/hooks/invocationHooks.d.ts
- types/hooks/registerHook.d.ts
- types/http.d.ts
- types/index.d.ts
- types/input.d.ts
- types/output.d.ts
- types/serviceBus.d.ts
- types/sql.d.ts
- types/storage.d.ts
- types/table.d.ts
- types/timer.d.ts
- types/trigger.d.ts
- types/warmup.d.ts
Dependencies (2)
Dev Dependencies (35)
- @types/chai
- @types/chai-as-promised
- @types/fs-extra
- @types/long
- @types/minimist
- @types/mocha
- @types/node
- @types/semver
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- chai
- chai-as-promised
- eslint
- eslint-config-prettier
- eslint-plugin-deprecation
- eslint-plugin-header
- eslint-plugin-import
- eslint-plugin-prettier
- eslint-plugin-simple-import-sort
- eslint-webpack-plugin
- fork-ts-checker-webpack-plugin
- fs-extra
- globby
- minimist
- mocha
- mocha-junit-reporter
- mocha-multi-reporters
- prettier
- semver
- ts-loader
- ts-node
- typescript
- typescript4
- webpack
- webpack-cli
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@azure/functions
.
- Markdown[](https://www.jsdocs.io/package/@azure/functions)
- HTML<a href="https://www.jsdocs.io/package/@azure/functions"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 8382 ms. - Missing or incorrect documentation? Open an issue for this package.