Migrate Azure Backup tools to new tool design#2888
Open
alzimmermsft wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the Azure Backup tool implementation to the newer command/options design where option registration and binding are driven by [Option] attributes (and subscription resolution is provided via ISubscriptionResolver), updating both production commands and unit tests accordingly.
Changes:
- Refactors Azure Backup commands to use the
SubscriptionCommand<TOptions, TResult>/BaseAzureBackupCommand<TOptions, TResult>pattern andValidateOptions(...)for validation. - Migrates many Azure Backup options POCOs from
JsonPropertyName-based binding to[Option]attribute metadata (including introducingVaultGetOptions). - Updates Azure Backup unit tests to the newer command test base and adjusts DI setup accordingly.
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.
Reviewed changes
Copilot reviewed 64 out of 64 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultUpdateCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultGetCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/VaultCreateCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureMuaCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureEncryptionCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/RecoveryPoint/RecoveryPointGetCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemUndeleteCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemProtectCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectedItem/ProtectedItemGetCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ProtectableItem/ProtectableItemListCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyUpdateCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyGetCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Policy/PolicyCreateCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Job/JobGetCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceSoftDeleteCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceImmutabilityCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Governance/GovernanceFindUnprotectedCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/DisasterRecovery/DisasterRecoveryEnableCrrCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Backup/BackupStatusCommandTests.cs | Updates test base class/imports for subscription-aware command testing. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/AzureBackupSetupTests.cs | Updates test DI container to include ISubscriptionResolver. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/AzureBackupService.cs | Removes an unused Azure.ResourceManager using after refactor. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultUpdateOptions.cs | Migrates vault update option metadata to [Option] attributes and renames soft-delete property. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultGetOptions.cs | Adds new options model for vault get/list in the new design. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/VaultCreateOptions.cs | Migrates vault create option metadata to [Option] attributes and makes location required. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Security/SecurityConfigureMuaOptions.cs | Migrates MUA option metadata to [Option] attributes. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Security/SecurityConfigureEncryptionOptions.cs | Migrates CMK encryption option metadata to [Option] attributes and marks key fields required. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/RecoveryPoint/RecoveryPointGetOptions.cs | Refactors recovery point options to the new base/options model. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/ProtectedItem/ProtectedItemUndeleteOptions.cs | Migrates undelete option metadata to [Option] attributes and makes datasource ID required. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/ProtectedItem/ProtectedItemProtectOptions.cs | Migrates protect option metadata to [Option] attributes (includes AKS-specific options). |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/ProtectableItem/ProtectableItemListOptions.cs | Migrates protectable item list option metadata to [Option] attributes. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Policy/PolicyUpdateOptions.cs | Migrates policy update option metadata to [Option] attributes and makes policy required. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Policy/PolicyGetOptions.cs | Migrates policy get option metadata to [Option] attributes. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Policy/PolicyCreateOptions.cs | Migrates policy create flag surface to [Option] attributes (expanded schedule/retention flags). |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Job/JobGetOptions.cs | Migrates job get option metadata to [Option] attributes. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceSoftDeleteOptions.cs | Migrates soft delete governance option metadata to [Option] attributes and makes soft-delete required. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceImmutabilityOptions.cs | Migrates immutability governance option metadata to [Option] attributes and makes immutability required. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Governance/GovernanceFindUnprotectedOptions.cs | Refactors scan options to implement ISubscriptionOption and use [Option] attributes. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/BaseProtectedItemOptions.cs | Migrates protected-item option metadata to [Option] attributes. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/BaseAzureBackupOptions.cs | Refactors common vault/resource-group/subscription options to ISubscriptionOption + [Option] attributes. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Backup/BackupStatusOptions.cs | Refactors backup status options to ISubscriptionOption + [Option] attributes. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/AzureBackupOptionDefinitions.cs | Reworks option definitions to focus on descriptive strings for attribute-driven metadata. |
| tools/Azure.Mcp.Tools.AzureBackup/src/GlobalUsings.cs | Removes global System.CommandLine using (no longer needed with new approach). |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultUpdateCommand.cs | Refactors command to new base class signature, option binding, and validation. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultGetCommand.cs | Refactors command to new subscription command pattern and new options type. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/VaultCreateCommand.cs | Refactors command to new base class signature and validation approach. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureMuaCommand.cs | Refactors command to new base class signature and validation approach. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureEncryptionCommand.cs | Refactors command to new base class signature and validation approach. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/RecoveryPoint/RecoveryPointGetCommand.cs | Refactors command to new base class signature and new options type. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemUndeleteCommand.cs | Refactors command to new base class signature and attribute-driven options. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemProtectCommand.cs | Refactors command to new base class signature and attribute-driven options. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectedItem/ProtectedItemGetCommand.cs | Refactors command to new base class signature and attribute-driven options. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ProtectableItem/ProtectableItemListCommand.cs | Refactors command to new base class signature and moves workload validation to ValidateOptions. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyUpdateCommand.cs | Refactors command to new base class signature and attribute-driven options. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyGetCommand.cs | Refactors command to new base class signature and attribute-driven options. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Policy/PolicyCreateCommand.cs | Refactors command to new base class signature and attribute-driven options (builds request DTO). |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Job/JobGetCommand.cs | Refactors command to new base class signature and attribute-driven options. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceSoftDeleteCommand.cs | Refactors command to new base class signature and validation approach. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceImmutabilityCommand.cs | Refactors command to new base class signature and validation approach. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Governance/GovernanceFindUnprotectedCommand.cs | Refactors command to new subscription command pattern and new options type. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/DisasterRecovery/DisasterRecoveryEnableCrrCommand.cs | Refactors command to new base class signature and attribute-driven options. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/BaseProtectedItemCommand.cs | Removes legacy protected-item command base class (no longer needed with attribute model). |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/BaseAzureBackupCommand.cs | Introduces new generic base command using subscription resolver + ValidateOptions. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Backup/BackupStatusCommand.cs | Refactors command to new subscription command pattern and new options type. |
| servers/Azure.Mcp.Server/changelog-entries/1781549268619.yaml | Adds changelog entry describing breaking change for Azure Backup tools. |
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?
Migrates Azure Backup tools to new design where Register and Bind options are based on
Optionattributes.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