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.

referencestransient-retry.md

≈592 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Transient ARM error handling for az ... create

Load this file only when an az group create, az appservice plan create, or az webapp create command fails. Healthy runs never need it.

Which errors are transient

ARM PUT operations sometimes fail with transient errors:

  • Connection reset, Connection aborted, ConnectionError
  • Read timed out, Max retries exceeded
  • BadGatewayConnection, ServiceUnavailable
  • TooManyRequests / HTTP 429
  • HTTP 502 / 503 / 504

These are ARM frontend / network blips, not configuration problems — they almost always succeed on retry.

Do NOT retry on AuthorizationFailed, SubscriptionNotFound, ResourceGroupNotFound, InvalidTemplateDeployment, SkuNotAvailable, QuotaExceeded, or any non-429 4xx. Those are real config errors — surface them to the user.

Rules

  • Apply to every az ... create in create-app.md §§2–4.
  • Retry silently — do not narrate "let me retry".
  • Up to 2 retries (3 attempts total); wait 5s before retry #1 and 15s before retry #2. If the error carries a Retry-After header, honour that instead.
  • Wrap the full idempotent pair (az ... show ...) || (az ... create ...) — never the bare create. The show short-circuits any partially-succeeded prior attempt and avoids false Conflict / NameAlreadyExists.
  • After 3 failed attempts, surface the original error with one line of context (e.g., "ARM frontend is returning transient errors — please retry in a few minutes").

Use the wrapper scripts

Both shells have a ready-to-call wrapper that implements the loop, the transient-error filter, and the backoff. Prefer these over inlining the loop:

  • Bash / zsh (Linux, macOS): scripts/retry-az-create.sh
    ./scripts/retry-az-create.sh \
        "az group show -n my-rg --only-show-errors" \
        "az group create -n my-rg -l eastus2"
  • PowerShell (Windows): scripts/retry-az-create.ps1
    .\scripts\retry-az-create.ps1 `
        -ShowCommand "az group show -n my-rg --only-show-errors" `
        -CreateCommand "az group create -n my-rg -l eastus2"

Both scripts run the show command first, fall through to create on failure, and retry up to 2 times on transient errors only.

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 yesterday.

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

README badge

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