Generated banner for Azure Kubernetes App Deploy
Generated logo for Azure Kubernetes App Deploy

Azure Kubernetes App Deploy

MicrosoftOfficialCreated by Microsoft

  • Skill
  • Tool integration
  • Cloud and DevOps
  • MIT
  • Low risk

From the author

Use when deploying an existing web application or API to an already-running Azure Kubernetes Service cluster. Detects the framework, generates a Dockerfile and Kubernetes manifests, validates against AKS Deployment Safeguards, and deploys with verification. WHEN: deploy app to AKS, deploy to existing AKS cluster, containerize app for Kubernetes, generate K8s manifests for Azure, set up CI/CD for AKS, my AKS deployment is failing safeguard checks, I have a Django/Express/Spring Boot app to run on AKS. DO NOT USE FOR: creating or provisioning an AKS cluster (use azure-kubernetes), assessing migration to AKS Automatic (use azure-kubernetes-automatic-readiness), or deploying to non-AKS targets like Web Apps, Container Apps, or Functions.
— the description by Microsoft

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill streamlines the deployment of web applications and APIs to an existing Azure Kubernetes Service (AKS) cluster. It performs automated framework detection to identify the application stack, generates appropriate Dockerfiles and Kubernetes manifests, and validates the configuration against AKS Deployment Safeguards. The process includes verification steps to ensure the application is correctly deployed and configured for the target environment.

What it does

  • Detects application frameworks and sub-frameworks from project signal files.
  • Automatically generates Dockerfiles and Kubernetes manifests based on detected project requirements.
  • Validates configurations against AKS Deployment Safeguards (DS001–DS013).
  • Resolves base image tags using floating major versions to maintain security and stability.
  • Detects application ports and health endpoints to configure Kubernetes probes.
  • Provides recovery procedures for deployment failures.

When to use it

  • When you need to deploy an existing web application or API to an active AKS cluster.
  • When you need to containerize a project for Kubernetes deployment.
  • When you need to generate Kubernetes manifests tailored for Azure.
  • When your deployment is failing due to AKS Deployment Safeguard checks.
  • When setting up CI/CD pipelines for applications running on AKS.

Advantages

  • Reduces manual effort in creating container and orchestration configurations.
  • Ensures deployments adhere to established AKS Deployment Safeguards.
  • Maintains up-to-date base images through automated major version resolution.
  • Standardizes health probe and port configuration across different frameworks.

Usage examples

“Deploy my Express application to the existing AKS cluster.”
The agent detects the Node.js framework, generates a Dockerfile and Kubernetes manifests, validates them against AKS safeguards, and initiates the deployment.
“My Spring Boot app deployment is failing AKS safeguard checks.”
The agent analyzes the current configuration against the DS001-DS013 checklist to identify and resolve the specific safeguard violations.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/microsoft/azure-kubernetes-app-deploy/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip azure-kubernetes-app-deploy.zip -d .agents/skills

Documentation by Microsoft

Deploy to AKS

Use when: deploying a web app/API to AKS; containerizing for Kubernetes; generating manifests; AKS CI/CD; DS001–DS013 failures.

Not for: provisioning clusters (azure-kubernetes), AKS Automatic readiness (azure-kubernetes-automatic-readiness), non-AKS targets.

Workflow

Requires: existing AKS cluster, az login, kubectl configured. Follow phases/quick-deploy.md. On failure: references/rollback.md.

References

Knowledge Packs

Load knowledge-packs/frameworks/<framework>.md per detected framework. Available: spring-boot, express, nextjs, fastapi, django, nestjs, aspnet-core, go, flask

Templates

templates/ (dockerfiles/, k8s/, github-actions/, mermaid/).

Files

knowledge-packs/frameworks/django.md

Django Knowledge Pack

Applies to: Projects detected with requirements.txt, pyproject.toml, or Pipfile containing django, or presence of manage.py

Quick Reference

PropertyValue
Signal filesrequirements.txt/pyproject.toml/Pipfile containing django, or manage.py
Default port8000 (gunicorn)
Health path/health/ (django-health-check)
Base templatetemplates/dockerfiles/python.Dockerfile (+ references/base-images.md)

Health Endpoints

Django does not provide health endpoints out of the box. Use the django-health-check package:

Installation
pip install django-health-check
Configuration in settings.py
INSTALLED_APPS = [
    # ...existing apps...
    "health_check",
    "health_check.db",
    "health_check.cache",
    "health_check.storage",
    "health_check.contrib.migrations",
]
URL configuration in urls.py
from django.urls import include, path

urlpatterns = [
    # ...existing urls...
    path("health/", include("health_check.urls")),
]

The /health/ endpoint returns HTTP 200 when all checks pass and HTTP 500 with details when any check fails.

Probe configuration in Deployment manifest
livenessProbe:
  httpGet:
    path: /health/
    port: 8000
  initialDelaySeconds: 10
  periodSeconds: 15
  timeoutSeconds: 3
  failureThreshold: 3
readinessProbe:
  httpGet:
    path: /health/
    port: 8000
  initialDelaySeconds: 10
  periodSeconds: 10
  timeoutSeconds: 3
  failureThreshold: 3

Note: initialDelaySeconds: 10 is sufficient for most Django apps.


Database Profiles

Django does not have a built-in profile system like Spring Boot. Database configuration is driven by settings.py with environment variables:

PatternHow it works
dj-database-urlParse DATABASE_URL env var (recommended for 12-factor apps)
Environment variables for PostgreSQL on AKS
env:
  - name: DATABASE_URL
    value: "postgres://{{IDENTITY_NAME}}@{{PG_SERVER_NAME}}.postgres.database.azure.com:5432/{{DB_NAME}}?sslmode=require"
  - name: SECRET_KEY
    valueFrom:
      secretKeyRef:
        name: {{APP_NAME}}-secrets
        key: secret-key

Important: SECRET_KEY must never be in a ConfigMap or hardcoded. Always store it in a Kubernetes Secret (or Key Vault via Workload Identity).

ConfigMap pattern
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{APP_NAME}}-config
data:
  DJANGO_SETTINGS_MODULE: "config.settings.production"
  DJANGO_ALLOWED_HOSTS: "{{INGRESS_HOSTNAME}}"
  DATABASE_URL: "postgres://{{IDENTITY_NAME}}@{{PG_SERVER_NAME}}.postgres.database.azure.com:5432/{{DB_NAME}}?sslmode=require"

Writable Paths (DS012 Compliance)

When readOnlyRootFilesystem: true is set, Django apps need /tmp writable and optionally /app/staticfiles:

  • /tmp — required for file uploads (FILE_UPLOAD_TEMP_DIR defaults to /tmp), session data when using file-based sessions, and temporary processing

  • /app/staticfiles — optional, only needed if serving collected static files at runtime from the local filesystem (when not using WhiteNoise or a CDN)

Volume mount configuration
volumes:
  - name: tmp
    emptyDir: {}
  - name: staticfiles
    emptyDir: {}
containers:
  - name: app
    volumeMounts:
      - name: tmp
        mountPath: /tmp
      - name: staticfiles
        mountPath: /app/staticfiles

If static files are baked into the image at build time via collectstatic and served by WhiteNoise, the staticfiles volume can be omitted — only /tmp is required.


Resource Sizing

Django with Gunicorn runs multiple worker processes. Size for the number of workers (default: 2-4).

ResourceRequestLimit
CPU200m500m
Memory256Mi512Mi

Port Configuration

  • Default port: 8000

  • CLI flag: --bind 0.0.0.0:8000 passed to gunicorn

  • Env var override: PORT (read via gunicorn --bind 0.0.0.0:$PORT or int(os.environ.get("PORT", 8000)))

  • Workers formula: 2 * CPU_CORES + 1 (e.g. --workers 3 for a 1-vCPU container)

  • WSGI module path varies by project scaffold: config.wsgi:application, myproject.wsgi:application, or app.wsgi:application — check wsgi.py location

Gunicorn logs the port on startup: Listening at: http://0.0.0.0:8000


Build Commands

CommandPurposeWhen to run
python manage.py collectstatic --noinputGathers static files into STATIC_ROOTIn Dockerfile build stage (with SECRET_KEY=build-placeholder)
python manage.py migrate --noinputApplies database migrationsAs a Kubernetes init container — never in the Dockerfile

Important: Database migrations must run as an init container, not during the Docker build. The build stage has no access to the production database, and running migrations in the entrypoint creates race conditions when multiple replicas start simultaneously.

Init container for migrations
initContainers:
  - name: migrate
    image: {{ACR_NAME}}.azurecr.io/{{APP_NAME}}:{{TAG}}
    command: ["python", "manage.py", "migrate", "--noinput"]
    envFrom:
      - configMapRef:
          name: {{APP_NAME}}-config
      - secretRef:
          name: {{APP_NAME}}-secrets

Common Issues on AKS

IssueSymptomFix
collectstatic not runStatic files 404Run python manage.py collectstatic --noinput in Dockerfile build stage
ALLOWED_HOSTS not setDisallowedHost errorSet DJANGO_ALLOWED_HOSTS env var
Dev server in productionSingle-threaded, no securityUse gunicorn in ENTRYPOINT
Migrations not appliedrelation "..." does not existRun manage.py migrate as init container
SECRET_KEY not setImproperlyConfigured errorStore in Kubernetes Secret
Static files 404 in productionCSS/JS/images not loadingUse WhiteNoise or CDN for static files

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Microsoft
Publisher
Microsoft (Official)
Source
microsoft/skills · .github/plugins/azure-skills/skills/azure-kubernetes/azure-kubernetes-app-deploy · commit 0696600
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from .github/plugins/azure-skills/LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Also distributed in
microsoft/azure-skills

AutoGineer is not affiliated with or endorsed by Microsoft.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download azure-kubernetes-app-deploy.zip