Skip to content

Add Compute Disk delete tool#2059

Open
audreyttt wants to merge 5 commits intomainfrom
audreyttt-compute-disk-delete
Open

Add Compute Disk delete tool#2059
audreyttt wants to merge 5 commits intomainfrom
audreyttt-compute-disk-delete

Conversation

@audreyttt
Copy link
Member

@audreyttt audreyttt commented Mar 16, 2026

What does this PR do?

Onboarding issue: #1552
Adds command azmcp compute disk delete'
CLI documentation: https://learn.microsoft.com/en-us/cli/azure/disk?view=azure-cli-latest

New Command

azmcp compute disk delete

Deletes an Azure managed disk from the specified resource group.

  • This is an idempotent operation that returns Deleted = true if the disk was successfully removed, or Deleted = false if the disk was not found.
  • The disk must not be attached to a virtual machine; detach it first before deleting.

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

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 support for deleting Azure managed disks via a new azmcp compute disk delete command/tool, wiring it into the Compute tool area and updating related docs and tests.

Changes:

  • Introduces DiskDeleteCommand + DiskDeleteOptions and registers the command in ComputeSetup.
  • Adds IComputeService.DeleteDiskAsync / ComputeService.DeleteDiskAsync implementation and corresponding unit + live tests.
  • Updates server docs/metadata (azmcp-commands.md, e2eTestPrompts.md, consolidated-tools.json) and adds a changelog entry.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskDeleteCommand.cs New delete command implementation + response model and error mapping.
tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskDeleteOptions.cs New options type for disk delete.
tools/Azure.Mcp.Tools.Compute/src/Services/IComputeService.cs Adds DeleteDiskAsync contract.
tools/Azure.Mcp.Tools.Compute/src/Services/ComputeService.cs Implements disk deletion via ARM SDK with idempotent 404 handling.
tools/Azure.Mcp.Tools.Compute/src/ComputeSetup.cs Registers and exposes the new disk delete command.
tools/Azure.Mcp.Tools.Compute/src/Commands/ComputeJsonContext.cs Adds STJ source-gen metadata for delete result.
tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.UnitTests/Disk/DiskDeleteCommandTests.cs New unit tests for delete command.
tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/ComputeCommandTests.cs Adds live tests for disk delete scenarios; adjusts gallery disk create test location.
tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.LiveTests/assets.json Updates recorded-test assets tag.
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Adds consolidated tool entry mapping to compute_disk_delete.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Documents azmcp compute disk delete usage/params/returns.
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Adds prompts for compute_disk_delete (and reorders sections).
servers/Azure.Mcp.Server/changelog-entries/1773681010911.yaml Adds changelog entry for the new tool.
servers/Azure.Mcp.Server/README.md Adds an example prompt mentioning disk delete.
tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskCreateCommand.cs Removes /// <inheritdoc/> comment markers.
tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskGetCommand.cs Removes /// <inheritdoc/> comment markers.
tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskUpdateCommand.cs Removes /// <inheritdoc/> comment markers.

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

@haagha
Copy link
Contributor

haagha commented Mar 17, 2026

@audreyttt can we also add --force-delete parameter that is present in remove-azdisk? https://learn.microsoft.com/en-us/powershell/module/az.compute/remove-azdisk?view=azps-15.4.0

You would have to ensure it's not ambiguous with the --force elicitation option

For vm I have --force-deletion for force-delete and --force for elicitation.

@github-project-automation github-project-automation bot moved this from Untriaged to In Progress in Azure MCP Server Mar 17, 2026
@audreyttt
Copy link
Member Author

@audreyttt can we also add --force-delete parameter that is present in remove-azdisk? https://learn.microsoft.com/en-us/powershell/module/az.compute/remove-azdisk?view=azps-15.4.0

You would have to ensure it's not ambiguous with the --force elicitation option

For vm I have --force-deletion for force-delete and --force for elicitation.

The force parameter in disk delete is different from the force-deletion parameter that vm delete has. For vm delete this is a feature to force delete a VM even when it's running/attached but for disk this parameter is just a client-side confirmation skip, and we already have the --force flag and secret metadata=true doing this.

@audreyttt
Copy link
Member Author

Top Choice Success: 100.0% (42/42 tests)

Confidence Level Distribution

💪 Very High Confidence (≥0.8): 0.0% (0/42 tests)
🎯 High Confidence (≥0.7): 0.0% (0/42 tests)
✅ Good Confidence (≥0.6): 38.1% (16/42 tests)
👍 Fair Confidence (≥0.5): 81.0% (34/42 tests)
👌 Acceptable Confidence (≥0.4): 100.0% (42/42 tests)
❌ Low Confidence (<0.4): 0.0% (0/42 tests)

Top Choice + Confidence Combinations

💪 Top Choice + Very High Confidence (≥0.8): 0.0% (0/42 tests)
🎯 Top Choice + High Confidence (≥0.7): 0.0% (0/42 tests)
✅ Top Choice + Good Confidence (≥0.6): 38.1% (16/42 tests)
👍 Top Choice + Fair Confidence (≥0.5): 81.0% (34/42 tests)
👌 Top Choice + Acceptable Confidence (≥0.4): 100.0% (42/42 tests)

@KarishmaGhiya KarishmaGhiya added this to the 2026-03 milestone Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants