feat(azurebackup): add vault private-endpoint command group - #3345
Merged
Shraddha Jain (shrja-ms) merged 4 commits intoAug 26, 2026
Merged
Conversation
Adds 5 new commands under 'azmcp azurebackup vault private-endpoint': - create: provisions Microsoft.Network/privateEndpoints resource in a customer VNet subnet and optionally auto-approves the connection on the RSV. - get: retrieves one or all Private Endpoint Connections (PECs) attached to a Recovery Services vault. - approve/reject: manages the PEC state on the vault. - delete: removes the vault-side PEC object. All commands support --vault-type rsv|dpp. Backup vaults (DPP) return a NotSupportedException with clear guidance to use RSV. Includes: - Unit tests for all commands (Vault/PrivateEndpoint/*) - Recorded live tests (AzureBackupPrivateEndpointCommandTests) using the RecordedCommandTestsBase pattern - Bicep test infrastructure additions (RSV + VNet + subnet) for Private Endpoint scenarios - Documentation updates (azmcp-commands.md, e2eTestPrompts.md, consolidated-tools.json) - Changelog entry
|
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
Adds a new AzureBackup vault private-endpoint command group to manage Recovery Services vault (RSV) Private Endpoint Connections (PECs), including create/get/delete/approve/reject, along with service-layer implementation, docs, and tests.
Changes:
- Introduces 5 new
azurebackup vault private-endpointcommands + options and response model. - Adds RSV private-endpoint operations in
RsvBackupOperationsand wires them throughIAzureBackupService. - Expands test infrastructure + unit/recorded tests and updates docs/tool registry/changelog.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.AzureBackup/tests/test-resources.bicep | Adds dedicated VNet/subnet + fresh RSV for PE test scenarios and RBAC. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/PrivateEndpoint/PrivateEndpointRejectCommandTests.cs | Unit tests for reject command behavior + error mappings. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/PrivateEndpoint/PrivateEndpointGetCommandTests.cs | Unit tests for get/list behavior + DPP guard/error mappings. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/PrivateEndpoint/PrivateEndpointDeleteCommandTests.cs | Unit tests for delete behavior + error mappings. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/PrivateEndpoint/PrivateEndpointCreateCommandTests.cs | Unit tests for create behavior + status/error mappings. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/PrivateEndpoint/PrivateEndpointApproveCommandTests.cs | Unit tests for approve behavior + error mappings. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/AzureBackupPrivateEndpointCommandTests.cs | Recorded/live PE tests validating tool behavior end-to-end. |
| tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/assets.json | Updates test-proxy assets tag for new recordings. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvBackupOperations.PrivateEndpoint.cs | Implements RSV PE lifecycle operations (create/list/get/approve/reject/delete). |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvBackupOperations.cs | Makes RsvBackupOperations partial to host new PE partial implementation. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/IRsvBackupOperations.cs | Adds PE operation contracts to RSV operations interface. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/IAzureBackupService.cs | Exposes PE operations on the toolset service boundary. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Services/AzureBackupService.cs | Routes PE operations to RSV implementation and enforces DPP NotSupported behavior. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/PrivateEndpoint/PrivateEndpointRejectOptions.cs | Options for reject operation. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/PrivateEndpoint/PrivateEndpointGetOptions.cs | Options for get/list operation. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/PrivateEndpoint/PrivateEndpointDeleteOptions.cs | Options for delete operation. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/PrivateEndpoint/PrivateEndpointCreateOptions.cs | Options for create operation. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/PrivateEndpoint/PrivateEndpointApproveOptions.cs | Options for approve operation. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Options/AzureBackupOptionDefinitions.cs | Adds option help text for PE options. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Models/PrivateEndpointConnectionInfo.cs | Adds response model for PEC summary. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Models/AzureBackupTelemetryTags.cs | Adds telemetry tag for PE action classification. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/PrivateEndpoint/PrivateEndpointRejectCommand.cs | New reject command + error/status mappings. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/PrivateEndpoint/PrivateEndpointGetCommand.cs | New get/list command + error/status mappings. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/PrivateEndpoint/PrivateEndpointDeleteCommand.cs | New delete command + error/status mappings. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/PrivateEndpoint/PrivateEndpointCreateCommand.cs | New create command + error/status mappings. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/PrivateEndpoint/PrivateEndpointApproveCommand.cs | New approve command + error/status mappings. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Commands/AzureBackupJsonContext.cs | Registers new command result types/models for AOT-safe serialization. |
| tools/Azure.Mcp.Tools.AzureBackup/src/AzureBackupSetup.cs | Registers new commands and adds the new subgroup under vault. |
| tools/Azure.Mcp.Tools.AzureBackup/src/Azure.Mcp.Tools.AzureBackup.csproj | Adds Azure.ResourceManager.Network dependency for PE operations. |
| servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json | Maps new tools into consolidated mode categories. |
| servers/Azure.Mcp.Server/docs/e2eTestPrompts.md | Adds e2e prompts for the 5 new tools. |
| servers/Azure.Mcp.Server/docs/azmcp-commands.md | Documents the new command group and usage examples. |
| servers/Azure.Mcp.Server/changelog-entries/shrja-azurebackup-vault-private-endpoint.yml | Adds changelog entry for the new feature. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…lag with consolidated tool groups PrivateEndpointCreateCommand belongs to create_azure_backup_resources (Destructive=true) and PrivateEndpointApproveCommand belongs to update_azure_backup_settings (Destructive=true). The mismatch caused ConsolidatedToolDiscoveryStrategy to throw InvalidOperationException at server startup in DEBUG builds, failing ConsolidatedModeTests on CI.
- Merge approve/reject commands into single approve-reject with --action param - Rename group 'private-endpoint' -> 'privateendpoint' (concatenated lowercase) - Use ResourceIdentifier for subnet + PE ID parsing (no manual regex) - Remove 12-endpoint per-vault cap - Full-ID (case-insensitive) match for PrivateEndpointConnection lookup - Auto-approve description = 'Auto-approved by Azure MCP tool' - Regenerate command metadata icons; update docs, e2e prompts, changelog
Alan Zimmer (alzimmermsft)
approved these changes
Aug 25, 2026
Shraddha Jain (shrja-ms)
enabled auto-merge (squash)
August 26, 2026 04:16
Shraddha Jain (shrja-ms)
merged commit Aug 26, 2026
ea093a3
into
microsoft:main
18 of 19 checks passed
Shraddha Jain (shrja-ms)
added a commit
to shrja-ms/mcp
that referenced
this pull request
Aug 26, 2026
- 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
Shraddha Jain (shrja-ms)
added a commit
to shrja-ms/mcp
that referenced
this pull request
Aug 26, 2026
…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.
Shraddha Jain (shrja-ms)
added a commit
that referenced
this pull request
Aug 26, 2026
…3322) * Add azurebackup resourceguard group and fix MUA disable safety 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. * Address PR #3322 review comments - 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 * Record security disable-mua tests (RSV + DPP) - 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). * Fix consolidated-mode metadata mismatches for AzureBackup commands 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'. * Address PR review comments: rename configure-mua to enable-mua, drop --force gates, simplify status handling * fix(azurebackup): update recording tag + regen commands doc - Switch assets.json Tag to df01193e95 (from upstream/main via PR #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 * fix(azurebackup): repoint recording tag to fdd4f0baf5 (combined PE + disable-mua) The prior tag df01193e95 (from upstream/main via PR #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.
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.
Description
Adds a new
azurebackup vault private-endpointcommand group for managing Private Endpoints (v2 experience) on Recovery Services vaults (RSV):azmcp azurebackup vault private-endpoint createMicrosoft.Network/privateEndpointsresource in a customer VNet subnet and optionally auto-approves the resulting Private Endpoint Connection (PEC) on the RSV.azmcp azurebackup vault private-endpoint getazmcp azurebackup vault private-endpoint approveazmcp azurebackup vault private-endpoint rejectazmcp azurebackup vault private-endpoint deleteMicrosoft.Network/privateEndpointsresource must be deleted separately.All commands accept
--vault-type rsv|dpp. Backup vaults (DPP) are not supported and return aNotSupportedExceptionwith clear guidance directing the caller to RSV.createenforces the well-known RSV constraints:--group-idmust beAzureBackup(primary region) orAzureBackup_secondary(paired region / Cross-Region Restore).Files changed
tools/Azure.Mcp.Tools.AzureBackup/src/Commands/Vault/PrivateEndpoint/*— 5 new commands.tools/Azure.Mcp.Tools.AzureBackup/src/Options/Vault/PrivateEndpoint/*— flat POCO option classes with[Option]attributes.tools/Azure.Mcp.Tools.AzureBackup/src/Models/PrivateEndpointConnectionInfo.cs— response model.tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvBackupOperations.PrivateEndpoint.cs— partial class implementing the PE operations against the RSV data plane.tools/Azure.Mcp.Tools.AzureBackup/src/AzureBackupSetup.cs,AzureBackupJsonContext.cs,IAzureBackupService.cs,AzureBackupService.cs,IRsvBackupOperations.cs,RsvBackupOperations.cs,AzureBackupOptionDefinitions.cs,AzureBackupTelemetryTags.cs— command registration, JSON serialization context, and service wiring.servers/Azure.Mcp.Server/docs/azmcp-commands.md,e2eTestPrompts.md,Resources/consolidated-tools.json— documentation and tool registry.servers/Azure.Mcp.Server/changelog-entries/shrja-azurebackup-vault-private-endpoint.yml— changelog entry.Tests
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/Vault/PrivateEndpoint/.AzureBackupPrivateEndpointCommandTests.csusingRecordedCommandTestsBase:PrivateEndpointGet_EmptyVault_ReturnsEmptyList— recorded.PrivateEndpointGet_OnDppVault_ReturnsNotSupported— recorded (verifies the DPP guard).PrivateEndpointLifecycle_Create_Approve_Get_Delete—[LiveTestOnly](network resource lifecycle; not recorded).tests/test-resources.bicepnow provisions an RSV, VNet, and subnet dedicated to Private Endpoint scenarios (with matching RBAC).Full suite (773 tests) passes locally in Playback:
ToolDescriptionEvaluator scores
All 5 new tool descriptions were evaluated with 3 representative prompts each. Every prompt matched at rank #1–#3 with confidence ≥ 0.4 (target for this repo).
azurebackup_vault_private-endpoint_createazurebackup_vault_private-endpoint_getazurebackup_vault_private-endpoint_approveazurebackup_vault_private-endpoint_rejectazurebackup_vault_private-endpoint_deleteChecklist
dotnet build— clean, 0 errors, 0 warnings on the AzureBackup toolset.dotnet test— full AzureBackup test project passes in Playback (773 succeeded, 8[LiveTestOnly]skipped).test-proxy push—assets.jsontag updated.Invoke-Cspell.ps1— clean (exit 0).azmcp-commands.md,e2eTestPrompts.md,consolidated-tools.json).servers/Azure.Mcp.Server/changelog-entries/.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.