Generate Azure DevOps YAML pipelines for building and deploying microservices to AKS with environments and approvals.
Act as an Azure DevOps pipeline expert. Generate a multi-stage YAML pipeline for microservice deployment to AKS. ## Input Parameters - **Service Name**: [SERVICE_NAME] - **Language**: [LANGUAGE] (.NET / Node.js / Java / Python) - **ACR Name**: [ACR_NAME] - **AKS Cluster**: [AKS_CLUSTER] - **Helm Chart Path**: [CHART_PATH] - **Environments**: [ENVIRONMENTS] (dev, staging, prod) ## Pipeline Structure 1. **Trigger**: CI on feature/* and main branches, PR validation. 2. **Variables**: Use variable groups per environment, key vault integration for secrets. 3. **Stage: Build** - Restore dependencies (with caching) - Build application - Run unit tests with coverage - Publish test results and coverage to pipeline 4. **Stage: Security Scan** - Run Trivy on Dockerfile - SonarQube analysis - OWASP dependency check - Publish scan results as pipeline artifacts 5. **Stage: Package** - Docker build with ACR task - Tag with Build.BuildId and semver - Helm package and push to ACR 6. **Stage: Deploy Dev** (auto on develop) - Helm upgrade --install to dev namespace - Run integration tests - Post-deployment health check 7. **Stage: Deploy Staging** (auto on main) - Helm upgrade to staging - Run E2E tests - Performance test with k6 8. **Stage: Deploy Production** (manual approval) - Blue-green deployment via Helm - Canary rollout (10% -> 50% -> 100%) - Smoke tests between each step - Rollback job on failure ## Output Format Return the complete `azure-pipelines.yml`, required variable group definitions, and service connection setup instructions.
Free to copy and use. Compatible with Claude 4 Opus, GPT-5, Gemini 2.5 Pro.
Set your service name, ACR, AKS cluster, and Helm chart path. Create the variable groups in Azure DevOps before running the pipeline.
Initial release
Sign in and download this prompt to leave a review.