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/express.md

Express / Fastify Knowledge Pack

Applies to: Projects detected with package.json containing express or fastify as a dependency

Quick Reference

PropertyValue
Signal filespackage.json containing express or fastify
Default port3000
Health path/healthz
Base templatetemplates/dockerfiles/node.Dockerfile (+ references/base-images.md)

Signal Handling

Node.js does not handle SIGTERM correctly when running as PID 1. The base template includes dumb-init as the entrypoint to forward signals properly; no application-level changes are needed unless the app registers explicit cleanup handlers.

Fastify listen caveat

Fastify defaults to listening on 127.0.0.1, which is unreachable from outside the container. Bind to 0.0.0.0 explicitly:

await fastify.listen({ port: 3000, host: '0.0.0.0' });

If the pod starts but health probes fail with connection refused, this is almost always the cause. Express already binds to 0.0.0.0 by default — no change needed for Express apps.

Package manager variants
Package ManagerInstall (all)Install (prod only)Lock File
npmnpm cinpm ci --omit=devpackage-lock.json
yarnyarn install --frozen-lockfileyarn install --frozen-lockfile --productionyarn.lock
pnpmpnpm install --frozen-lockfilepnpm install --frozen-lockfile --prodpnpm-lock.yaml

Copy the correct lock file in the Dockerfile COPY step to match the project's package manager.


Health Endpoints

Node.js frameworks do not provide health endpoints out of the box. Add a /healthz route manually.

Express
app.get('/healthz', (req, res) => {
  res.status(200).json({ status: 'UP' });
});
Fastify
fastify.get('/healthz', async () => {
  return { status: 'UP' };
});

For richer checks (database connectivity, downstream services), extend the handler to verify dependencies and return 503 when unhealthy.

Probe configuration in Deployment manifest
livenessProbe:
  httpGet:
    path: /healthz
    port: 3000
  initialDelaySeconds: 5
  periodSeconds: 15
  timeoutSeconds: 3
  failureThreshold: 3
readinessProbe:
  httpGet:
    path: /healthz
    port: 3000
  initialDelaySeconds: 5
  periodSeconds: 10
  timeoutSeconds: 3
  failureThreshold: 3

Note: Node.js apps start in under a second, so initialDelaySeconds: 5 is sufficient. No startupProbe is needed unless the app performs heavy initialization (e.g., loading ML models).


Database Profiles

Node.js projects use a variety of database libraries. The standard pattern is a DATABASE_URL connection string injected via environment variable:

LibraryConnection PatternConfig Property
pg (node-postgres)new Pool({ connectionString: process.env.DATABASE_URL })DATABASE_URL
Prismadatasource db { url = env("DATABASE_URL") } in schema.prismaDATABASE_URL
Sequelizenew Sequelize(process.env.DATABASE_URL)DATABASE_URL
Knexconnection: process.env.DATABASE_URL in knexfile.jsDATABASE_URL
Environment variables for PostgreSQL on AKS
env:
  - name: DATABASE_URL
    value: "postgresql://{{IDENTITY_NAME}}@{{PG_SERVER_NAME}}.postgres.database.azure.com:5432/{{DB_NAME}}?sslmode=require"
  - name: PGHOST
    value: "{{PG_SERVER_NAME}}.postgres.database.azure.com"
  - name: PGDATABASE
    value: "{{DB_NAME}}"
  - name: PGUSER
    value: "{{IDENTITY_NAME}}"
  - name: PGPORT
    value: "5432"
  - name: PGSSLMODE
    value: "require"

For Workload Identity with passwordless authentication, use the @azure/identity package with pg to obtain Azure AD tokens instead of passwords.


Writable Paths (DS012 Compliance)

When readOnlyRootFilesystem: true is set, Node.js apps need only /tmp writable:

  • Multipart uploads (e.g., multer, @fastify/multipart) stage files to /tmp

  • Logging libraries that buffer to disk use /tmp

Required volume mount
volumes:
  - name: tmp
    emptyDir: {}
containers:
  - name: app
    volumeMounts:
      - name: tmp
        mountPath: /tmp

Resource Sizing

Node.js is single-threaded and relatively lightweight. These are starting-point defaults — tune based on observed usage.

ResourceRequestLimit
CPU100m500m
Memory128Mi256Mi

For memory-intensive workloads (large payloads, SSR), increase the memory limit and set --max-old-space-size to ~75% of the limit.


Port Configuration

  • Default port: 3000

  • Env var override: PORT=3000

  • Code pattern: app.listen(process.env.PORT || 3000)

Express binds to 0.0.0.0 by default, so it is reachable from outside the container without additional configuration.

Fastify binds to 127.0.0.1 by default — you must pass host: '0.0.0.0' in the listen() call or the pod will start but all probes and traffic will fail with connection refused.


Build Commands

ScenarioBuild CommandOutputEntrypoint
TypeScriptnpm run build (invokes tsc)dist/node dist/index.js
JavaScript (no build)Nonesrc/node src/index.js
Bundler (esbuild/webpack)npm run builddist/bundle.jsnode dist/bundle.js

For TypeScript projects, ensure tsconfig.json has "outDir": "dist" and the Dockerfile copies the dist/ folder to the runtime stage. Do not install typescript or ts-node in the production image.


Common Issues on AKS

IssueSymptomFix
No SIGTERM handlingPod takes 30s to terminate (killed by SIGKILL after grace period)Use dumb-init as entrypoint, or add explicit process.on('SIGTERM', ...) handler to close the server gracefully
ECONNRESET on PostgreSQLError: Connection terminated unexpectedlyConfigure pool idleTimeoutMillis and connectionTimeoutMillis; Azure PG Flexible Server closes idle connections after ~5 min
Fastify localhost bindingHealth probes fail with connection refused despite app runningPass host: '0.0.0.0' to fastify.listen() — Fastify defaults to 127.0.0.1
node_modules bloatImage > 500MB, slow pulls from ACRRun npm ci --omit=dev in a separate stage; consider esbuild bundling for single-file output
Memory leak under loadPod OOMKilled after hours of trafficSet --max-old-space-size to ~75% of container memory limit (e.g., --max-old-space-size=384 for 512Mi limit); profile with --inspect locally

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