diff --git a/.claude/skills/deploy-agent-aks-agentid/SKILL.md b/.claude/skills/deploy-agent-aks-agentid/SKILL.md new file mode 100644 index 0000000..62f657e --- /dev/null +++ b/.claude/skills/deploy-agent-aks-agentid/SKILL.md @@ -0,0 +1,294 @@ +--- +name: deploy-agent-aks-agentid +description: 'AI-led, end-to-end deployment of an agent that authenticates with Microsoft Entra Agent ID to Azure Kubernetes Service, using Azure Workload Identity instead of client secrets. Use when an engineering team wants to host their own agent (or this repo''s `sidecar/dev` sample) on AKS with the Entra Agent ID auth-sidecar pattern; when promoting an existing docker-compose stack from ClientSecret to secretless federation; or when an organization already standardized on Kubernetes and needs Agent ID to fit alongside their other workloads. Includes a kind-based local smoke test (no Azure cost), a one-shot orchestrator, a port-forward workflow for the OBO sign-in flow, and an explicit "Adapt for your own agent" section. NOT for Azure Container Apps (use `deploy-agent-aca-dev`), App Service (use `deploy-agent-appservice-dev`), or the AWS Bedrock variant (use `deploy-agent-aca-aws`). Chains to `entra-agent-id-setup` for the Blueprint + Agent Identity + Client SPA objects, and pairs with `teardown-agent-aks-agentid` for cleanup.' +--- + +# Deploy an Entra Agent ID Agent to Azure Kubernetes Service (AI-Led) + +End-to-end, **secretless** deployment of an agent that uses the Microsoft Entra Agent ID auth-sidecar on AKS. The included `sidecar/dev` sample is the default runnable artifact; the skill also walks an external team through **adapting their own agent** to the same pattern. + +One federation chain — Kubernetes ServiceAccount → Blueprint app. **No client secrets in the cluster.** No UAMI in the middle. + +**Canonical manifests:** [`manifests/`](./manifests/). Long-form walkthrough tutorial: [`deploy/azure/kubernetes-service/dev/README.md`](../../../deploy/azure/kubernetes-service/dev/README.md). + +## When to Use + +- An engineering team wants to host their own agent on AKS using the Entra Agent ID sidecar pattern (autonomous app-identity flow + optional On-Behalf-Of user flow). +- The team already has AKS as a platform standard and needs Agent ID to fit alongside other workloads — no new compute service. +- The team wants the **secretless** posture: Workload Identity, projected SA tokens, FIC trust on the Blueprint app — no client secrets stored in the cluster. +- The user has a docker-compose dev stack from `sidecar/dev` and wants to promote it to AKS without rewriting the agent code. +- A non-Azure k8s cluster (EKS, GKE, on-prem) is the eventual target — this skill produces a reference layout that is 95% portable; see [references/non-azure-k8s.md](./references/non-azure-k8s.md). + +## Do NOT Use When + +- **Azure Container Apps** is the target — use [`deploy-agent-aca-dev`](../deploy-agent-aca-dev/SKILL.md). +- **Azure App Service** is the target — use `deploy-agent-appservice-dev`. +- **AWS Bedrock** is the LLM backend — use [`deploy-agent-aca-aws`](../deploy-agent-aca-aws/SKILL.md). +- **Local laptop docker-compose** is sufficient — use `sidecar/dev/` directly with `docker compose up`. No federation needed. +- The team only needs the agent for a short demo with no Kubernetes plans — ACA is cheaper and simpler. + +## Prerequisites (verify BEFORE running anything) + +1. **Entra role** on the signing-in user, one of: `Global Administrator`, `Agent ID Administrator`, `Agent ID Developer`. If unsure, run the [`entra-agent-id-setup`](../entra-agent-id-setup/SKILL.md) skill first — it surfaces the role requirement and creates the Blueprint/Agent/SPA objects. +2. **Azure RBAC**: `Owner` or `Contributor` on the subscription where AKS will live, plus `User Access Administrator` if the AKS attach-ACR step needs to grant `AcrPull`. +3. **Tooling**: + - `az` ≥ 2.60 with `aks-preview` extension (`az extension add --name aks-preview`) + - `kubectl` ≥ 1.28 + - `pwsh` 7.4+ with `Microsoft.Graph.Authentication` (`Install-Module Microsoft.Graph.Authentication -Scope CurrentUser`) + - Optional for local smoke test: Docker Desktop + `kind` ≥ 0.20 + - Optional for "Adapt for your own agent": a container image of the user's agent in any registry reachable by AKS +4. **Tenant + subscription confirmed with the user.** ALWAYS confirm before any `az` command that mutates resources. Users frequently have multiple tenants; pick the wrong one and you create a half-deployed cluster in the wrong place. +5. **Entra Agent ID base objects exist** — Blueprint, Agent Identity, and (for OBO) a Client SPA. If not, chain `entra-agent-id-setup` first. +6. **Resource providers registered** on first use of a fresh subscription: + `Microsoft.ContainerService`, `Microsoft.ContainerRegistry`, `Microsoft.Compute`, `Microsoft.Network`, `Microsoft.Storage`, `Microsoft.OperationalInsights`, `Microsoft.OperationsManagement`. `01-create-aks.ps1` checks and registers what's missing. + +> [!NOTE] +> **All scripts are PowerShell (pwsh 7.4+).** Run them with `pwsh -NoProfile -File