# Python Appservice 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. Source: https://skillsagentes.com/skills/microsoft/azure-skills/python-appservice-deploy Repository: https://github.com/microsoft/azure-skills Author: microsoft License: MIT Updated: hace 17 días Context cost: 73 tok installed, 697 tok once triggered, 10.7k tok with every bundled file Bundle: 13 files, 42 KB Permissions requested: none declared ## Install ```bash npx -y skills add microsoft/azure-skills --skill python-appservice-deploy --agent claude-code ``` ## What it does - Despliega código Python (Flask, Django, FastAPI o genérico) a Azure App Service Linux sobre P0v3 y Python 3.14, creando grupo de recursos, plan y web app si faltan. - Solo el nombre de la app es interactivo: el resto — grupo `-rg`, plan `-plan`, región y suscripción — se deriva con valores por defecto. - Prohíbe toda verificación posterior al despliegue: nada de `az webapp log tail`, `curl` ni sondas de salud, porque App Service tarda 2–3 minutos en calentar y un 5xx temprano no es un fallo. - Impone seguridad de shell: `--runtime` siempre con dos puntos (`"PYTHON:3.14"`), nunca con barra vertical, que es un operador de shell. - Prohíbe `az webapp up` por estar obsoleto. ## Use it when - Se quiere desplegar código Flask, Django o FastAPI a Azure App Service. ## Don't bother when - Para Container Apps, Functions, proyectos que no son Python, Terraform/Bicep/IaC o infraestructura completa: eso es `azure-prepare`. ## What triggers it - "despliega mi Flask a App Service" - "sube esta API FastAPI a Azure" - "publica este Django en App Service" ## Before you install - Usa las herramientas MCP de suscripción, grupos, appservice y azd (esta última cuando hay un `azure.yaml`). - Needs on PATH: az, sed - Environment: CREATE_CMD, INPUT, LASTEXITCODE, MAX_SLUG_LEN, NAME, SHOW_CMD, SLUG, SUFFIX, TRANSIENT ## Files - SKILL.md — 3 KB - references/create-app.md — 6 KB - references/deploy-azcli.md — 5 KB - references/deploy-azd.md — 2 KB - references/detect.md — 4 KB - references/errors.md — 4 KB - references/post-deploy-message.md — 4 KB - references/startup-commands.md — 4 KB - references/transient-retry.md — 2 KB - scripts/generate-app-name.ps1 — 2 KB - scripts/generate-app-name.sh — 2 KB - scripts/retry-az-create.ps1 — 2 KB - scripts/retry-az-create.sh — 2 KB ## SKILL.md Reproduced verbatim from microsoft/azure-skills under MIT. This section is the upstream document and is in English. # Python on Azure App Service — Code Deploy 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 1. **Resolve context — smart defaults, minimal prompts.** Only the app name is interactive; RG (`-rg`), Plan (`-plan`), region (current `az` default or `eastus2`), subscription are derived. [create-app.md](references/create-app.md) §1. 2. **Detect framework** (advisory, never blocks). [detect.md](references/detect.md). 3. **Choose path** — `azure.yaml` host: appservice → [deploy-azd.md](references/deploy-azd.md); else [deploy-azcli.md](references/deploy-azcli.md). 4. **Ensure RG → Plan (`P0v3 --is-linux`) → Web App (`--runtime "PYTHON:3.14"`)** exist. On transient ARM errors, follow [transient-retry.md](references/transient-retry.md). [create-app.md](references/create-app.md). 5. **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](references/startup-commands.md). 6. **Set `SCM_DO_BUILD_DURING_DEPLOYMENT=true`**. 7. **Deploy** — `azd deploy` or `az webapp deploy --type zip --track-status false`. 8. **STOP. Print the post-deploy message** ([post-deploy-message.md](references/post-deploy-message.md)) and end the turn. ### Hard rules - ⛔ **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 `--runtime` always 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](references/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. --- Skills Agentes — https://skillsagentes.com/skills/microsoft/azure-skills/python-appservice-deploy