[ResilienceManagement] Add create commands (namespace: resilience)#2990
Open
LavishSingal wants to merge 4 commits into
Open
[ResilienceManagement] Add create commands (namespace: resilience)#2990LavishSingal wants to merge 4 commits into
LavishSingal wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds authoring (create-or-update) commands to the existing Azure Resilience Management toolset (Azure.Mcp.Tools.ResilienceManagement, namespace resilience), extending the read-only surface from the prior onboarding PR with resource creation/update capabilities plus tests and docs updates.
Changes:
- Added
createcommands (goal template, goal assignment, usage plan, usage plan enrollment) with corresponding options, JSON context registrations, and DI/command-group wiring. - Implemented create-or-update service methods in
ResilienceManagementServiceusing ARM SDKCreateOrUpdateAsync. - Updated recorded live test infrastructure (Bicep + post-deploy), live tests, README, e2e prompts, command docs, and changelog entry.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/test-resources.bicep | Adds isolated RG/service-group outputs for create live tests. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/test-resources-post.ps1 | Provisions isolated RG/service-group for create live tests via REST/Az cmdlets. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/UsagePlanCreateCommandTests.cs | Unit tests for resilience usageplan create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommandTests.cs | Unit tests for resilience usageplan enrollment create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Templates/GoalTemplateCreateCommandTests.cs | Unit tests for resilience goal template create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Goals/Assignments/GoalAssignmentCreateCommandTests.cs | Unit tests for resilience goal assignment create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/ResilienceManagementCommandTests.cs | Adds recorded live tests validating create flows end-to-end. |
| 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 | Adds create-or-update implementations for goal templates/assignments, usage plans, and enrollments. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/IResilienceManagementService.cs | Extends service interface with create methods. |
| 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 model for usage plan create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/UsagePlans/Enrollments/UsagePlanEnrollmentCreateOption.cs | Adds options model for enrollment create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Templates/GoalTemplateCreateOption.cs | Adds options model for goal template create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Goals/Assignments/GoalAssignmentCreateOption.cs | Adds options model for goal assignment create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/UsagePlanCreateCommand.cs | New command implementation for usage plan create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/UsagePlans/Enrollments/UsagePlanEnrollmentCreateCommand.cs | New command implementation for enrollment create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Templates/GoalTemplateCreateCommand.cs | New command implementation for goal template create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Goals/Assignments/GoalAssignmentCreateCommand.cs | New command implementation for goal assignment create. |
| tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/ResilienceManagementJsonContext.cs | Registers new command result models for source-generated JSON serialization. |
| servers/Azure.Mcp.Server/README.md | Adds Resilience Management examples and service list entry. |
| servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | Adds new e2e prompts for create commands. |
| servers/Azure.Mcp.Server/docs/azmcp-commands.md | Adds CLI docs entries for the new commands. |
| servers/Azure.Mcp.Server/changelog-entries/1782549900000.yaml | Adds changelog entries for the new create commands. |
Comment on lines
+20
to
+28
| Title = "Create Resilience Usage Plan", | ||
| Description = """ | ||
| Creates a resilience usage plan in the specified resource group with the given plan type, and returns | ||
| the created usage plan information including id, name, resource type, location, tags, plan type, and | ||
| provisioning state. | ||
| """, | ||
| Destructive = false, | ||
| Idempotent = false, | ||
| OpenWorld = false, |
Comment on lines
+3671
to
+3676
| # Create a resilience usage plan in a resource group | ||
| # ❌ Destructive | ❌ Idempotent | ❌ OpenWorld | ❌ ReadOnly | ❌ Secret | ❌ LocalRequired | ||
| azmcp resilience usageplan create --subscription <subscription> \ | ||
| --resource-group <resource-group> \ | ||
| --usage-plan <usage-plan> \ | ||
| --plan-type <plan-type> |
Comment on lines
+135
to
+138
| # NOTE: this resource group is created outside the test harness's managed resource group and is | ||
| # therefore NOT auto-cleaned by teardown; it is named "<rg>-create" for easy manual cleanup. | ||
| $location = (Get-AzResourceGroup -Name $ResourceGroupName).Location | ||
| New-AzResourceGroup -Name $createResourceGroupName -Location $location -Force | Out-Null |
…ence-create-v2 # Conflicts: # servers/Azure.Mcp.Server/README.md
g2vinay
reviewed
Jul 2, 2026
| ReadOnly = false, | ||
| Secret = false, | ||
| LocalRequired = false)] | ||
| public sealed class GoalAssignmentCreateCommand(ILogger<GoalAssignmentCreateCommand> logger, IResilienceManagementService resilienceManagementService, ISubscriptionResolver subscriptionResolver) |
Contributor
There was a problem hiding this comment.
This command extends from Subscription command, but it doesn't use subscription parameter, does it ?
If not, we should not extend from Subscription command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds the authoring (create-or-update) commands to the Azure Resilience Management toolset (
Azure.Mcp.Tools.ResilienceManagement, command namespaceresilience).This is PR 2 of the rollout plan in #2894 — building on the read-only surface delivered in #2948. It adds
createcommands across the goal and usage-plan command groups, reusing the toolset plumbing established in PR 1 (IAreaSetup,BaseAzureResourceService, non-standardserviceGrouppath-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:
resilience goal template create(GoalTemplates_CreateOrUpdate)resilience goal assignment create(GoalAssignments_CreateOrUpdate) — takes a separate--goal-template-service-groupso the assigned template can live in a different service group than the assignmentresilience 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?
Part of #2894
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