mcpField
P
python-appservice-deploy

python-appservice-deploy

github.com/microsoftCloud & DevOps1.6k232.4k installsUpdated today
Repository

About python-appservice-deploy

A deployment skill for Python apps—including Flask, Django, FastAPI, and generic projects—on Azure App Service Linux. It can create the required Azure resources and selects deployment and startup steps based on the project setup.

Key features

  1. 01Detects Python web frameworks
  2. 02Creates App Service resources
  3. 03Sets application startup commands
  4. 04Deploys with azd or Azure CLI

Use cases

  1. 01Publish a Python web app to Azure
  2. 02Configure deployment for Flask or Django
  3. 03Deploy a FastAPI application
  4. 04Create App Service resources for a new app

MCP support

Uses Azure MCP tools to list subscriptions and resource groups and manage App Service. It also uses the azd MCP tool when azure.yaml is present.

Install

Copy the command and run it in a terminal.

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

After installing, type/python-appservice-deployin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
create-app.md
deploy-azcli.md
deploy-azd.md
detect.md
errors.md
post-deploy-message.md
startup-commands.md
transient-retry.md
scripts/
generate-app-name.ps1
generate-app-name.sh
retry-az-create.ps1
retry-az-create.sh

Details

From the project README

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 §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. 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.
  8. STOP. Print the post-deploy message (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 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.

Comments

Markdown supported