Index of every page on this site: llms.txt
All skills
microsoft avatar

/python-appservice-deploy

@147c081 official
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/microsoft/github-copilot-for-azure/python-appservice-deploy

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈77 tokens for metadata: the name and description. ≈720 when used: this file. ≈8.9k more on demand in 9 files.

Description uses 3.9% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈308 characters, or 3.9%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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 §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 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: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides a robust workflow for deploying Python applications to Azure App Service. It incorporates several security best practices, such as the explicit exclusion of sensitive environment files from deployment packages and the use of sanitization scripts for resource naming. While the skill uses shell-based automation for retrying commands, these are standard practices within the context of Azure resource management.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 147c081. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 3 weeks ago
metadata
{
  "author": "Microsoft",
  "version": "0.0.0-placeholder"
}
  • Python
  • azure
  • app-service
  • flask
  • django
  • fastapi
  • deployment
  • linux

README badge

README badge for microsoft/github-copilot-for-azure/python-appservice-deploy

Deploys Python Flask, Django, or FastAPI applications to Azure App Service Linux, creating resource group, App Service plan, and web app if they don't exist. Handles framework detection, startup command configuration, and zip deployment via Azure CLI or Azure Developer CLI.

Generated from the current SKILL.md.

Does this skill support FastAPI, Flask, and Django?
Yes. Flask and Django use Oryx auto-detection for startup commands. FastAPI requires an explicit startup command: `python -m uvicorn main:app --host 0.0.0.0`.
What happens if I don't have a resource group or App Service plan?
The skill creates them automatically with smart defaults: resource group named `<app>-rg`, plan named `<app>-plan` on P0v3 Linux, and region from your current `az` default or `eastus2`.
Does this skill handle databases, VNets, or infrastructure as code?
No. Use the `azure-prepare` skill for Key Vault, databases, VNets, and Terraform/Bicep. This skill deploys code only.
Should I verify the deployment by calling the app or checking logs?
No. App Service needs 2–3 minutes to warm up after deployment. Do not run health checks, tail logs, or make HTTP requests immediately after the deployment completes.
What Python version does this deploy?
Python 3.14. The runtime is always set to `PYTHON:3.14` (with a colon, not a pipe).

Generated from the current SKILL.md. These answers refresh after source changes.