Azure Functions, and serverless computing in general, are designed to accelerate and simplify application development. NServiceBus endpoints can be hosted in Azure Functions and are subject to the constraints enforced by the Azure Functions hosting and development model.
When using Azure Functions with Azure Service Bus (ASB) or Azure Storage Queues (ASQ), the following points must be taken into consideration:
- Endpoints cannot create their own queues or other infrastructure using installers; the infrastructure required by the endpoint to run must be created upfront. For example:
- Queues for commands (ASB and ASQ)
- Topics and subscriptions for events (ASB)
- Subscription records in storage for events (ASQ)
- There is no support for the
SendsAtomicWithReceivetransport transaction mode with Azure Service Bus.
- Supported triggers are:
- The Configuration API exposes NServiceBus transport configuration options via the
configuration.method to allow customization; however, not all of the options will be applicable to execution within Azure Functions.
- The NServiceBus
ILoglogging abstraction and the Azure Functions
ILoggerare not wired to work together.
- When using the default recoverability or specifying custom number of immediate retries, the number of delivery attempts specified on the underlying queue (ASB) or Azure Functions host (ASB) must be more than then number of the immediate retries. The Azure Functions defaults are 10 (
MaxDeliveryCount) for the ASB trigger and 5 (
DequeueCount) for the ASQ trigger.
- Delayed Retries are supported only with Azure Service Bus, and not with Azure Storage Queues.