Skip to content

PowerShell Language Guide

This guide maps Azure Functions platform concepts to the PowerShell programming model. PowerShell functions are a natural fit for automation, Azure resource operations, and glue code that already relies on Azure PowerShell (Az) modules.

flowchart TD
    A[Tutorial Overview]
    A --> B[Consumption Track]
    A --> C[Flex Consumption Track]
    A --> D[Premium Track]
    A --> E[Dedicated Track]
    A --> F[Recipes]
    A --> G[Runtime and Reference]

Architecture first

Before diving into PowerShell-specific details, review Platform for language-agnostic guidance on hosting, scaling, networking, reliability, and security.

When PowerShell Is a Good Fit

  • Azure automation — orchestrating resource operations with the Az module, scheduled with a timer trigger.
  • Operational glue — reacting to queue, Event Grid, or HTTP events with concise scripts.
  • Teams already invested in PowerShell — reusing existing modules and skills.

For high-throughput, low-latency APIs or heavy compute, prefer a compiled or richer runtime (.NET, Java) — see Language Guides Overview.

Programming Model

PowerShell functions use the classic scripting model: each function is a folder containing a run.ps1 script and a function.json binding definition. This differs from the decorator/code-first models in Python (v2) and Node.js (v4).

PSFunctionApp
 | - MyHttpFunction
 | | - run.ps1
 | | - function.json
 | - host.json
 | - requirements.psd1
 | - profile.ps1

See PowerShell Programming Model for param blocks, Push-OutputBinding, and binding patterns.

Start Here

  1. Choose your hosting plan in Tutorial Overview & Plan Chooser.
  2. Follow one full tutorial track from local run through CI/CD.
  3. Use recipes to add integrations (HTTP, Timer, Queue, Blob, Key Vault, and more).
  4. Keep runtime/reference docs open during production hardening.

What's Covered

Area Document Scope
Tutorial Overview & Plan Chooser Select Consumption, Flex Consumption, Premium, or Dedicated
Tutorial track Consumption (Y1) 7-step flow for classic serverless
Tutorial track Flex Consumption (FC1) 7-step flow for modern default serverless
Tutorial track Premium (EP) 7-step flow for always-warm/VNet scenarios
Tutorial track Dedicated (App Service) 7-step flow for fixed-capacity hosting
Recipes Recipes Index Practical implementation recipes
Runtime model PowerShell Programming Model run.ps1, function.json, binding patterns
Runtime internals PowerShell Runtime Worker behavior, versions, dependency management
CLI CLI Cheatsheet az and func operational commands
Host settings host.json Reference Concurrency, retry, logging, and managed dependency settings
Configuration Environment Variables Key app and platform environment settings
Limits Platform Limits Timeouts, payloads, scaling, and service constraints
Diagnostics Troubleshooting Common failures and troubleshooting flow

Supported Versions

Functions runtime PowerShell version .NET version Notes
4.x PowerShell 7.4 .NET 8 Generally available; supported on all plans
4.x PowerShell 7.6 (preview) .NET 10 Windows-only (Premium, Dedicated, Consumption)

Flex Consumption supports PowerShell 7.4 on Linux. See PowerShell Runtime for version selection details.

PowerShell-Specific Considerations

  • Managed dependencies (requirements.psd1 auto-download) are not supported on Flex Consumption — bundle modules in a Modules folder instead.
  • Concurrency is single-threaded by default; tune with PSWorkerInProcConcurrencyUpperBound or FUNCTIONS_WORKER_PROCESS_COUNT.
  • Cold start — avoid Install-Module at runtime; use Save-Module/Save-PSResource at build time.

Cross-Language Context

If your team supports multiple stacks, compare PowerShell with:

See Also

Sources