Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Assess and upgrade Azure workloads between plans, tiers, or SKUs with automated migration steps
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/services/functions/consumption-to-flex.md
1# Consumption Plan to Flex Consumption Plan Upgrade23> **Source**: Azure Functions Consumption Plan (Y1/Dynamic) on Linux4> **Target**: Azure Functions Flex Consumption Plan (FC1/FlexConsumption)5> **Platform**: Linux only (Windows support planned for future)6> **Docs**: [Linux migration guide](https://learn.microsoft.com/en-us/azure/azure-functions/migration/migrate-plan-consumption-to-flex?pivots=platform-linux)78## Why Upgrade?910- **Faster cold starts** — always-ready instances mean functions respond more quickly11- **Better scaling** — per-function scaling and concurrency controls12- **Virtual network support** — connect to private networks and use private endpoints13- **Active investment** — Flex Consumption is where new features land first1415## What to Expect16171. Your **code stays the same** — no rewriting required if on a supported language version182. You'll **create a new app** alongside the existing one193. New app runs in the **same resource group** with access to the same dependencies204. You **control the timing** — test thoroughly before switching over2122## Platform Notes2324- Linux Consumption is being **retired September 30, 2028**25- Azure CLI provides automated migration commands: `az functionapp flex-migration list` and `az functionapp flex-migration start`26- The `flex-migration` commands handle assessment, app creation, and most configuration migration automatically27- Deployment packages are in `squashfs` format stored in `scm-releases` blob container2829## Prerequisites3031- Azure CLI v2.77.0+32- `resource-graph` extension: `az extension add --name resource-graph`33- `jq` tool for JSON processing34- Owner or Contributor role in the resource group35- Permissions to create and manage function apps, storage accounts, App Insights resources, and managed identity role assignments3637## Compatibility Requirements3839### Supported Language Stacks4041| Stack ID | Language | Supported? |42|----------|----------|------------|43| `dotnet-isolated` | .NET (isolated worker model) | ✅ Yes |44| `node` | JavaScript/TypeScript | ✅ Yes |45| `java` | Java | ✅ Yes |46| `python` | Python | ✅ Yes |47| `powershell` | PowerShell | ✅ Yes |48| `dotnet` | .NET (in-process model) | ❌ No — must migrate to isolated first |49| `custom` | Custom handlers | ✅ Yes |5051### Known Limitations (Flex Consumption)5253| Feature | Status | Impact |54|---------|--------|--------|55| Deployment slots | ❌ Not supported | Rearchitect to use separate apps |56| TLS/SSL certificates | ❌ Not supported | Wait for support or find alternative |57| Blob trigger (polling) | ❌ Only EventGrid source | Convert `LogsAndContainerScan` → `EventGrid` |58| Azure Government | ❌ Not available | Cannot migrate yet |5960## Upgrade Phases6162### Phase 1: Assessment6364Run all checks from [assessment.md](assessment.md). Use the automated eligibility check:6566```bash67# Automated eligibility check — scans all Linux Consumption apps68az functionapp flex-migration list69```7071This returns `eligible_apps` and `ineligible_apps` arrays with specific reasons for any incompatibilities. For detailed manual checks, see [automation.md](automation.md).7273### Phase 2: Pre-migration (Collect Everything)7475Collect all settings and configurations from the existing app before creating the new one. See **Step-by-step scripts** in [automation.md](automation.md):76771. Collect app settings782. Collect application configurations (CORS, custom domains, HTTP version, TLS, client certs, etc.)793. Identify managed identities and RBAC role assignments804. Identify built-in authentication settings815. Review inbound access restrictions826. Get the code deployment package (if source code not in version control)8384### Phase 3: Create Flex Consumption App8586Run the automated migration command from [automation.md](automation.md) — Step 4.8788The `flex-migration start` command automatically:89- Assesses your source app for Flex Consumption compatibility90- Creates a new function app in the Flex Consumption plan91- Migrates app settings, identity assignments, storage mounts, CORS, custom domains, and access restrictions9293> 💡 Use Microsoft Entra ID + managed identities instead of connection strings when creating the new app.9495### Identity-First Configuration (Functions)9697Enterprise subscriptions commonly enforce policies blocking local auth. Configure identity-based access:9899- **Storage accounts**: Use `AzureWebJobsStorage__credential`, `__clientId`, and service-specific URIs (`__blobServiceUri`, `__queueServiceUri`, `__tableServiceUri`)100- **Application Insights**: Use `APPLICATIONINSIGHTS_AUTHENTICATION_STRING` with `Authorization=AAD`101- When using User Assigned Managed Identity, pass `managedIdentityClientId` explicitly102103### Phase 4: Verify and Configure the New App104105The `flex-migration start` command handles most configuration. Verify the results and manually configure anything it doesn't cover (see [automation.md](automation.md)):1061071. **Verify** migrated app settings, identities, custom domains1082. **Configure** built-in authentication (if used — not auto-migrated)1093. **Configure** scale and concurrency settings (if custom values needed)1104. **Enable** Application Insights monitoring111112### Phase 5: Deploy Code113114> ⚠️ **Code is NOT automatically migrated.** The new app is created with config only — you must deploy code separately.115116**Use `ask_user` to present these options:**117118> Your new Flex Consumption app `<NEW_APP_NAME>` has been created and configured. Now we need to deploy your function code. How would you like to proceed?119>120> 1. **Update CI/CD pipeline** — I'll help you update your Azure Pipelines or GitHub Actions workflow to target the new app121> 2. **Deploy from local project** — I'll run `func azure functionapp publish <NEW_APP_NAME>` from your project directory122> 3. **Deploy existing package** — I'll deploy the package we downloaded earlier from the original app123124After user selects an option, execute the corresponding deployment method from [automation.md](automation.md) — Step 5.125126> ⚠️ After deployment, triggers immediately start processing. Review mitigation strategies for your trigger types.127128**After successful deployment, inform the user:**129130> Code deployed! Next steps to consider:131>132> - The original app is still running — keep it as rollback for a few days133> - Update any clients/pipelines to point to the new URL134> - Enable HTTPS-only and managed identity on the new app for better security135> - When confident, you can delete the original app136137### Phase 6: Post-Upgrade Validation1381391. **Smoke test** — Get the app’s default hostname via `az functionapp show --query defaultHostName -o tsv`, then hit that URL and confirm it returns a non-error response (HTTP 2xx/4xx, not connection refused or 503). This is the minimum bar before proceeding.1402. Verify the app is running on Flex Consumption (`az functionapp show --query sku`)1413. Test HTTP trigger endpoints (e.g. `curl https://<DEFAULT_HOST>/api/<FUNCTION_NAME>`)1424. Capture and compare performance benchmarks1435. Set up monitoring dashboards1446. Refine scale/concurrency settings1457. Update IaC (Bicep/Terraform) to reflect new plan146147### Phase 7: Cleanup (Optional)148149- Keep the original app for a few days/weeks as rollback150- Consumption plan charges only for actual usage — low cost to keep idle151- When confident, delete using the command in [automation.md](automation.md) — Step 7152153## Trigger Migration Risks154155| Trigger Type | Risk | Mitigation |156|-------------|------|------------|157| Azure Blob storage | High | Create separate container for event-based trigger in new app |158| Azure Cosmos DB | High | Create dedicated lease container for new app; set `StartFromBeginning: false` |159| Azure Event Grid | Medium | Recreate event subscriptions; ensure idempotent functions |160| Azure Event Hubs | Medium | Create new consumer group for new app |161| Azure Service Bus | High | Create new topic/queue; update senders; drain original before shutdown |162| Azure Storage Queue | High | Create new queue; update senders; drain original before shutdown |163| HTTP | Low | Update clients to target new app URL |164| Timer | Low | Offset schedules during cutover to avoid simultaneous execution |165166## IaC Key Differences167168| Property | Consumption | Flex Consumption |169|----------|-------------|------------------|170| SKU | `Y1` (Dynamic) | `FC1` (FlexConsumption) |171| Plan required | Optional (auto-created) | Required (must be explicit) |172| OS | Linux | Linux only |173| Configuration | App settings | `functionAppConfig` section |174| Storage | `WEBSITE_CONTENTSHARE` setting | `deployment.storage` in `functionAppConfig` |175176## Deprecated Settings (Do NOT Migrate)177178These app settings are NOT supported in Flex Consumption and should be filtered out:179180- `WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED`181- `AzureWebJobsStorage*` (replaced by identity-based config)182- `WEBSITE_MOUNT_ENABLED`183- `ENABLE_ORYX_BUILD`184- `FUNCTIONS_EXTENSION_VERSION` (set via `functionAppConfig`)185- `FUNCTIONS_WORKER_RUNTIME` (set via `functionAppConfig`)186- `FUNCTIONS_WORKER_RUNTIME_VERSION`187- `FUNCTIONS_MAX_HTTP_CONCURRENCY`188- `FUNCTIONS_WORKER_PROCESS_COUNT`189- `FUNCTIONS_WORKER_DYNAMIC_CONCURRENCY_ENABLED`190- `SCM_DO_BUILD_DURING_DEPLOYMENT`191- `WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`192- `WEBSITE_CONTENTOVERVNET`193- `WEBSITE_CONTENTSHARE`194- `WEBSITE_DNS_SERVER`195- `WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT`196- `WEBSITE_NODE_DEFAULT_VERSION`197- `WEBSITE_RUN_FROM_PACKAGE`198- `WEBSITE_SKIP_CONTENTSHARE_VALIDATION`199- `WEBSITE_VNET_ROUTE_ALL`200- `APPLICATIONINSIGHTS_CONNECTION_STRING` (already created in new app)201202## Troubleshooting203204| Issue | Remediation |205|-------|-------------|206| Cold start performance issues | Review concurrency settings; check for missing dependencies |207| Missing bindings | Verify extension bundles; update binding configurations |208| Permission errors | Check identity assignments and role permissions |209| Network connectivity | Validate access restrictions and networking settings |210| Missing App Insights | Recreate the Application Insights connection |211| App fails to start | Check portal Diagnose & Solve; review App Insights Failures blade |212| Triggers not processing | Verify binding configs, connection strings, consumer groups |213214## Rollback2152161. Restart the original app: `az functionapp start --name <ORIGINAL_APP_NAME> --resource-group <RESOURCE_GROUP>`2172. Redirect clients back to original resources (queues/topics/containers)2183. Revert DNS or custom domain changes2194. Delete the new Flex Consumption app if needed220221## References222223- [Flex Consumption plan overview](https://learn.microsoft.com/en-us/azure/azure-functions/flex-consumption-plan)224- [How to use the Flex Consumption plan](https://learn.microsoft.com/en-us/azure/azure-functions/flex-consumption-how-to)225- [Azure CLI flex-migration commands](https://learn.microsoft.com/en-us/cli/azure/functionapp/flex-migration) (Linux only)226- [Flex Consumption IaC samples](https://github.com/Azure-Samples/azure-functions-flex-consumption-samples/tree/main/IaC)227- [Flex Consumption plan deprecations](https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#flex-consumption-plan-deprecations)228