Azure Backup: resourceguard command group + MUA disable safety fix - #3322
Merged
Shraddha Jain (shrja-ms) merged 9 commits intoAug 26, 2026
Conversation
PR 3: New `azurebackup resourceguard` command group (create/get/delete) for Microsoft.DataProtection/resourceGuards, backing Multi-User Authorization. PR 6: Fix `security configure-mua` silently disabling MUA when --resource-guard-id was omitted. --resource-guard-id is now required. Added new `security disable-mua` command that requires --force to explicitly disable MUA. Added `mua.action` telemetry tag.
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Azure Backup toolset by adding a new azurebackup resourceguard command group (create/get/delete) for managing Microsoft.DataProtection/resourceGuards, and fixes a safety issue where security configure-mua could inadvertently disable MUA when --resource-guard-id was omitted by introducing an explicit security disable-mua command gated by --force.
Changes:
- Added
azurebackup resourceguard {create|get|delete}commands plus supporting options/models/service methods. - Split MUA disable behavior into a new destructive
azurebackup security disable-mua --forcecommand; made--resource-guard-idrequired forsecurity configure-mua. - Updated telemetry tagging, docs (commands + prompts), consolidated tools mapping, changelog entry, and tests.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityDisableMuaCommandTests.cs | Adds unit tests for the new explicit disable-mua command and its validation/error handling. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Security/SecurityConfigureMuaCommandTests.cs | Updates tests to ensure configure-mua now only enables MUA and fails when the guard ID is missing/malformed. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ResourceGuard/ResourceGuardGetCommandTests.cs | Adds unit tests for get/list behavior and validation for resourceguard get. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ResourceGuard/ResourceGuardDeleteCommandTests.cs | Adds unit tests for resourceguard delete with --force gating and error mapping. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/ResourceGuard/ResourceGuardCreateCommandTests.cs | Adds unit tests for resourceguard create, including excluded-ops and tag parsing validation. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/AzureBackupCommandTests.cs | Updates live/integration tests to call the new disable-mua tool and includes force. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/IAzureBackupService.cs | Extends the service contract with resourceguard CRUD/list operations. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/AzureBackupService.cs | Implements resourceguard operations and mandatory exclusion enforcement. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Security/SecurityDisableMuaOptions.cs | Introduces --force option for explicit MUA disable. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Security/SecurityConfigureMuaOptions.cs | Updates option description to reflect required guard ID and new disable-mua command. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/ResourceGuard/ResourceGuardGetOptions.cs | Adds options for get/list Resource Guards. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/ResourceGuard/ResourceGuardDeleteOptions.cs | Adds options for deleting a Resource Guard with --force. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/ResourceGuard/ResourceGuardCreateOptions.cs | Adds options for creating a Resource Guard, including excluded ops and tags. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Models/ResourceGuardInfo.cs | Adds a response model for Resource Guard details. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Models/AzureBackupTelemetryTags.cs | Adds new telemetry tags for MUA action and resourceguard operations. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityDisableMuaCommand.cs | Adds the destructive disable-mua command with --force validation and telemetry tagging. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Security/SecurityConfigureMuaCommand.cs | Changes configure-mua to require --resource-guard-id and only enable MUA. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ResourceGuard/ResourceGuardGetCommand.cs | Adds get/list Resource Guard command and telemetry tagging. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ResourceGuard/ResourceGuardDeleteCommand.cs | Adds delete Resource Guard command with --force validation. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/ResourceGuard/ResourceGuardCreateCommand.cs | Adds create Resource Guard command including CSV/tags parsing. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/AzureBackupJsonContext.cs | Registers new command result and model types for AOT-safe JSON serialization. |
| tools/Azure.Mcp.Tools.AzureBackup/src/AzureBackupSetup.cs | Registers the new commands and resourceguard subgroup. |
| servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json | Maps new tools into consolidated tool groupings. |
| servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | Adds new prompts for resourceguard tools and disable-mua. |
| servers/Azure.Mcp.Server/docs/azmcp-commands.md | Documents the new resourceguard commands and updates MUA command semantics. |
| servers/Azure.Mcp.Server/changelog-entries/shrja-azurebackup-resource-guard-mua-safety.yml | Adds changelog entries for the new commands and safety fix. |
| .vscode/cspell.json | Adds resourceguard to spelling dictionary. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- ResourceGuardGetCommand: telemetry tag value 'single' -> 'get' (comment 3811668346) - ResourceGuardCreateCommand: trim tag key/value and reject empty (comment 3811668398) - ResourceGuardCreateOptions: add disableSecurityFeatures to mandatory ops list in description (comment 3811668438) - azmcp-commands.md: resourceguard create marked Idempotent (comment 3811668460) - Added [Theory] test for empty tag key/value validation
- Removed [LiveTestOnly] from SecurityDisableMua_RsvVault_Successfully and SecurityDisableMua_DppVault_Successfully now that they have live recordings. - Updated assets.json Tag to Azure.Mcp.Tools.AzureBackup.Tests_e1d7bb1d4c (added 2 new SessionRecords for the disable-mua tests).
SecurityConfigureMuaCommand: revert Destructive=true to match the update_azure_backup_settings consolidated group (linking a Resource Guard modifies vault settings). ResourceGuardCreateCommand: set Destructive=true, Idempotent=false to match the create_azure_backup_resources group (consistent with vault/policy/protecteditem create commands). Also update azmcp-commands.md metadata markers to stay in sync. Fixes the DEBUG-only InvalidOperationException in ConsolidatedToolDiscoveryStrategy that was crashing server startup and causing all 13 ConsolidatedModeTests to time out with 'Connection refused'.
…--force gates, simplify status handling
…source-guard-mua-safety # Conflicts: # .vscode/cspell.json # tools/Azure.Mcp.Tools.AzureBackup/src/Models/AzureBackupTelemetryTags.cs # tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/assets.json
Alan Zimmer (alzimmermsft)
approved these changes
Aug 25, 2026
…source-guard-mua-safety # Conflicts: # servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json # tools/Azure.Mcp.Tools.AzureBackup/src/AzureBackupSetup.cs # tools/Azure.Mcp.Tools.AzureBackup/src/Commands/AzureBackupJsonContext.cs # tools/Azure.Mcp.Tools.AzureBackup/src/Models/AzureBackupTelemetryTags.cs # tools/Azure.Mcp.Tools.AzureBackup/src/Services/AzureBackupService.cs # tools/Azure.Mcp.Tools.AzureBackup/src/Services/IAzureBackupService.cs # tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/assets.json
Shraddha Jain (shrja-ms)
enabled auto-merge (squash)
August 26, 2026 04:37
- Switch assets.json Tag to df01193e95 (from upstream/main via PR microsoft#3345) which contains recordings for the new AzureBackupPrivateEndpointCommandTests tests introduced after this PR's baseline. - Regenerate azmcp-commands.md metadata annotations for the resourceguard command group, enable-mua and disable-mua commands (out of sync after the resource-guard additions). - Fixes CI test failures: * AzureBackupPrivateEndpointCommandTests.PrivateEndpointGet_EmptyVault_ReturnsEmptyList * AzureBackupPrivateEndpointCommandTests.PrivateEndpointGet_OnDppVault_ReturnsNotSupported * CommandMetadataSyncTests.AzCommandsMetadata_Should_Be_Synchronized
…disable-mua) The prior tag df01193e95 (from upstream/main via PR microsoft#3345) had recordings for the new AzureBackupPrivateEndpointCommandTests but was missing recordings for this PR's SecurityDisableMua_RsvVault_Successfully and SecurityDisableMua_DppVault_Successfully. Combined both sets by extracting the 2 disable-mua recordings from tag e1d7bb1d4c and pushing the merged set as new tag fdd4f0baf5.
Alan Zimmer (alzimmermsft)
approved these changes
Aug 26, 2026
Shraddha Jain (shrja-ms)
disabled auto-merge
August 26, 2026 13:52
Shraddha Jain (shrja-ms)
merged commit Aug 26, 2026
2e9ec55
into
microsoft:main
17 of 18 checks passed
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.
Azure Backup: resourceguard command group + MUA disable safety fix
This PR delivers two related improvements from
azurebackup-rsv-mcp-improvements-plan.mdin a single change:PR 3 — New
azurebackup resourceguardcommand groupAdds
create,get, anddeleteoperations forMicrosoft.DataProtection/resourceGuards, the resource that backs Multi-User Authorization (MUA) on Recovery Services vaults and Backup vaults.azurebackup resourceguard create— provision a new Resource Guard with optional--excluded-operationsand--tagsazurebackup resourceguard get— retrieve details for a Resource Guardazurebackup resourceguard delete— remove a Resource GuardThe service layer defaults
s_mandatoryResourceGuardOps(disableSoftDelete,disableMultiUserAuthorization,removeMUAProtection,disableSecurityFeatures) so critical destructive operations are always gated by MUA.PR 6 — Fix
security configure-muasafety bug + addsecurity disable-muaProblem:
azurebackup security configure-muaaccepted an empty--resource-guard-id, in which case the underlying SDK call silently disabled MUA on the vault instead of failing. This meant a benign-looking "configure" invocation with a typo or missing argument could remove a key security control without any confirmation.Fix:
--resource-guard-idis now required onconfigure-mua. Missing/empty values returnBadRequestwith a message that also points users atdisable-mua.azurebackup security disable-muacommand that explicitly disables MUA and requires--force. It is markedDestructive.mua.actiontelemetry tag (enable/disable) so both commands can be tracked separately.Behavior migration:
configure-mua --resource-guard-id <id>configure-mua(no id) → silently disables MUABadRequest, directs user todisable-muadisable-mua --force— new explicit disable commandFiles changed
Commands/ResourceGuard/{Create,Get,Delete}Command.cs,Commands/Security/SecurityDisableMuaCommand.csOptions/ResourceGuard/*,Options/Security/SecurityDisableMuaOptions.csModels/ResourceGuardInfo.csDisableMultiUserAuthorizationAsync+ 3 resource-guard methods toIAzureBackupService/AzureBackupServiceAzureBackupTelemetryTags.AddMuaActionTag,AddResourceGuardOperationTagAzureBackupSetup.csregisters the new group and commandsazmcp-commands.md(rewrote MUA section, added Resource Guard section),e2eTestPrompts.md(12 new prompts),consolidated-tools.json(mapped new tools)shrja-azurebackup-resource-guard-mua-safety.ymlresourceguardto workspace dictionaryTests
resourceguardcommands and bothsecuritycommandsSecurityDisableMua_RsvVault_SuccessfullyandSecurityDisableMua_DppVault_Successfully([LiveTestOnly]) with tolerant error accept set[LiveTestOnly]) / 0 failedTool Description Evaluator
I confirm each new tool description scores at least
0.4onToolDescriptionEvaluator.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.