benzene.azure

Host Benzene handlers on Azure Functions — HTTP, Service Bus, and Event Hub triggers — plus a Service Bus outbound client. Distribution: benzene-azure (depends on benzene-core, benzene-http).

pip install benzene-azure          # add [servicebus] for the real outbound client

Overview

One host, one binding per trigger (transport-bindings §1):

Topic for Service Bus/Event Hub comes from the topic application property.

AzureFunctionsApp

from benzene.azure import AzureFunctionsApp

app = AzureFunctionsApp(http_router=router, registry=registry)   # shares one pipeline

The entry-point helpers http_function(app) / service_bus_function(app) / event_hub_function(app) wrap an app as the plain callables an Azure Functions trigger invokes (adapting the azure.functions types lazily) — mirroring benzene.gcp.http_function and benzene.aws.to_lambda_handler. The package and its tests need no Azure SDK; see the example's function_app.py for the v2-model wiring.

Outbound client

ServiceBusMessageSender(connection_string=..., entity_name=...) implements benzene.core.MessageSender over azure-servicebus (a lazy, optional import), carrying the Benzene topic + headers in the message's application_properties.

Testing

benzene.azure.testing provides AzureFunctionsTestHost (send_http, send_service_bus, send_event_hub, send_event_hub_batch) and the service_bus_message / event_hub_event builders. See Hosting on Azure Functions and the runnable examples/azure_orders.

See also