feat(azurebackup): Add security configure-mua command for Multi-User Authorization#2544
feat(azurebackup): Add security configure-mua command for Multi-User Authorization#2544shrja-ms wants to merge 1 commit intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new AzureBackup security command to configure Multi-User Authorization (MUA) for both Recovery Services vaults (RSV) and Data Protection/Backup vaults (DPP) by linking/unlinking a Resource Guard, along with supporting service-layer operations and test coverage.
Changes:
- Introduces
azurebackup security configure-muacommand + options and JSON source-gen support. - Adds MUA enable/disable operations to AzureBackup service surface and RSV/DPP operation implementations.
- Adds unit tests, recorded live tests, and a manual test plan for MUA scenarios.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.AzureBackup/tests/manual-test-mua.md | New manual test matrix and detailed steps for MUA enable/disable and validation. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/Security/SecurityConfigureMuaCommandTests.cs | New unit tests covering routing, error handling, and response serialization for configure-mua. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.UnitTests/AzureBackupSetupTests.cs | Updates subgroup expectations to include security (but drops an existing protected item command assertion). |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.LiveTests/assets.json | Updates recorded test assets tag. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.LiveTests/AzureBackupCommandTests.cs | Adds live tests for RSV/DPP MUA enable/disable + explicit vault-type routing. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvBackupOperations.cs | Adds RSV implementation for linking/unlinking Resource Guard proxy for MUA. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/IRsvBackupOperations.cs | Extends RSV operations interface with MUA methods. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/IDppBackupOperations.cs | Extends DPP operations interface with MUA methods. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/IAzureBackupService.cs | Extends public service interface with MUA configure/disable APIs. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/DppBackupOperations.cs | Adds DPP implementation for linking/unlinking Resource Guard proxy for MUA. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/AzureBackupService.cs | Routes MUA calls to RSV vs DPP based on resolved vault type. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Security/SecurityConfigureMuaOptions.cs | Adds options model for --resource-guard-id. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/AzureBackupOptionDefinitions.cs | Adds --resource-guard-id option definition. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureMuaCommand.cs | New command implementation + error message mapping + response schema wrapper. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/AzureBackupJsonContext.cs | Registers new command result type for System.Text.Json source generation. |
| tools/Azure.Mcp.Tools.AzureBackup/src/AzureBackupSetup.cs | Registers the new security subgroup and configure-mua command. |
995a7b3 to
f494bdd
Compare
bcb00a1 to
b96e454
Compare
jongio
left a comment
There was a problem hiding this comment.
Straightforward new command following the existing AzureBackup patterns. Enable/disable routing, vault-type auto-detection, error handling, and test coverage all look correct.
A few items to address before merge:
-
Missing telemetry -
SecurityConfigureMuaCommand.ExecuteAsyncdoesn't callAzureBackupTelemetryTags.AddVaultTags(context.Activity, options.VaultType). Every other command in this toolset does this before thetryblock. Without it, MUA operations won't show up in vault-type telemetry breakdowns. -
Missing
azmcp-commands.mdentry - The newazurebackup security configure-muacommand needs a section inservers/Azure.Mcp.Server/docs/azmcp-commands.mdwith usage and parameter docs. See theazurebackup disasterrecovery enable-crrsection for the pattern. -
Missing
e2eTestPrompts.mdentry - Add test prompts for the new command inservers/Azure.Mcp.Server/docs/e2eTestPrompts.md. Something like "Enable multi-user authorization on vault X in resource group Y" and "Disable MUA on vault X". -
Missing changelog entry - New feature commands should have a changelog entry YAML file under
servers/Azure.Mcp.Server/changelog-entries/. Seedocs/changelog-entries.mdfor the format.
b96e454 to
ad7839b
Compare
…Authorization Add azurebackup security configure-mua command that enables/disables Multi-User Authorization (MUA) on Recovery Services vaults and Backup vaults by linking/unlinking a Resource Guard. - Enable MUA: provide --resource-guard-id to link a Resource Guard - Disable MUA: omit --resource-guard-id to unlink (protected operation) - Supports both RSV (VaultProxy) and DPP (DppResourceGuardProxy) - Auto-detects vault type when --vault-type is omitted - Proper error handling for 400/403/404/409 scenarios Files: 16 changed, ~1200 lines added Tests: 22 unit tests, 5 live tests (recorded + playback) Validation: Cspell clean, ToolDescriptionEvaluator passed
ad7839b to
d136be4
Compare
Summary
Adds
azurebackup security configure-muacommand that enables/disables Multi-User Authorization (MUA) on Recovery Services vaults and Backup vaults by linking/unlinking a Resource Guard.Changes
New Command:
azurebackup security configure-mua--resource-guard-idto link a Resource Guard to the vault--resource-guard-idto unlink (this is itself a protected operation requiring Backup MUA Operator role)VaultProxy) and DPP (DppResourceGuardProxy) vault types--vault-typeis omitted[CommandMetadata]attribute pattern--resource-guard-idGetStatusCodeoverride for proper 403/400 mappingFiles Changed (15 files, ~895 lines)
SecurityConfigureMuaCommand.cs(new),SecurityConfigureMuaOptions.cs(new)IAzureBackupService.cs,AzureBackupService.cs,IRsvBackupOperations.cs,RsvBackupOperations.cs,IDppBackupOperations.cs,DppBackupOperations.csAzureBackupSetup.cs,AzureBackupJsonContext.cs,AzureBackupOptionDefinitions.csSecurityConfigureMuaCommandTests.cs(22 tests)AzureBackupCommandTests.cs(5 MUA tests),assets.jsonValidation
dotnet build— 0 errors, 0 warnings[CommandMetadata]attribute pattern (per Refactor remaining Azure commands to the CommandMetadata attribute #2537)Manual Test Cases (click to expand)
Manual Test Cases:
azurebackup security configure-muaPrerequisites
azmcp server startEnvironment Variables
Test Matrix
--resource-guard-id--resource-guard-id+--vault-type dpp--resource-guard-id--resource-guard-id+--vault-type dpp--vault-type--vault-type--vault-type invalid--vault-type(auto-detect)Detailed Test Steps
TC-1: Enable MUA on RSV vault
TC-2: Enable MUA on DPP vault (explicit vault-type)
TC-3: Disable MUA on RSV vault (requires Backup MUA Operator role)
TC-4: Disable MUA on DPP vault
TC-5: Auto-detect RSV vault type
TC-6: Auto-detect DPP vault type
TC-7: Invalid vault-type
TC-8: Non-existent vault
TC-9: Missing Reader role on Resource Guard
TC-10: Disable MUA when not enabled
TC-11: Re-enable MUA (idempotent)
TC-12: Enable MUA on DPP with auto-detect
Cross-Region Validation
Response Schema Validation
Every successful response must match:
{ "result": { "status": "Succeeded", "jobId": null, "message": "Multi-User Authorization enabled on vault '...' with Resource Guard '...'." } }For disable:
{ "result": { "status": "Succeeded", "jobId": null, "message": "Multi-User Authorization disabled on vault '...'." } }Portal Verification Steps
After enabling MUA:
After disabling MUA:
Invoking Livetests
Copilot submitted PRs are not trustworthy by default. Users with
writeaccess 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.