/sdlc-harness:deployment Describe the Azure services and deployment targetfrom sdlc-harness
Create or update Azure deployment infrastructure with Bicep/AVM modules, azd orchestration, and Container Apps configuration.
Ships in sdlc-harness. Installing the plugin adds it to Claude Code.
Scope: this is the Azure variant of the deployment prompt (Bicep/AVM/azd). For AWS or GCP targets, use the installed cloud pack's deployment skill instead — no manual-mode prompt ships for them yet.
You are creating or updating the Azure deployment infrastructure for a project.
This prompt covers two SDLC phases:
azd configurationFollow the Azure Verified Modules (AVM) patterns for Landing Zone alignment,
and use Azure Developer CLI (azd) for deployment orchestration.
Ask the user to provide:
If any of these are unclear, ask 1–2 focused questions before proceeding.
azd for one-command provisioning and deployment.Before starting, load these resources:
instructions/bicep-code-best-practices.instructions.md from the
github/awesome-copilot repository via the GitHub MCP server's file-contents tool or
fetch (skip if unreachable)
(naming conventions, structure, parameters, security, AVM patterns)azure-cloud-development collection
from the github/awesome-copilot repository via the GitHub MCP server's file-contents
tool or fetch (skip if unreachable)
(includes the update-avm-modules-in-bicep prompt for updating AVM module versions)#fetch https://azure.github.io/Azure-Verified-Modules/indexes/bicep/bicep-resource-modules/
Cross-reference all br/public:avm/res/... references against this authoritative source.instructions/containerization-docker-best-practices.instructions.md
from the github/awesome-copilot repository via the GitHub MCP server's file-contents
tool or fetch (skip if unreachable)
(multi-stage builds, layer caching, image security)instructions/kubernetes-deployment-best-practices.instructions.md
from the github/awesome-copilot repository via the GitHub MCP server's file-contents
tool or fetch (skip if unreachable)
(when deploying to AKS: pod security, resource limits, health checks)instructions/github-actions-ci-cd-best-practices.instructions.md
from the github/awesome-copilot repository via the GitHub MCP server's file-contents
tool or fetch (skip if unreachable)Based on the user's inputs, determine:
Create infra/ folder structure:
infra/
├── main.bicep # Main orchestration (all resources)
├── main.parameters.json # Default parameters
├── abbreviations.json # Azure resource abbreviations (azd convention)
├── modules/
│ ├── containerAppsEnvironment.bicep # Shared Container Apps Environment (ONE per solution)
│ ├── containerApp.bicep # Individual Container App (reusable per service)
│ ├── cosmosDb.bicep # Cosmos DB with AVM + private endpoints
│ ├── storageAccount.bicep # Storage with AVM + blob/queue private endpoints
│ ├── ai-services-deployments.bicep # AI Foundry / OpenAI model deployments
│ ├── virtualNetwork.bicep # VNet + subnets (when the design calls for a VNet)
│ └── role.bicep # Reusable RBAC role assignment
└── vscode_web/ # VS Code Web launch config (optional)
└── index.json
scripts/
├── checkquota.sh # Pre-deployment quota validation
└── quota_check_params.sh # Quota check parameter definitions
AVM module rules:
ALWAYS use AVM modules from br/public:avm/res/... when available.
Check Azure Verified Modules registry
for the latest module versions.
Common AVM modules:
| Azure Service | AVM Module Path |
|---|---|
| Cosmos DB | br/public:avm/res/document-db/database-account |
| Storage Account | br/public:avm/res/storage/storage-account |
| Container Apps Environment | br/public:avm/res/app/managed-environment |
| Container App | br/public:avm/res/app/container-app |
| Key Vault | br/public:avm/res/key-vault/vault |
| Log Analytics | br/public:avm/res/operational-insights/workspace |
| App Insights | br/public:avm/res/insights/component |
| Container Registry | br/public:avm/res/container-registry/registry |
| AI Foundry Hub | br/public:avm/res/machine-learning-services/workspace |
| Virtual Network | br/public:avm/res/network/virtual-network |
| Private Endpoint | br/public:avm/res/network/private-endpoint |
For each module, configure:
roleAssignments param with least-privilegeimport { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.5.1'Parameters: Environment-specific values live in main.parameters.json.
Monitoring (Log Analytics + App Insights) is always provisioned — diagnostic
settings are not optional. Redundancy and scaling are set per resource from
the design’s availability and performance requirements, not via global toggles.
Landing Zone alignment:
targetScope = 'resourceGroup'
// Deployer info for CreatedBy tag
var deployerInfo = deployer()
var deployerIdentityName = deployerInfo.?userPrincipalName != null
? split(deployerInfo.userPrincipalName, '@')[0]
: 'Identity-${deployerInfo.objectId}'
// Naming convention
var solutionSuffix = toLower('${solutionName}${solutionUniqueText}')
// Standard tags
var allTags = union({
'azd-env-name': solutionName
'TemplateName': '<PROJECT_NAME>'
'CreatedBy': deployerIdentityName
}, tags)
// Private networking module — include only when the design implements the
// full private path (VNet + private DNS + private endpoints); no partial toggle
module virtualNetwork './modules/virtualNetwork.bicep' = { ... }
// Monitoring — always provisioned (see the Parameters note above)
module logAnalytics 'br/public:avm/res/operational-insights/workspace:<VERSION>' = { ... }
module appInsights 'br/public:avm/res/insights/component:<VERSION>' = { ... }
// Outputs for azd
output AZURE_COSMOS_ENDPOINT string = cosmosDb.outputs.endpoint
output AZURE_STORAGE_ACCOUNT_NAME string = storage.outputs.name
Module pattern (follow application project style — each module wraps AVM):
// modules/cosmosDb.bicep
@description('Required. Name of the Cosmos DB Account.')
param name string
param location string
param tags object = {}
param privateEndpointSubnetResourceId string?
param sqlPrivateDnsZoneResourceId string?
param dataAccessIdentityPrincipalId string?
param logAnalyticsWorkspaceResourceId string?
param zoneRedundant bool
var privateNetworkingEnabled = !empty(sqlPrivateDnsZoneResourceId) && !empty(privateEndpointSubnetResourceId)
module cosmosAccount 'br/public:avm/res/document-db/database-account:<VERSION>' = {
name: take('avm.res.document-db.account.${name}', 64)
params: {
name: name
location: location
disableLocalAuthentication: true // Managed Identity only
publicNetworkAccess: privateNetworkingEnabled ? 'Disabled' : 'Enabled'
diagnosticSettings: !empty(logAnalyticsWorkspaceResourceId)
? [{ workspaceResourceId: logAnalyticsWorkspaceResourceId }] : []
privateEndpoints: privateNetworkingEnabled ? [{ ... }] : []
tags: tags
}
}
Shared Container Apps Environment pattern (mandatory):
When deploying multiple container apps, ALL apps MUST share a single Container Apps Environment. Deploy the environment once, then pass its resource ID to each container app module:
// main.bicep — deploy ONE shared environment
module containerAppsEnv 'br/public:avm/res/app/managed-environment:<VERSION>' = {
name: 'containerAppsEnvironment'
params: {
name: 'cae-${solutionSuffix}'
location: location
logAnalyticsWorkspaceResourceId: logAnalyticsWorkspaceResourceId
zoneRedundant: false // Set true when the design requires zone redundancy
tags: allTags
}
}
// Deploy each container app referencing the SAME environment
module apiApp 'br/public:avm/res/app/container-app:<VERSION>' = {
name: 'apiContainerApp'
params: {
name: 'ca-api-${solutionSuffix}'
environmentResourceId: containerAppsEnv.outputs.resourceId // shared
// ...
}
}
module webApp 'br/public:avm/res/app/container-app:<VERSION>' = {
name: 'webContainerApp'
params: {
name: 'ca-web-${solutionSuffix}'
environmentResourceId: containerAppsEnv.outputs.resourceId // same environment
// ...
}
}
azure.yaml for azdGenerate the azure.yaml at repo root (follow application project pattern):
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
name: <PROJECT_NAME>
metadata:
template: <PROJECT_NAME>@1.0
requiredVersions:
azd: '>=1.18.2'
services:
api:
project: ./src/api # Each service is independent under src/
host: containerapp
language: python
docker:
path: ./src/api/Dockerfile
context: ./src/api
agent:
project: ./src/agent
host: containerapp
language: python
docker:
path: ./src/agent/Dockerfile
context: ./src/agent
# For multi-container deployments, add additional services:
# web:
# project: ./src/web
# host: containerapp
# language: typescript
# docker:
# path: ./src/web/Dockerfile
# context: ./src/web
# NOTE: All container apps MUST share a single Container Apps Environment.
# The environment is defined once in infra/main.bicep and referenced by all apps.
# This ensures shared networking, logging, and Dapr configuration.
hooks:
postdeploy:
posix:
shell: sh
run: |
echo "-----"
echo "🧭 App Details:"
echo "✅ Name: $CONTAINER_APP_NAME"
echo "🌐 Endpoint: https://$CONTAINER_APP_FQDN"
echo "🔗 Portal: https://portal.azure.com/#resource/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$AZURE_RESOURCE_GROUP/providers/Microsoft.App/containerApps/$CONTAINER_APP_NAME"
echo "-----"
interactive: true
windows:
shell: pwsh
run: |
Write-Host "-----"
Write-Host "🧭 App Details:"
Write-Host "✅ Name: $env:CONTAINER_APP_NAME"
Write-Host "🌐 Endpoint: https://$env:CONTAINER_APP_FQDN"
Write-Host "🔗 Portal: https://portal.azure.com/#resource/subscriptions/$env:AZURE_SUBSCRIPTION_ID/resourceGroups/$env:AZURE_RESOURCE_GROUP/providers/Microsoft.App/containerApps/$env:CONTAINER_APP_NAME" -ForegroundColor Cyan
Write-Host "-----"
interactive: true
Every project MUST include a Dockerfile for Container Apps deployment:
# Multi-stage build for production
FROM python:3.12-slim AS builder
WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN pip install uv && uv sync --no-dev --frozen
FROM python:3.12-slim AS runtime
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
COPY src/ ./src/
# or COPY app/ ./app/ (for FastAPI template)
ENV PATH="/app/.venv/bin:$PATH"
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
Following the application project pattern, each service under src/ gets its own .devcontainer/ with
service-specific tooling and dependencies. This per-service isolation ensures that engineers
working on one layer can build, test, and run independently — without pulling in dependencies
from other services.
Generate a .devcontainer/ folder inside each service directory using the matching template below.
Each devcontainer uses a custom Dockerfile (not just image) so service-specific system
dependencies (e.g., poppler-utils, libpq-dev) can be added without affecting other services.
Based on the base app template repo. Use for processor services, workers, CLI tools, and data pipelines.
src/<service>/.devcontainer/Dockerfile:
ARG DEBIAN_VERSION=bookworm
FROM mcr.microsoft.com/devcontainers/python:3.12-${DEBIAN_VERSION}
WORKDIR /app
# Install service-specific system dependencies here, for example:
# RUN apt-get update && apt-get install -y --no-install-recommends poppler-utils && rm -rf /var/lib/apt/lists/*
src/<service>/.devcontainer/devcontainer.json:
{
"name": "<SERVICE_NAME>",
"build": {
"context": "..",
"dockerfile": "Dockerfile",
"args": {
"DEBIAN_VERSION": "bookworm"
}
},
"features": {
"ghcr.io/va-h/devcontainers-features/uv:1": { "version": "latest" },
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/azure/azure-dev/azd:latest": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/dhoeric/features/hadolint:1": {}
},
"containerEnv": {
"PYTHONUNBUFFERED": "True",
"UV_LINK_MODE": "copy",
"UV_PROJECT_ENVIRONMENT": "/home/vscode/.venv"
},
"postCreateCommand": "uv sync --frozen",
"postStartCommand": "uv tool install pre-commit --with pre-commit-uv --force-reinstall",
"customizations": {
"vscode": {
"extensions": [
"github.copilot",
"github.copilot-chat",
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"njpwerner.autodocstring",
"exiasr.hadolint",
"ms-azuretools.vscode-bicep",
"ms-azuretools.azure-dev",
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml",
"tamasfe.even-better-toml",
"shardulm94.trailing-spaces",
"yzhang.markdown-all-in-one"
]
}
},
"remoteUser": "vscode"
}
Key points:
context: ".." — build context is the service root (one level up from .devcontainer/)forwardPorts — console/worker apps do not expose HTTP endpointshumao.rest-client — not needed for non-API servicespostStartCommand installs pre-commit hooks for code quality on every container startUV_PROJECT_ENVIRONMENT uses absolute path /home/vscode/.venv for consistencyBased on the API template repo. Use for REST APIs, web services, and health-probed microservices.
src/<service>/.devcontainer/Dockerfile:
ARG DEBIAN_VERSION=bookworm
FROM mcr.microsoft.com/devcontainers/python:3.12-${DEBIAN_VERSION}
WORKDIR /app
# Install service-specific system dependencies here if needed
src/<service>/.devcontainer/devcontainer.json:
{
"name": "<SERVICE_NAME>",
"build": {
"context": "..",
"dockerfile": "Dockerfile",
"args": {
"DEBIAN_VERSION": "bookworm"
}
},
"features": {
"ghcr.io/va-h/devcontainers-features/uv:1": { "version": "latest" },
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/azure/azure-dev/azd:latest": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/dhoeric/features/hadolint:1": {}
},
"containerEnv": {
"PYTHONUNBUFFERED": "True",
"UV_LINK_MODE": "copy",
"UV_PROJECT_ENVIRONMENT": "/home/vscode/.venv"
},
"postCreateCommand": "uv sync --frozen",
"postStartCommand": "uv tool install pre-commit --with pre-commit-uv --force-reinstall",
"forwardPorts": [8000],
"customizations": {
"vscode": {
"extensions": [
"github.copilot",
"github.copilot-chat",
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"njpwerner.autodocstring",
"exiasr.hadolint",
"ms-azuretools.vscode-bicep",
"ms-azuretools.azure-dev",
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml",
"tamasfe.even-better-toml",
"shardulm94.trailing-spaces",
"yzhang.markdown-all-in-one",
"humao.rest-client"
]
}
},
"remoteUser": "vscode"
}
Key differences from 5a:
humao.rest-client included for testing endpoints via .http filesUse for React SPAs, Vite-based frontends, and TypeScript web applications.
src/frontend/.devcontainer/base.Dockerfile:
ARG VARIANT=20-bookworm
FROM mcr.microsoft.com/devcontainers/javascript-node:${VARIANT}
# Install global packages needed for the build toolchain
RUN npm install -g typescript yarn react-app-rewired
src/frontend/.devcontainer/devcontainer.json:
{
"name": "<PROJECT_NAME>-frontend",
"build": {
"dockerfile": "base.Dockerfile",
"context": "..",
"args": {
"VARIANT": "20-bookworm"
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postCreateCommand": "yarn install",
"forwardPorts": [5173],
"customizations": {
"vscode": {
"extensions": [
"github.copilot",
"github.copilot-chat",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"christian-kohler.path-intellisense",
"christian-kohler.npm-intellisense",
"xabikos.ReactSnippets",
"ms-vscode.vscode-typescript-next",
"bradlc.vscode-tailwindcss",
"ms-azuretools.vscode-docker",
"ms-azuretools.azure-dev"
]
}
},
"remoteUser": "node"
}
Key differences from Python services:
remoteUser: "node" (not "vscode") — Node.js container conventionyarn install as post-create command (or npm install if the project uses npm)| Service type | Template | Base image | Forwarded port | Key differences |
|---|---|---|---|---|
| Console, worker, pipeline, CLI | 5a | python:3.12-bookworm | None | No HTTP port, no REST Client |
| FastAPI / REST API | 5b | python:3.12-bookworm | 8000 | Uvicorn port + REST Client |
| React / TypeScript SPA | 5c | javascript-node:20-bookworm | 5173 | Node toolchain, yarn, remoteUser: "node" |
Common across all templates:
context: ".." — build context points to the service rootNote: Do not generate a single integrated devcontainer at the repo root. Each service is an independent project with its own dependencies, tooling, and container image.
Define how deployments flow through environments:
┌──────────┐ ┌──────────┐ ┌──────────────┐
│ Dev │────▶│ Staging │────▶│ Production │
│ (auto) │ │ (auto) │ │ (approval) │
└──────────┘ └──────────┘ └──────────────┘
│ │ │
azd up azd up azd up
(dev.env) (staging.env) (prod.env)
For each environment, generate:
.azure/<env>/.env — environment-specific variablesGenerate scripts/checkquota.sh for pre-deployment validation:
#!/bin/bash
# Validates Azure OpenAI quota availability across regions
# Usage: Called by CI/CD or manually before azd up
#
# Required env vars:
# AZURE_SUBSCRIPTION_ID, AZURE_REGIONS (comma-separated), GPT_MIN_CAPACITY
IFS=', ' read -ra REGIONS <<< "$AZURE_REGIONS"
for REGION in "${REGIONS[@]}"; do
echo "🔍 Checking region: $REGION"
QUOTA_INFO=$(az cognitiveservices usage list --location "$REGION" --output json)
# Check available capacity vs minimum required
# Output VALID_REGION if sufficient quota found
done
Generate cross-platform post-deploy hooks (inline in azure.yaml — see Step 3).
For complex post-provisioning, create scripts/post-provision.sh:
#!/bin/bash
set -euo pipefail
echo "Running post-provisioning setup..."
azd env get-values > .env
echo "✅ Post-provisioning complete."
Verify the following exit criteria:
Phase 3 — Repo Structure & CI/CD:
azure.yaml is configured for azd up / azd deploy..devcontainer/devcontainer.json is configured for Codespaces.azd deployment stages.Phases 8–9 — Release:
azd up (idempotent).For each criterion, mark it as:
Return a single markdown response with these sections:
infra/ (ready to paste)azure.yaml — full configurationdevcontainer.json configurationFiles this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
6 commands in this plugin
/implementation-and-testsImplementation and Tests Prompt (SDLC Phase 4)Implement features with test-driven development following SDLC Phase 4. Generates production code, unit tests, and integration tests with acceptance criteria./qa-rai-releaseQa Rai ReleaseRun QA review, RAI assessment, and release preparation for implemented features. Covers automated review, manual QA checklists, and release scripts./Other plugins' commands for the same job
npx claudepluginhub dongbumlee/sdlc-harness --plugin sdlc-harness