Skip to content

Add Azure Backup MCP ToolSet - Drop1#2116

Open
shrja-ms wants to merge 5 commits intomicrosoft:mainfrom
shrja-ms:users/shrja/AzureBackup-Drop1
Open

Add Azure Backup MCP ToolSet - Drop1#2116
shrja-ms wants to merge 5 commits intomicrosoft:mainfrom
shrja-ms:users/shrja/AzureBackup-Drop1

Conversation

@shrja-ms
Copy link

What does this PR do?

Summary

Adds the Azure Backup MCP toolset with 15 commands covering Recovery Services vaults, Data Protection backup vaults, backup policies, protected items, jobs, recovery points, governance, and disaster recovery operations.

Changes

New Toolset: Azure.Mcp.Tools.AzureBackup

15 commands across 7 command groups:

Group Command Description
Vault azurebackup_vault_get List/get Recovery Services and Backup Vaults
Vault azurebackup_vault_create Create a Recovery Services vault
Vault azurebackup_vault_update Update vault properties (redundancy, soft delete, immutability)
Policy azurebackup_policy_get List/get backup policies for a vault
Policy azurebackup_policy_create Create backup policies for VMs, SQL, SAP HANA, Blobs, Disks, PostgreSQL
Protected Item azurebackup_protecteditem_get List/get protected (backed up) items
Protected Item azurebackup_protecteditem_protect Enable backup protection for a resource
Protectable Item azurebackup_protectableitem_list List resources available for backup
Backup azurebackup_backup_status Check backup status for an Azure resource
Job azurebackup_job_get List/get backup and restore jobs
Recovery Point azurebackup_recoverypoint_get List/get recovery points for a protected item
Governance azurebackup_governance_find-unprotected Find unprotected Azure resources
Governance azurebackup_governance_immutability Check vault immutability configuration
Governance azurebackup_governance_soft-delete Check vault soft delete configuration
DR azurebackup_dr_enablecrr Enable cross-region restore on a vault

Architecture

  • Dual-stack support: Both Recovery Services (RSV) and Data Protection (DPP) vault types
  • Datasource registry pattern: Extensible RsvDatasourceRegistry and DppDatasourceRegistry for workload-specific operations
  • Service layer: AzureBackupService orchestrates RSV and DPP operations through RsvBackupOperations and DppBackupOperations
  • AOT-safe: All models registered in AzureBackupJsonContext

Test Coverage

  • 99 unit tests covering all 15 commands (success, error, input validation, deserialization)
  • 6 live integration tests (vault get/list, policy list, governance checks, job list)
  • 30 e2e test prompts in e2eTestPrompts.md

Documentation & Compliance

  • Updated azmcp-commands.md with full Azure Backup command reference
  • Updated e2eTestPrompts.md with 30 test prompts
  • Updated README.md with Azure Backup in services list
  • Added CODEOWNERS entry
  • Added 7 consolidated tool groups to consolidated-tools.json
  • Created changelog entry
  • Created test-resources.bicep and test-resources-post.ps1 for live test infrastructure
  • Created LiveTests project with assets.json for recording support
  • Spelling check passes
  • Tool metadata verified via Update-AzCommandsMetadata.ps1

Files Changed

  • 105 files changed, 10,801 insertions
  • Source: 18 files under tools/Azure.Mcp.Tools.AzureBackup/src/
  • Unit Tests: 15 test files under tests/Azure.Mcp.Tools.AzureBackup.UnitTests/
  • Live Tests: tests/Azure.Mcp.Tools.AzureBackup.LiveTests/
  • Test Infrastructure: test-resources.bicep, test-resources-post.ps1
  • Docs: azmcp-commands.md, e2eTestPrompts.md, README.md
  • Config: CODEOWNERS, consolidated-tools.json, Microsoft.Mcp.slnx, Azure.Mcp.Server.slnx

Validation

  • dotnet build - 0 errors, 0 warnings
  • dotnet test - 99/99 unit tests pass
  • Live tests - 6/6 pass against deployed mcplive-rsv vault
  • Invoke-Cspell.ps1 - Spelling check passes
  • Update-AzCommandsMetadata.ps1 - Tool metadata up to date
  • Changelog entry created
  • CODEOWNERS updated
  • Consolidated tools updated

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.
Azure Backup Documentation: https://learn.microsoft.com/en-us/azure/backup/

GitHub issue number?

#2035

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
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • 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 using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • 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 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

Implements the first subset of Azure Backup MCP tools with 15 commands:
- Vault: get (consolidated get+list), create, update
- Policy: get (consolidated get+list), create
- Protected Item: get (consolidated get+list), protect
- Protectable Item: list
- Backup: status
- Job: get (consolidated get+list)
- Recovery Point: get (consolidated get+list)
- Governance: find-unprotected, immutability, soft-delete
- DR: enablecrr

Key design decisions:
- Consolidated get+list into single 'get' commands with optional identifier
- Full service layer included for extensibility in future drops
- Dual vault architecture (RSV + Backup vault) with auto-detection
- 99 unit tests covering all 15 commands

Infrastructure changes:
- Added Azure.ResourceManager.RecoveryServices 1.1.1
- Added Azure.ResourceManager.RecoveryServicesBackup 1.3.0
- Added Azure.ResourceManager.DataProtectionBackup 1.7.0
- Registered AzureBackupSetup in Program.cs and both slnx files
…nfrastructure

- Remove 227 code comments from 18 source files
- Add Azure Backup section to azmcp-commands.md
- Add 30 e2e test prompts to e2eTestPrompts.md
- Update README.md with Azure Backup service listing
- Add CODEOWNERS entry for Azure Backup toolset
- Add 7 consolidated tool groups to consolidated-tools.json
- Add changelog entry YAML
- Create test-resources.bicep and test-resources-post.ps1
- Create LiveTests project with 6 integration tests (vault, policy, governance, job)
- Add assets.json for test proxy recording support
- Update Microsoft.Mcp.slnx and Azure.Mcp.Server.slnx with LiveTests project
- All 99 unit tests pass, all 6 live tests pass (6/6)
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Azure Backup MCP toolset to the Azure MCP Server, including command implementations, option/model types, service orchestration (RSV + DPP), and accompanying unit/live tests and documentation updates.

Changes:

  • Introduces Azure.Mcp.Tools.AzureBackup area with commands for vaults, policies, protection, jobs, recovery points, governance, and DR.
  • Adds unit tests + recorded live tests plus test-resource deployment scripts.
  • Registers the new area in Azure.Mcp.Server, updates command docs/prompts, consolidated tools mapping, CODEOWNERS, and shared package versions.

Reviewed changes

Copilot reviewed 105 out of 105 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.AzureBackup/tests/test-resources.bicep Adds Bicep template for Azure Backup test resources
tools/Azure.Mcp.Tools.AzureBackup/tests/test-resources-post.ps1 Post-deploy script for test resources
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Vault/VaultUpdateCommandTests.cs Unit tests for vault update command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Vault/VaultGetCommandTests.cs Unit tests for vault get/list command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Vault/VaultCreateCommandTests.cs Unit tests for vault create command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/RecoveryPoint/RecoveryPointGetCommandTests.cs Unit tests for recovery point get/list command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/ProtectedItem/ProtectedItemProtectCommandTests.cs Unit tests for protected-item protect command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/ProtectedItem/ProtectedItemGetCommandTests.cs Unit tests for protected-item get/list command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/ProtectableItem/ProtectableItemListCommandTests.cs Unit tests for protectable-item list command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Policy/PolicyGetCommandTests.cs Unit tests for policy get/list command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Policy/PolicyCreateCommandTests.cs Unit tests for policy create command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Job/JobGetCommandTests.cs Unit tests for job get/list command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Governance/GovernanceSoftDeleteCommandTests.cs Unit tests for soft-delete governance command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Governance/GovernanceImmutabilityCommandTests.cs Unit tests for immutability governance command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Governance/GovernanceFindUnprotectedCommandTests.cs Unit tests for find-unprotected governance command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Dr/DrEnableCrrCommandTests.cs Unit tests for enable CRR command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Backup/BackupStatusCommandTests.cs Unit tests for backup status command
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Azure.Mcp.Tools.AzureBackup.UnitTests.csproj Adds unit test project for toolset
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.LiveTests/assets.json Recorded-test assets configuration
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.LiveTests/AzureBackupCommandTests.cs Recorded live tests invoking Azure Backup tools
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.LiveTests/Azure.Mcp.Tools.AzureBackup.LiveTests.csproj Adds live test project
tools/Azure.Mcp.Tools.AzureBackup/src/Services/VaultTypeResolver.cs Adds vault type validation/resolution helpers
tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvDatasourceRegistry.cs Adds RSV datasource registry for workload mapping
tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvDatasourceProfile.cs Adds RSV datasource profile + enums
tools/Azure.Mcp.Tools.AzureBackup/src/Services/IRsvBackupOperations.cs RSV operations interface
tools/Azure.Mcp.Tools.AzureBackup/src/Services/IDppBackupOperations.cs DPP operations interface
tools/Azure.Mcp.Tools.AzureBackup/src/Services/DppDatasourceRegistry.cs Adds DPP datasource registry/configuration helpers
tools/Azure.Mcp.Tools.AzureBackup/src/Services/DppDatasourceProfile.cs Adds DPP datasource profile + enums
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultUpdateOptions.cs Options model for vault update
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultListOptions.cs Options model for vault list
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultGetOptions.cs Options model for vault get
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultCreateOptions.cs Options model for vault create
tools/Azure.Mcp.Tools.AzureBackup/src/Options/RecoveryPoint/RecoveryPointListOptions.cs Options model for recovery point list
tools/Azure.Mcp.Tools.AzureBackup/src/Options/RecoveryPoint/RecoveryPointGetOptions.cs Options model for recovery point get
tools/Azure.Mcp.Tools.AzureBackup/src/Options/ProtectedItem/ProtectedItemProtectOptions.cs Options model for protect
tools/Azure.Mcp.Tools.AzureBackup/src/Options/ProtectedItem/ProtectedItemListOptions.cs Options model for protected item list
tools/Azure.Mcp.Tools.AzureBackup/src/Options/ProtectedItem/ProtectedItemGetOptions.cs Options model for protected item get
tools/Azure.Mcp.Tools.AzureBackup/src/Options/ProtectableItem/ProtectableItemListOptions.cs Options model for protectable item list
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Policy/PolicyListOptions.cs Options model for policy list
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Policy/PolicyGetOptions.cs Options model for policy get
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Policy/PolicyCreateOptions.cs Options model for policy create
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Job/JobListOptions.cs Options model for job list
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Job/JobGetOptions.cs Options model for job get
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceSoftDeleteOptions.cs Options model for soft-delete
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceImmutabilityOptions.cs Options model for immutability
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceFindUnprotectedOptions.cs Options model for find-unprotected
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Dr/DrEnableCrrOptions.cs Options model for enable CRR
tools/Azure.Mcp.Tools.AzureBackup/src/Options/BaseProtectedItemOptions.cs Shared protected-item option base
tools/Azure.Mcp.Tools.AzureBackup/src/Options/BaseAzureBackupOptions.cs Shared Azure Backup option base
tools/Azure.Mcp.Tools.AzureBackup/src/Options/Backup/BackupStatusOptions.cs Options model for backup status
tools/Azure.Mcp.Tools.AzureBackup/src/Models/WorkflowResult.cs Adds workflow result models
tools/Azure.Mcp.Tools.AzureBackup/src/Models/VaultCreateResult.cs Adds vault create result model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/UnprotectedResourceInfo.cs Adds governance output model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/RestoreTriggerResult.cs Adds restore trigger result model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/RecoveryPointInfo.cs Adds recovery point model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/ProtectedItemInfo.cs Adds protected item model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/ProtectableItemInfo.cs Adds protectable item model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/ProtectResult.cs Adds protect result model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/OperationResult.cs Adds shared operation result model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/HealthCheckResult.cs Adds health check output models
tools/Azure.Mcp.Tools.AzureBackup/src/Models/DrValidationResult.cs Adds DR validation output model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/CostEstimateResult.cs Adds cost estimate output model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/ContainerInfo.cs Adds container model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/BackupVaultInfo.cs Adds vault info model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/BackupTriggerResult.cs Adds backup trigger result model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/BackupStatusResult.cs Adds backup status model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/BackupPolicyInfo.cs Adds policy model
tools/Azure.Mcp.Tools.AzureBackup/src/Models/BackupJobInfo.cs Adds job model
tools/Azure.Mcp.Tools.AzureBackup/src/GlobalUsings.cs Adds global using for System.CommandLine
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultUpdateCommand.cs Implements vault update command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultGetCommand.cs Implements vault get/list command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultCreateCommand.cs Implements vault create command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/RecoveryPoint/RecoveryPointGetCommand.cs Implements recovery point get/list command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemProtectCommand.cs Implements protected item protect command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemGetCommand.cs Implements protected item get/list command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectableItem/ProtectableItemListCommand.cs Implements protectable item list command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyGetCommand.cs Implements policy get/list command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyCreateCommand.cs Implements policy create command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Job/JobGetCommand.cs Implements job get/list command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceSoftDeleteCommand.cs Implements soft-delete governance command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceImmutabilityCommand.cs Implements immutability governance command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceFindUnprotectedCommand.cs Implements find-unprotected governance command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Dr/DrEnableCrrCommand.cs Implements enable CRR command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/BaseProtectedItemCommand.cs Shared base for protected-item commands
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/BaseAzureBackupCommand.cs Shared base for Azure Backup commands
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Backup/BackupStatusCommand.cs Implements backup status command
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/AzureBackupJsonContext.cs Registers AOT-safe JSON source-gen types
tools/Azure.Mcp.Tools.AzureBackup/src/AzureBackupSetup.cs Registers services + command groups
tools/Azure.Mcp.Tools.AzureBackup/src/Azure.Mcp.Tools.AzureBackup.csproj Adds new tool project and package refs
tools/Azure.Mcp.Tools.AzureBackup/src/AssemblyInfo.cs InternalsVisibleTo for tests
servers/Azure.Mcp.Server/src/Program.cs Registers Azure Backup area in server
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Adds Azure Backup e2e prompts
servers/Azure.Mcp.Server/docs/azmcp-commands.md Adds Azure Backup command reference
servers/Azure.Mcp.Server/changelog-entries/shrja-add-azure-backup-toolset.yaml Adds changelog entry
servers/Azure.Mcp.Server/README.md Adds Azure Backup examples + service listing
servers/Azure.Mcp.Server/Azure.Mcp.Server.slnx Adds Azure Backup projects to solution
core/Microsoft.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json Adds consolidated mappings for Azure Backup tools
Microsoft.Mcp.slnx Adds Azure Backup projects to root solution
Directory.Packages.props Adds ARM SDK package versions for RecoveryServices/DataProtection
.github/CODEOWNERS Adds codeowners entry for Azure Backup toolset

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +3 to +6
@minLength(3)
@maxLength(24)
@description('The base resource name.')
param baseName string = resourceGroup().name
Comment on lines +11 to +15
@description('The tenant ID to which the application and resources belong.')
param tenantId string = '72f988bf-86f1-41af-91ab-2d7cd011db47'

@description('The client OID to grant access to test resources.')
param testApplicationOid string
Comment on lines +6 to +15
public sealed record WorkflowResult(
string Status,
string WorkflowName,
IReadOnlyList<WorkflowStep> Steps,
string? Message);

public sealed record WorkflowStep(
string StepName,
string Status,
string? Detail);
@shrja-ms
Copy link
Author

@copilot add iteration to apply changes based on the comments in this thread

shrja-ms and others added 3 commits March 19, 2026 20:51
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Remove unused tenantId parameter from test-resources.bicep
- Interpolate testApplicationOid in role assignment description
- Split WorkflowResult.cs: move WorkflowStep to its own file
- Split HealthCheckResult.cs: move HealthCheckItemDetail to its own file
Copy link
Author

Choose a reason for hiding this comment

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

the dependency on AOT-compatible packages is pending

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants