Skip to content

feat: add-recipe tooling, deployment guard recipe, VNet/skipRBAC support, TF+PS parity#218

Merged
vyomnagrani merged 16 commits into
mainfrom
feature/deployment-guard-recipe-lab
Jun 17, 2026
Merged

feat: add-recipe tooling, deployment guard recipe, VNet/skipRBAC support, TF+PS parity#218
vyomnagrani merged 16 commits into
mainfrom
feature/deployment-guard-recipe-lab

Conversation

@dm-chelupati

Copy link
Copy Markdown
Collaborator

Summary

Adds the add-recipe command (bash + PowerShell) for augmenting existing agents with recipe components, plus VNet integration and skipRoleAssignments support across all IaC backends.

New: add-recipe tooling

  • bin/add-recipe.sh — Additive merge of a recipe into an existing agent directory. Auto-detects DT tenant, LAW ID, GitHub repo, and DT token from the existing agent config. Copies skills, subagents, hooks, automations (skip-if-exists). Merges toggles and connectors (skip duplicates by name). Replaces placeholders and writes secrets.
  • bin/ps/Add-Recipe.ps1 — Full PowerShell port with identical behavior, following New-Agent.ps1 conventions (CmdletBinding, Invoke-Jq, Check-Prerequisites).

New: Deployment Guard recipe

  • recipes/law-dynatrace-github-httptrigger-prvalidation — PR deployment guard with HTTP trigger, deployment-guard-analysis skill, and GitHub webhook integration.
  • recipes/dynatrace-servicenow — Dynatrace + ServiceNow incident response recipe with skills, subagents, hooks, and connector config.

VNet integration + skipRoleAssignments

  • Bicep (agent-core.bicep, main.bicep): VNet subnet ID, egress mode, sandbox configuration parameters. skipRoleAssignments parameter on all RBAC blocks.
  • Terraform (variables.tf, main.tf): Matching VNet/sandbox/egress variables. count/for_each conditionals with skip_role_assignments on all role assignment resources.
  • PowerShell (Deploy-Agent.ps1): Auto-creates VNet subnet with Microsoft.App/environments delegation if missing. Auto-detects existing agent → sets skipRoleAssignments=true on redeploy.

Fixes

  • apply-extras.sh: jq parse error when GitHub auth returns HTML
  • assemble-agent.sh: Dynatrace tools wired to skills, skills connected to subagents via allowedSkills
  • PR deployment guard trigger prompt simplified to reference skill directly
  • E2E test scripts and validation results (5 backends, 10 agents)

- New recipe: law-dynatrace-httptrigger
  LAW + Dynatrace MCP + GitHub repo + HTTP trigger + deployment guard
  Skills: deployment-guard-analysis, investigate-app-errors
  Subagents: deployment-guard, error-investigator
  Includes sample GitHub Actions workflow for PR webhooks

- New lab: deployment-guard
  End-to-end walkthrough using contoso-trading as target app
  Step 0: deploy app (prod + staging)
  Step 1-4: deploy agent, wire webhook, test with risky PR
  Demo script, prereqs check, setup automation

- Blog post: Shift Left with Azure SRE Agent

- Fix: macOS paste compatibility in new-agent.sh (affects all recipes)
- Dry-run test script for new recipe
- Dry-run: 27/31 passed (4 pre-existing/false-positive)
- E2E bicep-bash: create→deploy→verify→update→clone→verify all pass
- Fix: deployment-guard-analysis skill tools list (was empty)
- Test results recorded in E2E-RESULTS-law-dt-httptrigger.md
Bicep-bash:  5/5 core ✅ (verify 20/20, clone 16/16)
Bicep-ps:    6/7 ✅ (verify 20/20, clone 16/16)
TF-bash:     5/7 ✅ (verify passes after update, clone 16/16)
TF-ps:       0/7 ❌ (pre-existing Deploy-Tf.ps1 P0 bug)
AZD-bash:    3/7 (exit codes off, agents created + verified 16/16)

10 agents deployed and verified across 4 working backends.
- apply-extras.sh: catch non-JSON response from Github/config API before piping to jq
- New-Agent.ps1: use -Recurse with Get-ChildItem -Include (fixes Count on null)
- e2e tests: add 15s sleep before first verify for data-plane propagation
- bin/add-recipe.sh: new script to augment existing agents with recipes
- bin/ps/Add-Recipe.ps1: PowerShell port of add-recipe.sh
- terraform: VNet subnet/egress/sandbox vars + skipRoleAssignments on all RBAC
- Deploy-Agent.ps1: VNet subnet auto-create + skipRBAC auto-detect
- bicep: VNet integration + skipRoleAssignments support
- recipes: dynatrace-servicenow recipe, PR deployment guard prompt fix

@vyomnagrani vyomnagrani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vyomnagrani vyomnagrani merged commit ff0dbd9 into main Jun 17, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants