Skip to content

Python Recipes

The Recipes section provides implementation-focused patterns for common Azure Functions integrations in Python.

Use these documents when you already understand the platform basics and need practical, reusable building blocks.

graph TD
    A[Python Recipes] --> B[HTTP]
    A --> C[Storage]
    A --> D[Security]
    A --> E[Advanced]

Pair recipes with platform guidance

For architecture and plan behavior that applies across all languages, see Platform.

Recipe categories

HTTP

Recipe Description
HTTP API Patterns Route design, request/response patterns, and API-friendly function composition.
HTTP Authentication Function auth levels, app-level auth, and token validation integration patterns.
OpenAPI and Swagger Documenting HTTP APIs via API Management import or a hand-authored spec plus Swagger UI.

Storage

Recipe Description
Cosmos DB Input/output patterns for Cosmos DB-backed APIs and event processing workloads.
Blob Storage Blob trigger and blob binding patterns, including production-oriented processing flow.
Queue Storage Queue trigger consumer patterns, retries, and output binding usage.
Table Storage Table (NoSQL key-value) input/output binding patterns for entity storage and lookups.

Security

Recipe Description
Key Vault Secret and configuration retrieval patterns using Key Vault integration.
Managed Identity Passwordless authentication from Functions to Azure services via Entra identities.
Custom Domains & Certificates TLS and custom hostname setup considerations for HTTP-facing workloads.

Advanced

Recipe Description
Timer Trigger Scheduled jobs, cron semantics, and idempotent batch execution patterns.
Durable Functions Orchestration, fan-out/fan-in, and stateful workflow coordination.
Durable Entities Stateful entity (actor-style) model for aggregation and per-key state coordination.
Durable Advanced Sub-orchestrations, eternal orchestrations, activity retries, and versioning.
Event Grid Event-driven designs and event routing patterns for reactive systems.
Event Hubs High-throughput event stream consumption with batch trigger, metadata, and output binding.
Service Bus Enterprise messaging with queue/topic triggers, dead-lettering, sessions, and output binding.
SignalR Service Real-time messaging to connected clients via the negotiate endpoint and output binding.
Dependency Injection Sharing clients across invocations via module-level singletons (no built-in DI container).
Retry Policies Runtime retry policies (fixed delay, exponential backoff) for Timer, Event Hubs, and Cosmos DB triggers.
Middleware Cross-cutting behavior via wrapper decorators (no built-in middleware pipeline).
Unit Testing Host-free unit testing of handlers with pytest and mocked bindings.

How to consume recipes effectively

  1. Start from your trigger pattern (HTTP, timer, queue, blob, Event Grid).
  2. Apply security baseline patterns first (Managed Identity and Key Vault).
  3. Validate hosting-plan constraints in Platform: Hosting.
  4. Add monitoring/alerts using Operations guidance.

See Also

Sources