Skip to content

PowerShell Recipes

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

Use these documents when you already understand the platform basics and need practical, reusable building blocks. PowerShell functions use the classic function.json binding model with param inputs and Push-OutputBinding outputs.

graph TD
    A[PowerShell Recipes] --> B[HTTP]
    A --> C[Storage & Messaging]
    A --> D[Security]
    A --> E[Scheduling]
    A --> F[Orchestration]
    A --> G[API & Quality]

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 parsing, and structured responses with HttpResponseContext.
HTTP Authentication Function auth levels, function keys, and token validation patterns.

Storage & Messaging

Recipe Description
Blob Storage Blob trigger and blob binding patterns for file processing.
Queue Storage Queue trigger consumer patterns and output bindings.
Service Bus Enterprise messaging with queue/topic triggers and dead-lettering.
Event Hubs High-throughput stream ingestion with batch triggers.
Event Grid Reactive handling of discrete events and custom topics.
Cosmos DB Change feed trigger and item input/output bindings.
Table Storage Structured NoSQL entity read/write bindings.
SignalR Service Real-time messaging with negotiate and broadcast bindings.

Security

Recipe Description
Key Vault Secret retrieval using Key Vault references and the Az module.
Managed Identity Passwordless authentication via Connect-AzAccount -Identity.

Scheduling

Recipe Description
Timer Trigger Scheduled jobs, cron semantics, and idempotent batch execution.

Orchestration

Recipe Description
Durable Orchestration Client, orchestrator, and activity functions for long-running workflows.
Durable Advanced Patterns Fan-out/fan-in, external events, durable timers, and eternal orchestrations.

API & Quality

Recipe Description
Retries and Error Handling Retry policies, defensive error handling, and idempotency.
OpenAPI Documentation Serve an API contract from a dedicated HTTP endpoint.
Testing Unit-test function logic with Pester.
Custom Domain and Certificates HTTPS custom domains and TLS certificate binding.

Not applicable in the PowerShell model

Some recipes available for other languages have no idiomatic PowerShell equivalent:

  • Dependency injection — PowerShell has no DI container. Share initialized state (clients, config) through profile.ps1 and module-scoped variables instead.
  • Middleware — PowerShell has no invocation pipeline. Put cross-cutting logic (logging, auth checks) in profile.ps1 or shared helper modules imported by each function.
  • Durable entities — Entity triggers and clients are not supported for PowerShell. Use orchestrations with external storage for stateful coordination. See Durable Advanced Patterns.

How to consume recipes effectively

  1. Start from your trigger pattern (HTTP, timer, queue, blob, Service Bus).
  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