SkillLow riskUnclaimed
Python on Azure App Service — Code Deploy
Deploy Python (Flask/Django/FastAPI) code to Azure App Service Linux. WHEN: "Flask App Service", "Django App Service", "FastAPI App Service", "deploy Python to App Service". DO NOT USE FOR: Container Apps, Functions, non-Python, Terraform/Bicep/IaC, full infra — use azure-prepare.
microsoftmicrosoft/python-appservice-deploy
Description
Deploys Python (Flask, Django, FastAPI, generic) code to Azure App Service Linux (P0v3, Python 3.14). Creates RG + Plan + Web App if missing. Hand off to azure-prepare for VNet, Key Vault, databases, or IaC.
MCP tools used: mcp_azure_mcp_subscription_list, mcp_azure_mcp_group_list, mcp_azure_mcp_appservice, mcp_azure_mcp_azd (when azure.yaml is present).
Workflow
Prerequisite: Verify the latest stable Azure CLI; update with approval and recheck if needed.
- Resolve context — smart defaults, minimal prompts. Only the app name is interactive; RG (
<app>-rg), Plan (<app>-plan), region (currentazdefault oreastus2), subscription are derived. create-app.md §1. - Detect framework (advisory, never blocks). detect.md.
- Choose path —
azure.yamlhost: appservice → deploy-azd.md; else deploy-azcli.md. - Ensure RG → Plan (
P0v3 --is-linux) → Web App (--runtime "PYTHON:3.14") exist. Before creating a plan, invokeazure-quotasto check quota availability. On transient ARM errors, follow transient-retry.md. create-app.md. - Set startup — Flask/Django: none (Oryx auto-detects). FastAPI: always
python -m uvicorn main:app --host 0.0.0.0. Other: warn. startup-commands.md. - Set
SCM_DO_BUILD_DURING_DEPLOYMENT=true. - Deploy —
azd deployoraz webapp deploy --type zip --track-status false --enriched-errors true. - STOP. Print the post-deploy message (post-deploy-message.md) and end the turn.
Hard rules
- LINUX SCRIPTS — normalize selected shell/startup files to LF, then verify no CR bytes remain. Stop on normalization, validation or packaging failure; deploy only a fresh package.
- DJANGO REMOTE BUILDS — require
STATIC_ROOTand successful system/collectstaticchecks before packaging. - ⛔ NO POST-DEPLOY VERIFICATION — after deploy returns, do not run
az webapp log tail,curl,Invoke-WebRequest, or any health probe. App Service needs 2–3 min to warm; a quiet log or early 5xx is not failure. - ⛔ SHELL SAFETY — for
--runtimealways use"PYTHON:3.14"(colon). Never"PYTHON|3.14"(pipe is a shell operator). - ⛔ NEVER
az webapp up— deprecated. Use Step 7 commands. - ✅ URL FORMAT — present endpoints as
https://...URLs.
Error Handling
See errors.md for the full symptom → cause → fix matrix. Quick triage: missing plan/app → re-run Step 4; container ping timeout on 8000 → fix startup (Step 5); ModuleNotFoundError after deploy → ensure Step 6 ran, redeploy.
Permissions
powershellshellpiplearn.microsoft.comChecks
Low risk · Nothing worth a warning was found.
Not reviewed by a person · Checked by rules; the model review is not switched on yet.
3 minor marks: common commands and the like, noted but not a concern
- Rule · command_injection
references/deploy-azcli.md:88 - Rule · command_injection
references/deploy-azcli.md:89 - Rule · command_injection
references/deploy-azcli.md:97
Files13 files · 45.5 KB
- SKILL.md3.2 KB
references/8
- create-app.md6.2 KB
- deploy-azcli.md6.8 KB
- deploy-azd.md3.4 KB
- detect.md3.6 KB
- errors.md3.8 KB
- post-deploy-message.md4.4 KB
- startup-commands.md4.3 KB
- transient-retry.md2.3 KB
scripts/4
- generate-app-name.ps11.7 KB
- generate-app-name.shx1.8 KB
- retry-az-create.ps12.1 KB
- retry-az-create.shx1.9 KB
Versions
- #31.1.3latestNov 12, 2026
- #21.1.2Nov 6, 2026
- #11.1.1Oct 6, 2026