Python Appservice Deploy

microsoft/skills/.github/plugins/azure-skills/skills/python-appservice-deploy

by microsoft3898ec894e90MIT3.2K starsListed Nov 20, 2026Updated Nov 20, 2026Repository updated today

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.

FeaturedIncludes scriptsDevOps & Cloud
AI-generated overview

Deploys Python Flask, Django or FastAPI code to Azure App Service on Linux, creating resource group, plan and web app as needed.

What it does
Guides an agent through deploying Python web app code to Azure App Service Linux: it resolves naming and region defaults, detects the framework, and chooses an azd or Azure CLI path. It creates the resource group, App Service plan (P0v3, Linux) and web app (Python 3.14) when missing, sets startup commands and the build-during-deployment setting, then deploys a zip or via azd. It ends by printing a post-deploy message and ships helper scripts for app-name generation and retrying transient create errors.
When to use it
Use when deploying Flask, Django or FastAPI code to Azure App Service. Not intended for Container Apps, Functions, non-Python apps, or full infrastructure and IaC work.
Requirements
Azure CLI (az) or Azure Developer CLI (azd), an authenticated Azure subscription, and Azure MCP tools for subscriptions, resource groups, App Service and azd. Network access to Azure. Ships PowerShell and shell scripts for name generation and retrying az create.

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 (<app>-rg), Plan (<app>-plan), region (current az default or eastus2), subscription are derived. create-app.md [blocked] §1.
  2. Detect framework (advisory, never blocks). detect.md [blocked].
  3. Choose path — azure.yaml host: appservice → deploy-azd.md [blocked]; else deploy-azcli.md [blocked].
  4. Ensure RG → Plan (P0v3 --is-linux) → Web App (--runtime "PYTHON:3.14") exist. On transient ARM errors, follow transient-retry.md [blocked]. create-app.md [blocked].
  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 [blocked].
  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 [blocked]) 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 [blocked] 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.

Source and attribution

Source:microsoft/skillsin.github/plugins/azure-skills/skills/python-appservice-deployat commit3898ec8

License: MIT

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Add a badge to your README

Show readers this skill is listed on SourceWeft. The badge links to this page.

Preview of the “Listed on SourceWeft” badge
[![Listed on SourceWeft](https://sourceweft.com/badge/skills/gh-microsoft-skills-python-appservice-deploy.svg)](https://sourceweft.com/skills/gh-microsoft-skills-python-appservice-deploy?utm_source=readme&utm_medium=badge)

Report or request removal