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

Go Knowledge Pack

Applies to: Projects detected with go.mod containing github.com/gin-gonic/gin, github.com/labstack/echo, github.com/gofiber/fiber, or any Go project using the standard library net/http for HTTP serving

Quick Reference

PropertyValue
Signal filesgo.mod (gin/echo/fiber or stdlib net/http)
Default port8080
Health path/healthz + /ready
Base templatetemplates/dockerfiles/go.Dockerfile (+ references/base-images.md)

Build Flags

Two flags are required for a correct production build:

  • CGO_ENABLED=0 produces a fully static binary with no libc dependency — required when targeting the distroless static image. If CGO is needed (e.g., for sqlite3 or cgo bindings), use the distroless cc image instead.

  • -ldflags="-s -w" strips debug symbols and DWARF info, reducing binary size by ~30%.


Health Endpoints

Go does not provide health check endpoints out of the box — you must implement them manually. Example using standard library:

http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
    w.WriteHeader(http.StatusOK)
    w.Write([]byte(`{"status":"ok"}`))
})
http.HandleFunc("/ready", func(w http.ResponseWriter, r *http.Request) {
    if err := db.Ping(); err != nil {
        w.WriteHeader(http.StatusServiceUnavailable)
        w.Write([]byte(`{"status":"not ready"}`))
        return
    }
    w.WriteHeader(http.StatusOK)
    w.Write([]byte(`{"status":"ready"}`))
})
Probe configuration in Deployment manifest
livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
  initialDelaySeconds: 3
  periodSeconds: 10
  timeoutSeconds: 3
  failureThreshold: 3
readinessProbe:
  httpGet:
    path: /ready
    port: 8080
  initialDelaySeconds: 3
  periodSeconds: 10
  timeoutSeconds: 3
  failureThreshold: 3

Note: Go binaries start in milliseconds — initialDelaySeconds: 3 is generous. No JVM warmup or interpreter startup to wait for.


Graceful Shutdown

Implement signal.NotifyContext with srv.Shutdown(ctx) to allow in-flight requests to complete before the pod exits during a rolling update. Without this, connections are dropped and callers receive 502 errors.


Database Profiles

Go does not have a built-in profile system. Database configuration is typically driven by environment variables:

LibraryDriverConnection Env Var
database/sql + pgxgithub.com/jackc/pgx/v5/stdlibDATABASE_URL
GORMgorm.io/driver/postgresDATABASE_URL
sqlxgithub.com/jmoiron/sqlx + pgxDATABASE_URL
pgx directgithub.com/jackc/pgx/v5DATABASE_URL
Environment variables for PostgreSQL on AKS
env:
  - name: DATABASE_URL
    value: "host={{PG_SERVER_NAME}}.postgres.database.azure.com port=5432 dbname={{DB_NAME}} user={{IDENTITY_NAME}} sslmode=require"
Workload Identity with pgx

Use azidentity to obtain Azure AD tokens and inject them via pgx's BeforeConnect hook — no password stored:

import (
    "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
    "github.com/jackc/pgx/v5"
)

cred, _ := azidentity.NewDefaultAzureCredential(nil)

config, _ := pgx.ParseConfig(os.Getenv("DATABASE_URL"))
config.BeforeConnect = func(ctx context.Context, cfg *pgx.ConnConfig) error {
    token, err := cred.GetToken(ctx, policy.TokenRequestOptions{
        Scopes: []string{"https://ossrdbms-aad.database.windows.net/.default"},
    })
    if err != nil {
        return err
    }
    cfg.Password = token.Token
    return nil
}
ConfigMap pattern
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{APP_NAME}}-config
data:
  DATABASE_URL: "host={{PG_SERVER_NAME}}.postgres.database.azure.com port=5432 dbname={{DB_NAME}} user={{IDENTITY_NAME}} sslmode=require"

Writable Paths (DS012 Compliance)

When readOnlyRootFilesystem: true is set, Go apps typically need no writable paths:

  • Go compiles to a static binary — no temp files, no interpreted bytecode, no session storage

  • The distroless static base image has no shell or package manager that writes to disk

Optional /tmp mount

If your application explicitly writes temporary files (e.g., file uploads, report generation):

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

Most Go web APIs do not need this.


Resource Sizing

Go compiles to a static binary with no runtime — it is the most resource-efficient option.

ResourceRequestLimit
CPU50m200m
Memory64Mi128Mi

Port Configuration

  • Default port: 8080 (Go convention, not enforced by any framework)

  • Env var override: PORT (commonly used pattern)

  • Bind port >= 1024 — lower ports require elevated privileges; running as non-root (uid 65534) means port 80 or 443 will fail with permission denied.

Code pattern
port := os.Getenv("PORT")
if port == "" {
    port = "8080"
}
log.Printf("Listening on :%s", port)
log.Fatal(http.ListenAndServe(":"+port, router))

All major Go frameworks (Gin, Echo, Fiber) accept the listen address as a string — no special configuration property needed.


Build Commands

VariantCommandNotes
StandardCGO_ENABLED=0 go build -ldflags="-s -w" -o server ./cmd/serverProduction binary, stripped
Race detector (test only)go build -race -o server ./cmd/serverDo not use in production — 10x overhead
Multiple binariesCGO_ENABLED=0 go build -ldflags="-s -w" -o migrate ./cmd/migrateBuild each binary target separately

The ./cmd/server path is conventional for Go projects using the Standard Go Project Layout. Adjust to match the actual main package location.


Common Issues on AKS

IssueSymptomFix
Binary not statically linkedexec format error or not found in distrolessEnsure CGO_ENABLED=0 is set during build; if CGO is required, use the distroless cc image instead of the distroless static image
DNS resolution issues during builddial tcp: lookup ... no such hostAdd ca-certificates to the build stage or use a Debian-based build image
Graceful shutdown not implementedConnections dropped during rolling update, 502 errorsImplement signal.NotifyContext with srv.Shutdown(ctx) — give in-flight requests time to complete before exit
Binary name mismatchexec /server: no such file or directoryVerify the -o flag in go build matches the ENTRYPOINT path in the Dockerfile
Port < 1024 with non-root userbind: permission deniedUse port 8080 (or any port >= 1024); never bind to 80 or 443 inside the container

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