python-appservice-deploy
microsoft/azure-skills
Deploy Python Flask/Django/FastAPI apps to Azure App Service Linux with automatic resource creation.
What is python-appservice-deploy?
Deploys Python web applications (Flask, Django, FastAPI) to Azure App Service Linux. Use this when you need to push Python code to a managed Azure web host with automatic detection of framework type and resource provisioning. Not for containers, Functions, infrastructure-as-code, or non-Python workloads.
- Automatically creates Resource Group, App Service Plan (P0v3), and Web App if they don't exist
- Detects Python framework (Flask, Django, FastAPI) and configures appropriate startup commands
- Deploys code via Azure CLI or Azure Developer CLI depending on project structure
- Sets required environment variables for build-time deployment
- Handles transient ARM errors with retry logic
How to install python-appservice-deploy
npx skills add https://github.com/microsoft/azure-skills --skill python-appservice-deploy- Azure CLI installed and authenticated (az login)
- Python application code with requirements.txt or equivalent
- Azure subscription with permissions to create Resource Groups and App Services
How to use python-appservice-deploy
- 1.Provide the application name when prompted (Resource Group, Plan, and region are auto-derived)
- 2.The skill detects your Python framework automatically
- 3.If azure.yaml exists, deployment uses Azure Developer CLI; otherwise uses Azure CLI
- 4.Startup commands are configured automatically (Flask/Django use Oryx auto-detection; FastAPI uses python -m uvicorn main:app --host 0.0.0.0)
- 5.Deployment completes and prints post-deployment instructions; do not attempt health checks immediately as App Service needs 2–3 minutes to warm up
Use cases
- Deploy a Flask REST API to a new App Service with auto-provisioned infrastructure
- Push a Django application to Azure App Service and have Oryx auto-detect the framework
- Deploy a FastAPI service with custom uvicorn startup configuration
- Redeploy updated Python code to an existing App Service without manual resource management
- Python developers deploying to Azure
- DevOps engineers managing App Service deployments
- Teams using Flask, Django, or FastAPI frameworks
python-appservice-deploy FAQ
The skill reuses existing resources. Only missing components are created.
No. Flask and Django are auto-detected by Oryx. FastAPI automatically uses uvicorn. Other frameworks will generate a warning.
App Service requires 2–3 minutes to warm up. Early log checks or health probes may show transient 5xx errors that resolve on their own.
The skill includes transient retry logic. If it persists, check the errors.md reference for symptom-specific fixes.
No. This skill is for Python code on App Service Linux only. Use azure-prepare for containers, Functions, or infrastructure-as-code deployments.
Full instructions (SKILL.md)
Source of truth, from microsoft/azure-skills.
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.0.1"
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
- Resolve context — smart defaults, minimal prompts. Only the app name is interactive; RG (
<app>-rg), Plan (<app>-plan), region (currentazdefault oreastus2), subscription are derived. create-app.md §1. - Detect framework (advisory, never blocks). detect.md.
- Choose path —
azure.yamlhost: appservice → deploy-azd.md; else deploy-azcli.md. - Ensure RG → Plan (
P0v3 --is-linux) → Web App (--runtime "PYTHON:3.14") exist. On transient ARM errors, follow transient-retry.md. create-app.md. - 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. - Set
SCM_DO_BUILD_DURING_DEPLOYMENT=true. - Deploy —
azd deployoraz webapp deploy --type zip --track-status false. - 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
--runtimealways 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.
Related skills
More from microsoft/azure-skills and the wider catalog.
finetuning
Fine-tune models on Azure AI Foundry with SFT, DPO, or RFT training methods.
azure-ai
Azure AI services skill for Search, Speech, OpenAI, and Document Intelligence in coding agents
azure-deploy
Execute Azure deployments for prepared applications with built-in error recovery and validation.
azure-diagnostics
Debug Azure production issues using AppLens, Azure Monitor, resource health, and systematic triage.
azure-prepare
Generate Azure deployment infrastructure (Bicep/Terraform, azure.yaml, Dockerfiles) for new or existing apps
azure-storage
Azure Storage skill: Blob, File Shares, Queue, Table, and Data Lake with access tier guidance and lifecycle management