All skills
microsoft avatar

/python-appservice-deploy

@b3c238e
by microsoftmicrosoft/skills3.1k stars
351

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/skills/python-appservice-deploy

This session only. Nothing lands on disk.

SKILL.md

โ‰ˆ77 tokens always: the name and description. โ‰ˆ595 when used: this file. โ‰ˆ8.1k more on demand in 8 files.

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.

Source: SKILL.md on GitHub

No alerts1mo3 checks ยท Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides a standard workflow for deploying Python applications to Azure App Service using official Microsoft Azure CLI tools. It includes well-structured scripts for resource creation and deployment while implementing best practices for error handling and shell safety.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW ยท No issues

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

Last checked against GitHub 19 hours ago.

Activeupdated 2 months ago
metadata
{
  "author": "Microsoft",
  "version": "1.1.1"
}

README badge

README badge for microsoft/skills/python-appservice-deploy