pilotswarm-azure-lessons
Workarounds for common Azure issues: RBAC with Conditional Access, PostgreSQL region restrictions, Key Vault + CSI Driver setup.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Workarounds for common Azure issues: RBAC with Conditional Access, PostgreSQL region restrictions, Key Vault + CSI Driver setup.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
The order of operations for changing a live agent safely — diagnose, patch, publish, converge, verify, roll back. Use whenever you are about to modify an agent package that something is already running on.
Deploy PilotSwarm to AKS using the repo's canonical scripts and checks. Use when refreshing secrets, building/pushing the worker image, rolling out to AKS, or verifying provider/model changes in the live cluster.
Reset remote PilotSwarm state for AKS safely. Use when wiping the PilotSwarm database/blob state, clearing stale orchestration history, or recovering from namespace drift and replay/nondeterminism issues.
Use when bringing up a fresh, isolated PilotSwarm environment (`mysandbox`, `myenv2`, etc.) via the npm Bicep/GitOps orchestrator at `deploy/scripts/deploy.mjs`. Covers `new-env` scaffolding, EDGE_MODE × TLS_SOURCE selection, the `all` aggregate, per-service redeploys with `--steps`, force-redeploy semantics, verification, and teardown. Strictly separate from the legacy bash path operated by `scripts/deploy-aks.sh`.
Use after deploying a PilotSwarm stamp with VPN_GATEWAY_ENABLED=true when an operator needs the Azure VPN client profile (azurevpnconfig.xml). Wraps deploy/scripts/auth/Get-VpnClientProfile.ps1 — downloads the gateway-issued profile zip via 'az network vnet-gateway vpn-client generate' and extracts it under the gitignored deploy/envs/local/<env>/vpn-client/ folder. The XML is the same for every user (no per-user credentials), and end users still authenticate with their own Entra ID at connect time.
How to compute model latency and estimated $ cost from PilotSwarm observability data. Read this before reporting that a model is "slow" or "expensive" — most apparent slowness is orchestration overhead, not model inference, and most cost numbers are guesses unless they reference a real published price card.
| name | pilotswarm-azure-lessons |
| description | Workarounds for common Azure issues: RBAC with Conditional Access, PostgreSQL region restrictions, Key Vault + CSI Driver setup. |
Verified workarounds for Azure issues encountered during PilotSwarm deployments.
In enterprise tenants with conditional access policies, az role assignment create may fail with
AADSTS530084 because the command calls the Graph API to resolve principal/role
IDs, and conditional access token protection policies block that call.
Workaround: Use az rest to call the ARM RBAC API directly,
bypassing Graph entirely:
ASSIGNMENT_ID=$(uuidgen | tr '[:upper:]' '[:lower:]')
az rest --method PUT \
--url "https://management.azure.com<SCOPE>/providers/Microsoft.Authorization/roleAssignments/${ASSIGNMENT_ID}?api-version=2022-04-01" \
--body "{
\"properties\": {
\"roleDefinitionId\": \"<SUBSCRIPTION_SCOPE>/providers/Microsoft.Authorization/roleDefinitions/<ROLE_GUID>\",
\"principalId\": \"<PRINCIPAL_OBJECT_ID>\",
\"principalType\": \"ServicePrincipal\"
}
}"
Common role definition GUIDs:
4633458b-17de-408a-b874-0445c86b69e6b86a8fe4-44ce-4948-aee5-eccb2c155cd7ba92f5b4-2d11-453d-a403-e96b0029c9feNote: az role assignment create may report an error even when the assignment
actually succeeds. A subsequent attempt returning RoleAssignmentExists confirms it worked.
When using AKV + Secrets Store CSI in AKS:
--enable-rbac-authorization trueKey Vault Secrets Officer to yourself (the operator) for storing secretsKey Vault Secrets User to the workload identity managed identity for reading secretsSecretProviderClass manifest with objectType: secret entriessecretObjects in the SecretProviderClassBuilding Docker images on macOS (Apple Silicon) produces ARM64 images by default.
AKS nodes run linux/amd64. Always use --platform linux/amd64 when building:
docker build --platform linux/amd64 -f deploy/Dockerfile.worker -t <tag> .
Without this, pods will fail with no match for platform in manifest on image pull.
When package.json uses file: links to a peer package (e.g., "pilotswarm-sdk": "file:../pilotswarm/packages/sdk"),
the Docker build context cannot follow symlinks outside the build root.
If package.docker.json references "^0.1.6" (npm), the deployed image gets the
published version — which may be behind the local source.
Fix: Copy the peer packages into the build context and use file: references in package.docker.json:
# Before docker build
cp -r ../pilotswarm/packages/sdk pilotswarm-sdk-local
cp -r ../pilotswarm/packages/app pilotswarm-app-local
"pilotswarm-sdk": "file:pilotswarm-sdk-local",
"pilotswarm": "file:pilotswarm-app-local"
Add the local copies to .gitignore.