Back

Python Appservice Deploy

DevOps & deploy312.6K installs

What it does

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…

Install

npx skills add https://github.com/microsoft/azure-skills --skill python-appservice-deploy

Website

www.skills.sh/microsoft/azure-skills/python-appservice-deploy

Details

From the skill’s SKILL.md or README, by its authors. View the original

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

Prerequisite: Verify the latest stable Azure CLI; update with approval and recheck if needed.

  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 §1.
  2. Detect framework (advisory, never blocks). detect.md.
  3. Choose path — azure.yaml host: appservice → deploy-azd.md; else deploy-azcli.md.
  4. Ensure RG → Plan (P0v3 --is-linux) → Web App (--runtime "PYTHON:3.14") exist. Before creating a plan, invoke azure-quotas to check quota availability. On transient ARM errors, follow transient-retry.md. 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.
  6. Set SCM_DO_BUILD_DURING_DEPLOYMENT=true.
  7. Deploy — azd deploy or az webapp deploy --type zip --track-status false --enriched-errors true.
  8. 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_ROOT and successful system/collectstatic checks 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 --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 symptomcausefix matrix. Quick triage: missing plan/appre-run Step 4; container ping timeout on 8000fix startup (Step 5); `ModuleNotFoundError` after deployensure Step 6 ran, redeploy.
See all
  • DevOps & deploy

    Debug Azure production issues using AppLens, Azure Monitor, resource health, and safe triage, including evidence-only diagnosis without live access. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot…

    npx skills add https://github.com/microsoft/azure-skills --skill azure-diagnostics
    653.9K installs
  • DevOps & deploy

    Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an…

    npx skills add https://github.com/microsoft/azure-skills --skill azure-prepare
    653K installs
  • DevOps & deploy

    Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform…

    npx skills add https://github.com/microsoft/azure-skills --skill azure-deploy
    651.9K installs
  • DevOps & deploy

    Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight…

    npx skills add https://github.com/microsoft/azure-skills --skill azure-validate
    651.1K installs

Skills are shared by members and not reviewed by us. Read a skill’s code before you install it.