Azure Kubernetes App Deploy
MicrosoftOfficialCreated by Microsoft
- Skill
- Tool integration
- Cloud and DevOps
- MIT
- Low risk
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
Download the skill as a ZIP:
https://autogineer.com/agent-skills/microsoft/azure-kubernetes-app-deploy/downloadUnzip 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
detection.md — framework/port/health detection
safeguards.md — DS001-DS013 checklist
workload-identity.md — Workload Identity setup
rollback.md — recovery procedures
base-images.md — base image policy and
<LATEST_STABLE_*>resolution
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
- ATTRIBUTION.mdAdded by AutoGineer1.0 KiB
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md2.0 KiB
- knowledge-packs/frameworks/aspnet-core.md7.3 KiB
- knowledge-packs/frameworks/django.md6.0 KiB
- knowledge-packs/frameworks/express.md6.7 KiB
- knowledge-packs/frameworks/fastapi.md5.8 KiB
- knowledge-packs/frameworks/flask.md6.2 KiB
- knowledge-packs/frameworks/go.md6.8 KiB
- knowledge-packs/frameworks/nestjs.md6.7 KiB
- knowledge-packs/frameworks/nextjs.md7.1 KiB
- knowledge-packs/frameworks/spring-boot.md6.0 KiB
- phases/quick-deploy.md7.8 KiB
- references/base-images.md3.6 KiB
- references/detection.md3.5 KiB
- references/rollback.md2.0 KiB
- references/safeguards.md2.9 KiB
- references/workload-identity.md7.4 KiB
- templates/dockerfiles/dotnet.Dockerfile2.6 KiB
- templates/dockerfiles/dotnet.dockerignore125 B
- templates/dockerfiles/go.Dockerfile2.1 KiB
- templates/dockerfiles/go.dockerignore128 B
- templates/dockerfiles/java.Dockerfile3.0 KiB
- templates/dockerfiles/java.dockerignore156 B
- templates/dockerfiles/node.Dockerfile3.0 KiB
- templates/dockerfiles/node.dockerignore173 B
- templates/dockerfiles/python.Dockerfile2.6 KiB
- templates/dockerfiles/python.dockerignore201 B
- templates/dockerfiles/rust.Dockerfile3.2 KiB
- templates/dockerfiles/rust.dockerignore87 B
- templates/github-actions/deploy.yml7.4 KiB
- templates/k8s/configmap.yaml1.0 KiB
- templates/k8s/deployment.yaml3.4 KiB
- templates/k8s/gateway.yaml1.5 KiB
- templates/k8s/hpa.yaml1.4 KiB
- templates/k8s/httproute.yaml1.3 KiB
- templates/k8s/ingress.yaml1.9 KiB
- templates/k8s/namespace.yaml734 B
- templates/k8s/networkpolicy.yaml1.6 KiB
- templates/k8s/pdb.yaml758 B
- templates/k8s/service.yaml864 B
- templates/k8s/serviceaccount.yaml1.4 KiB
- templates/mermaid/architecture-diagram.md1.6 KiB
- templates/mermaid/summary-dashboard.md1.7 KiB
knowledge-packs/frameworks/django.md
Django Knowledge Pack
Applies to: Projects detected with
requirements.txt,pyproject.toml, orPipfilecontainingdjango, or presence ofmanage.py
Quick Reference
| Property | Value |
|---|---|
| Signal files | requirements.txt/pyproject.toml/Pipfile containing django, or manage.py |
| Default port | 8000 (gunicorn) |
| Health path | /health/ (django-health-check) |
| Base template | templates/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-checkConfiguration 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: 3Note: 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:
| Pattern | How it works |
|---|---|
dj-database-url | Parse 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-keyImportant: 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_DIRdefaults 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/staticfilesIf 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).
| Resource | Request | Limit |
|---|---|---|
| CPU | 200m | 500m |
| Memory | 256Mi | 512Mi |
Port Configuration
Default port: 8000
CLI flag:
--bind 0.0.0.0:8000passed togunicornEnv var override:
PORT(read viagunicorn --bind 0.0.0.0:$PORTorint(os.environ.get("PORT", 8000)))Workers formula:
2 * CPU_CORES + 1(e.g.--workers 3for a 1-vCPU container)WSGI module path varies by project scaffold:
config.wsgi:application,myproject.wsgi:application, orapp.wsgi:application— checkwsgi.pylocation
Gunicorn logs the port on startup: Listening at: http://0.0.0.0:8000
Build Commands
| Command | Purpose | When to run |
|---|---|---|
python manage.py collectstatic --noinput | Gathers static files into STATIC_ROOT | In Dockerfile build stage (with SECRET_KEY=build-placeholder) |
python manage.py migrate --noinput | Applies database migrations | As 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}}-secretsCommon Issues on AKS
| Issue | Symptom | Fix |
|---|---|---|
collectstatic not run | Static files 404 | Run python manage.py collectstatic --noinput in Dockerfile build stage |
ALLOWED_HOSTS not set | DisallowedHost error | Set DJANGO_ALLOWED_HOSTS env var |
| Dev server in production | Single-threaded, no security | Use gunicorn in ENTRYPOINT |
| Migrations not applied | relation "..." does not exist | Run manage.py migrate as init container |
SECRET_KEY not set | ImproperlyConfigured error | Store in Kubernetes Secret |
| Static files 404 in production | CSS/JS/images not loading | Use 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 or Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download azure-kubernetes-app-deploy.zip