Skip to content

[ResilienceManagement] RO check readiness commands (namespace: resilience) - #3329

Merged
Vinay Gera (g2vinay) merged 38 commits into
microsoft:mainfrom
adishiritwick:adishi/RO/checkreadiness
Aug 24, 2026
Merged

[ResilienceManagement] RO check readiness commands (namespace: resilience)#3329
Vinay Gera (g2vinay) merged 38 commits into
microsoft:mainfrom
adishiritwick:adishi/RO/checkreadiness

Conversation

@adishiritwick

@adishiritwick adishiritwick commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Adds recovery-plan readiness assessment to the Azure Resilience Management toolset (Azure.Mcp.Tools.ResilienceManagement, command namespace resilience).

This PR adds a command that starts an Azure Resilience Management readiness assessment for a recovery plan, waits for the resulting recovery job to reach a terminal state, and returns the complete assessment outcome. The implementation reuses the existing toolset plumbing, including IAreaSetup, BaseAzureResourceService, non-standard serviceGroup path-parameter handling, telemetry, AOT-safe serialization, and recorded-test infrastructure.

The command is non-destructive (Destructive = false) but not read-only or idempotent (ReadOnly = false, Idempotent = false) because each invocation creates one new readiness job with a unique operation ID.

This is PR 2 of the rollout plan in [#3241 ]

Commands added:

Recovery Plan

  • resilience recovery plan check-readiness (RecoveryPlans_CheckReadiness)

Discovers and assesses whether a recovery plan and its protected resources are ready for recovery operations.
Starts exactly one readiness job per invocation.
Waits for the readiness job to reach Completed, Failed, or Cancelled.
Polls the specific recovery job every 30 seconds with a 10-minute timeout.
Returns the operation ID, recovery job ID, readiness status, job errors, failed tasks, and failed resources.
Treats a completed assessment with readiness failures as a successful command response with isReady: false.
Handles transient job availability responses while preserving caller cancellation and timeout behavior.
Also includes unit tests for command behavior and bounded polling, a recorded live test with playback validation, AOT-safe response model registration, README and command documentation, end-to-end prompts, consolidated tool registration, a changelog entry, and updated test-proxy assets.

Recovery Plan Check-Readiness Tool Description Evaluation

Tool

  • Tool ID: resilience_recoveryplan_checkreadiness
  • Command: azmcp resilience recoveryplan checkreadiness
  • Description: Checks whether a resilience recovery plan and its protected resources are ready for recovery operations in an Azure service group.
  • Evaluation date: 2026-08-21
  • Tools evaluated: 1
  • Prompts tested: 2

Results

Prompt Rank Score Result
Check whether recovery plan <recovery_plan_name> and its protected resources are ready for recovery operations in service group <service_group> 1 0.819231 Pass
Discover readiness issues for the resources in recovery plan <recovery_plan_name> in service group <service_group> 1 0.727433 Pass

Acceptance Criteria

The expected tool must rank first with a confidence score of at least 0.6 for every prompt.

  • Rank 1: 100% (2/2 prompts)
  • Score >= 0.6: 100% (2/2 prompts)
  • Overall: Pass

Evaluator Command

The report was generated with ToolDescriptionEvaluator using a one-tool inventory and the two production prompts from servers/Azure.Mcp.Server/docs/e2eTestPrompts.md.

Conclusion

Pass: the registered tool has rank 1 for every evaluated prompt, and all scores exceed 0.6.

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copilot AI lite review requested due to automatic review settings August 19, 2026 18:37
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution adishiritwick! We will review the pull request and get back to you soon.

@adishiritwick adishiritwick changed the title Adishi/ro/checkreadiness [ResilienceManagement] RO check readiness commands (namespace: resilience) Aug 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the ResilienceManagement toolset and Azure MCP Server surfaces to support recovery plan lifecycle operations (create/update, delete, update-resources, and check-readiness), along with new unit + recorded tests, test-resource scaffolding, and documentation/consolidated-mode updates.

Changes:

  • Added new Resilience recovery plan commands (create/delete/update-resources/check-readiness) and corresponding service APIs + models.
  • Expanded test infrastructure and added extensive unit + recorded integration coverage for the new behaviors.
  • Updated consolidated-mode/tooling docs (README, azmcp-commands, e2e prompts, troubleshooting, changelog, and vally prompt namespace mapping).

Reviewed changes

Copilot reviewed 47 out of 47 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.ResilienceManagement/tests/test-resources.bicep Adds lifecycle-specific output names
tools/Azure.Mcp.Tools.ResilienceManagement/tests/test-resources-post.ps1 Creates second service group + enrollment
tools/Azure.Mcp.Tools.ResilienceManagement/tests/remove-test-resources-pre.ps1 Adds safer pre-teardown cleanup script
tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Services/ResilienceManagementServiceTests.cs New unit tests for service helpers/validation
tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/ResilienceManagementCommandTests.cs Recorded tests for new commands + sanitizers
tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanUpdateResourcesCommandTests.cs New command unit tests (update-resources)
tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanDeleteCommandTests.cs New command unit tests (delete)
tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanCreateCommandTests.cs New command unit tests (create/update)
tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanCheckReadinessCommandTests.cs New command unit tests (check-readiness)
tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/assets.json Updates test proxy assets tag
tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/ResilienceManagementService.cs Implements new recovery plan operations + polling
tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/IResilienceManagementService.cs Extends service interface for new operations
tools/Azure.Mcp.Tools.ResilienceManagement/src/ResilienceManagementSetup.cs Registers new commands and command group entries
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanUpdateResourcesOption.cs New options for update-resources
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanDeleteOption.cs New options for delete
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanCreateOption.cs New options for create/update
tools/Azure.Mcp.Tools.ResilienceManagement/src/Options/Recovery/Plans/RecoveryPlanCheckReadinessOptions.cs New options for readiness check
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanUpdateResourcesResult.cs New update-resources response model
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanUpdateResourcesFailedResource.cs New update-resources failure model
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanUpdateResourcesError.cs New update-resources error model
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanReadinessResult.cs New readiness response model
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanReadinessFailedTask.cs New readiness failed-task model
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanReadinessFailedResource.cs New readiness failed-resource model
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanReadinessError.cs New readiness error model
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanKind.cs Introduces plan-kind enum (Zonal)
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanInfo.cs Introduces typed plan summary model
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanIdentityKind.cs Introduces identity-kind enum
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanIdentityInfo.cs Adds identity info model
tools/Azure.Mcp.Tools.ResilienceManagement/src/Models/RecoveryPlanGroupInfo.cs Adds recovery group info model
tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/ResilienceManagementJsonContext.cs Registers new models for AOT JSON
tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanValidation.cs Adds shared recovery plan name validation
tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanUpdateResourcesCommand.cs New command implementation (update-resources)
tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanDeleteCommand.cs New command implementation (delete)
tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanCreateCommand.cs New command implementation (create/update)
tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanCheckReadinessCommand.cs New command implementation (check-readiness)
tools/Azure.Mcp.Tools.ResilienceManagement/cspell.yaml Adds Resilience-specific dictionary words
servers/Azure.Mcp.Server/TROUBLESHOOTING.md Adds consolidated-mode “missing command” guidance
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Updates resilience consolidated mapping/description
servers/Azure.Mcp.Server/README.md Adds example prompts for new commands
servers/Azure.Mcp.Server/docs/new-command.md Updates consolidated-mode requirements text
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Adds prompts for new resilience commands
servers/Azure.Mcp.Server/docs/azmcp-commands.md Documents new resilience commands
servers/Azure.Mcp.Server/cspell.yaml Adds additional spelling words
servers/Azure.Mcp.Server/changelog-entries/resilience-recovery-plan-commands.yaml Adds changelog entry for new commands
eng/tools/VallyEvaluator/tests/VallyUtilitiesTests.cs Adds test for namespace alias mapping
eng/tools/VallyEvaluator/src/Program.cs Adds prompt namespace alias logic
.vscode/cspell.json Adds resiliencemanagement term

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Outdated
Comment thread eng/tools/VallyEvaluator/src/Program.cs Outdated

@g2vinay Vinay Gera (g2vinay) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Leaving my comments in-line.

Comment thread eng/tools/VallyEvaluator/src/Program.cs Outdated
…O/checkreadiness

# Conflicts:
#	servers/Azure.Mcp.Server/changelog-entries/resilience-recovery-plan-commands.yaml
#	servers/Azure.Mcp.Server/docs/azmcp-commands.md
#	servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
#	servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json
#	tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanCreateCommand.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanDeleteCommand.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanUpdateResourcesCommand.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/Recovery/Plans/RecoveryPlanValidation.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/src/Commands/ResilienceManagementJsonContext.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/src/ResilienceManagementSetup.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/IResilienceManagementService.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/ResilienceManagementService.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanCreateCommandTests.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanDeleteCommandTests.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Recovery/Plans/RecoveryPlanUpdateResourcesCommandTests.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/ResilienceManagementCommandTests.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/Services/ResilienceManagementServiceTests.cs
#	tools/Azure.Mcp.Tools.ResilienceManagement/tests/Azure.Mcp.Tools.ResilienceManagement.Tests/assets.json
#	tools/Azure.Mcp.Tools.ResilienceManagement/tests/remove-test-resources-pre.ps1
- Updated JSON resource identifiers for recovery plans and jobs to use a consistent naming convention (e.g., "resilience_recovery_plan_get" to "resilience_recoveryplan_get").
- Enhanced error messages in the RecoveryPlanCheckReadinessCommand to provide clearer feedback on readiness check failures.
- Refactored ResilienceManagementService to improve handling of recovery job identifiers, including new methods for validation and retrieval.
- Added tests to ensure proper functionality of recovery job identifier handling and error conditions.
- Updated PowerShell scripts to include role assignments for recovery contributors and improved provisioning checks.
- Modified Bicep templates to ensure deterministic naming for resources based on the resource group name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants