[ResilienceManagement] Add create commands (namespace: resilience) - #3166
[ResilienceManagement] Add create commands (namespace: resilience)#3166adishiritwick wants to merge 4 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution @adishiritwick! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
Pull request overview
Adds Resilience Management “create” operations to the resilience namespace, extending the toolset beyond read-only scenarios by enabling usage plan and enrollment creation via ARM, along with unit/live test coverage and documentation/tooling updates.
Changes:
- Added
azmcp resilience usageplan createandazmcp resilience usageplan enrollment createcommands, wired throughIResilienceManagementService. - Expanded live test infrastructure and added unit/integration tests for the new create commands.
- Updated Azure MCP Server docs/prompts, consolidated tool mappings, and changelog entry.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/test-resources.bicep | Adds outputs for isolated “create” test resource names. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/test-resources-post.ps1 | Creates isolated RG/service group for create live tests (note: outside harness-managed RG). |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/UsagePlanCreateCommandTests.cs | New unit tests for usage plan create command validation/results/errors. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommandTests.cs | New unit tests for enrollment create command validation/results/errors. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/ResilienceManagementCommandTests.cs | Adds live/integration scenarios for creating usage plans and enrollments. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/assets.json | Updates recorded-test assets tag. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/ResilienceManagementService.cs | Implements ARM create/update flows for usage plans and enrollments. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/IResilienceManagementService.cs | Extends service interface with create APIs. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/ResilienceManagementSetup.cs | Registers new commands and adds them to command groups. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/UsagePlanCreateOption.cs | Adds options for usage plan creation. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentCreateOption.cs | Adds options for enrollment creation. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/UsagePlanCreateCommand.cs | New command implementation + error mapping for usage plan create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommand.cs | New command implementation + error mapping for enrollment create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/ResilienceManagementJsonContext.cs | Registers new response models for AOT-safe JSON serialization. |
| servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json | Adds a consolidated “create” tool mapping for the new commands. |
| servers/Azure.Mcp.Server/README.md | Adds example prompts for the new create scenarios. |
| servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | Adds E2E prompts for the new tool IDs. |
| servers/Azure.Mcp.Server/docs/azmcp-commands.md | Adds CLI docs for the new create commands. |
| servers/Azure.Mcp.Server/changelog-entries/1782549900000.yaml | Adds changelog entries for the new features. |
| # and carries the same Owners/DeleteAfter tags as the managed resource group so subscription-wide | ||
| # expiry-based clean-up (see New-TestResources.ps1's DeleteAfterHours) reclaims it automatically. | ||
| $managedResourceGroup = Get-AzResourceGroup -Name $ResourceGroupName | ||
| New-AzResourceGroup -Name $createResourceGroupName -Location $managedResourceGroup.Location -Tag $managedResourceGroup.Tags -Force | Out-Null |
There was a problem hiding this comment.
This resource group is created after New-TestResources.ps1 grants the test identity Owner only on the harness-managed resource group. The live tests call the new command as that test identity, so creating a usage plan in $createResourceGroupName will fail with 403 in CI unless the identity already has subscription-wide access. Pass TestApplicationOid into this script and grant it the required role on the new resource group, or keep the create test resources inside the managed group.
Adds the authoring (create-or-update) commands to the Azure Resilience Management toolset (Azure.Mcp.Tools.ResilienceManagement, command namespace resilience).
This is PR 2 of the rollout plan in #2894 — building on the read-only surface delivered in #2948. It adds create commands across the goal and usage-plan command groups, reusing the toolset plumbing established in PR 1 (IAreaSetup, BaseAzureResourceService, non-standard serviceGroup path-parameter handling, parameter shapes, telemetry, and recorded-test infrastructure). Lifecycle/action commands follow in PR 3.
All commands are create-or-update (ReadOnly = false, Destructive = false, Idempotent = true). Each returns the created/updated resource's details.
Commands added:
Usage Plan
resilience usageplan create (UsagePlans_CreateOrUpdate)
resilience usageplan enrollment create (Enrollments_CreateOrUpdate)
Also includes unit tests, recorded live tests (goal template/assignment, usage plan, enrollment), README/command docs/e2e prompts, and a changelog entry.
GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline