Skip to content
Python App Service Deploy

Python App Service Deploy Skill

Microsoft's skill for deploying Flask, Django or FastAPI code to Azure App Service on Linux, creating the resource group, plan and web app when missing, with strict rules for startup commands and packaging.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from microsoft/azure-skills.

$ npx skills add microsoft/azure-skills --skill python-appservice-deploy

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

Copy the whole skill folder — SKILL.md and any scripts or references beside it — into ~/.claude/skills/python-appservice-deploy/, where Claude Code picks it up in every project. Only git is needed.

tmp=$(mktemp -d) && \
  git clone --depth 1 --branch main https://github.com/microsoft/azure-skills.git "$tmp" && \
  mkdir -p ~/.claude/skills && \
  cp -R "$tmp"/skills/python-appservice-deploy ~/.claude/skills/python-appservice-deploy

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/python-appservice-deploy/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • Deploys Flask, Django, FastAPI or generic Python code to App Service Linux
  • Creates resource group, P0v3 Linux plan and web app when missing
  • Only the app name is interactive; other names and region are derived
  • azd deploy when azure.yaml is present, Azure CLI zip deploy otherwise
  • Framework-specific startup commands (uvicorn for FastAPI)
  • Quota check before creating a plan
  • Hard rules for LF line endings, Django collectstatic and the PYTHON:3.14 runtime string

Python App Service Deploy is an official skill in Microsoft's azure-skills repository with a deliberately narrow job: put an existing Python web app (Flask, Django, FastAPI or generic) onto Azure App Service Linux as a code deployment. Containers, Azure Functions, other languages and infrastructure-as-code are out of scope and handed to the azure-prepare skill, as are VNets, Key Vault and databases.

The workflow keeps prompts to a minimum: only the app name is asked for, while the resource group (<app>-rg), plan (<app>-plan), region and subscription are derived. It detects the framework, chooses azd deploy when an azure.yaml targets App Service and the Azure CLI otherwise, and makes sure the resource group, a P0v3 Linux plan and a web app on the PYTHON:3.14 runtime exist, checking quota with the azure-quotas skill before creating a plan. Flask and Django need no startup command; FastAPI always gets python -m uvicorn main:app --host 0.0.0.0. It sets SCM_DO_BUILD_DURING_DEPLOYMENT=true and deploys a zip with az webapp deploy.

Its hard rules encode common failures: normalise shell and startup files to LF line endings, require STATIC_ROOT and a passing collectstatic for Django remote builds, write the runtime with a colon rather than a pipe, never use the deprecated az webapp up, and do not probe the site right after deploying, since App Service needs two to three minutes to warm up. It uses the Azure MCP server's subscription, group, App Service and azd tools. MIT licensed.

SKILL.md

The instructions your agent loads, as published by Microsoft.

SKILL.md
name
python-appservice-deploy
description
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.
license
MIT
metadata
author: Microsoft version: "1.1.3"

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 (<app>-rg), Plan (<app>-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. Before creating a plan, invoke azure-quotas to check quota availability. 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 --enriched-errors true.
  8. STOP. Print the post-deploy message ([post-deploy-message.md](references/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 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.

Install
New

Microsoft's official Azure skill for pre-deployment checks: validates azure.yaml, Bicep or Terraform, RBAC role assignments and managed identity permissions before an agent deploys.

New

Microsoft's official skill for preparing apps for Azure with the Azure Developer CLI: writes a deployment plan first, then generates azure.yaml, Bicep or Terraform infrastructure and Dockerfiles before handing off to validation.

Skill: Azure Deploy

by Microsoft

Microsoft's official skill for executing Azure deployments of already-prepared apps: it checks for a validated deployment plan, runs azd up, azd deploy, terraform apply or az deployment with error recovery, then verifies endpoints and RBAC roles.

New

Microsoft's skill that takes an existing AKS cluster to a running AI model with AI Runway: cluster check, controller install, GPU assessment, inference provider setup (KAITO, Dynamo, KubeRay) and a first deployment.

Browse all skills →