Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Prepare Azure environments for new workloads—subscriptions, networking, identity, and landing zones
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/services/functions/README.md
1# Azure Functions23Serverless compute for event-driven workloads, APIs, and scheduled tasks.45> **⚠️ MANDATORY: Use Composition Algorithm**6>7> **NEVER synthesize Bicep or Terraform from scratch for Azure Functions.**8>9> You MUST follow the base + recipe composition workflow:10> 1. Load [selection.md](templates/selection.md) — decision tree for choosing base template + recipe11> 2. Follow [composition.md](templates/recipes/composition.md) — the algorithm for fetching and composing12>13> This ensures proven IaC patterns, correct RBAC, and Flex Consumption defaults.1415## When to Use1617- Event-driven workloads18- Scheduled tasks (cron jobs)19- HTTP APIs with variable traffic20- Message/queue processing21- Real-time file processing22- MCP servers for AI agents23- Real-time streaming and event processing24- Orchestrations and workflows (Durable Functions)2526## Service Type in azure.yaml2728```yaml29services:30my-function:31host: function32project: ./src/my-function33```3435## Required Supporting Resources3637| Resource | Purpose |38|----------|---------|39| Storage Account | Function runtime state |40| App Service Plan | Hosting (Consumption or Premium) |41| Application Insights | Monitoring |4243## Hosting Plans4445**Use Flex Consumption for new deployments** (all AZD templates default to Flex).4647| Plan | Use Case | Scaling | VNET | Slots |48|------|----------|---------|------|-------|49| **Flex Consumption** ⭐ | Default for new projects | Auto, pay-per-execution | ✅ | ❌ |50| Consumption Windows (Y1) | Legacy/maintenance, Windows-only features | Auto, scale to zero | ❌ | ✅ 1 staging slot |51| Consumption Linux (Y1) | Legacy/maintenance | Auto, scale to zero | ❌ | ❌ |52| Premium (EP1-EP3) | No cold starts, longer execution, slots | Auto, min instances | ✅ | ✅ 20 slots |53| Dedicated | Predictable load, existing App Service | Manual or auto | ✅ | ✅ varies by SKU |5455> ⚠️ **Deployment Slots Guidance:**56> - **Windows Consumption (Y1)** supports 1 staging slot — valid for existing apps or specific Windows requirements.57> Prefer **Elastic Premium (EP1)** or **Dedicated** for new apps requiring slots, as Consumption cold starts affect swap reliability.58> - **Linux Consumption and Flex Consumption** do **not** support deployment slots.59> - For new projects needing slots: use **Elastic Premium** or an **App Service Plan (Standard+)**.6061## Runtime Stacks6263> **⚠️ ALWAYS QUERY OFFICIAL DOCUMENTATION FOR VERSIONS**64>65> Do NOT use hardcoded versions. Query for latest GA versions before generating code:66>67> **Primary Source:** [Azure Functions Supported Languages](https://learn.microsoft.com/en-us/azure/azure-functions/supported-languages)68>69> Use the azure-documentation MCP tool to fetch current supported versions:70> ```yaml71> intent: "Azure Functions supported language runtime versions"72> learn: true73> ```7475### Version Selection Priority761. **Latest GA** — For new projects (best features, longest support window)772. **LTS** — For enterprise/compliance requirements783. **User-specified** — When explicitly requested7980| Language | FUNCTIONS_WORKER_RUNTIME | linuxFxVersion |81|----------|-------------------------|----------------|82| Node.js | `node` | `Node\|<version>` |83| Python | `python` | `Python\|<version>` |84| .NET | `dotnet-isolated` | `DOTNET-ISOLATED\|<version>` |85| Java | `java` | `Java\|<version>` |86| PowerShell | `powershell` | `PowerShell\|<version>` |8788## References8990- **[Selection Guide](templates/selection.md)** — Start here: decision tree for base + recipe91- **[Composition Algorithm](templates/recipes/composition.md)** — How to fetch and compose templates92- [AZD Templates](templates/README.md) — Template overview93- [Bicep Patterns](bicep.md)94- [Terraform Patterns](terraform.md)95- [Durable Functions](durable.md)96- [Aspire + Container Apps](aspire-containerapps.md)97