Migrate Compute tools to new tool design#3096
Open
alzimmermsft wants to merge 2 commits into
Open
Conversation
alzimmermsft
requested review from
chidozieononiwu,
conniey,
hallipr,
msalaman,
saikoumudi and
xirzec
July 17, 2026 22:25
|
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 migrates the Azure Compute toolset from the legacy RegisterOptions/BindOptions pattern to the new attribute-based [Option] binding model, aligning Compute commands with the newer SubscriptionCommand<TOptions, TResult> command design used across the repo.
Changes:
- Replaced legacy Compute option definitions/base options with per-command option POCOs using
[Option]attributes andISubscriptionOption. - Updated Compute commands (VM, VMSS, Disk) to use
SubscriptionCommand<TOptions, TResult>and consolidated some response result models (e.g.,VmGetResult,VmssGetResult). - Updated unit tests to use the newer subscription command test base and adjusted expectations/arguments for updated option binding and service signatures.
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssUpdateCommandTests.cs | Switches to new command test base and updates tags-clearing invocation for new binding behavior. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssGetCommandTests.cs | Updates tests for consolidated VmssGetResult response model and new test base. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssDeleteCommandTests.cs | Migrates to new subscription command unit test base. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vmss/VmssCreateCommandTests.cs | Migrates to new subscription command unit test base. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmUpdateCommandTests.cs | Updates service call expectations for signature changes (e.g., bootDiagnostics type) and new test base. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmPowerStateCommandTests.cs | Migrates to new subscription command unit test base. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmGetCommandTests.cs | Updates tests for consolidated VmGetResult response model and new test base. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmDeleteCommandTests.cs | Migrates to new subscription command unit test base. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Vm/VmCreateCommandTests.cs | Migrates to new subscription command unit test base. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskUpdateCommandTests.cs | Migrates to new test base and updates expectations for signature/binding changes. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskGetCommandTests.cs | Migrates to new subscription command unit test base. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskDeleteCommandTests.cs | Migrates to new subscription command unit test base. |
| tools/Azure.Mcp.Tools.Compute/tests/Azure.Mcp.Tools.Compute.Tests/Disk/DiskCreateCommandTests.cs | Migrates to new subscription command unit test base and updates expectations for signature/binding changes. |
| tools/Azure.Mcp.Tools.Compute/src/Services/IComputeService.cs | Updates Compute service contracts (e.g., bootDiagnostics / enableBursting moved to bool?). |
| tools/Azure.Mcp.Tools.Compute/src/Services/ComputeService.cs | Implements updated service contracts and simplifies patch/creation object initialization. |
| tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssUpdateOptions.cs | Introduces [Option]-based VMSS update options (including required fields and retry container). |
| tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssGetOptions.cs | Introduces [Option]-based VMSS get options with optional name/instance-id and subscription scope. |
| tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssDeleteOptions.cs | Introduces [Option]-based VMSS delete options with required name/resource-group and force deletion flag. |
| tools/Azure.Mcp.Tools.Compute/src/Options/Vmss/VmssCreateOptions.cs | Introduces [Option]-based VMSS create options with required inputs and defaults. |
| tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmUpdateOptions.cs | Introduces [Option]-based VM update options; changes boot diagnostics to bool?. |
| tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmPowerStateOptions.cs | Introduces [Option]-based VM power state options with validation-oriented fields. |
| tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmGetOptions.cs | Introduces [Option]-based VM get options (optional name, instance-view flag). |
| tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmDeleteOptions.cs | Introduces [Option]-based VM delete options with required name/resource-group and force deletion flag. |
| tools/Azure.Mcp.Tools.Compute/src/Options/Vm/VmCreateOptions.cs | Introduces [Option]-based VM create options with required inputs and network-related options. |
| tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskUpdateOptions.cs | Introduces [Option]-based disk update options; changes enable bursting to bool? and renames disk-access field. |
| tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskGetOptions.cs | Introduces [Option]-based disk get options (pattern/name + subscription scope). |
| tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskDeleteOptions.cs | Introduces [Option]-based disk delete options with required name/resource-group. |
| tools/Azure.Mcp.Tools.Compute/src/Options/Disk/DiskCreateOptions.cs | Introduces [Option]-based disk create options; changes enable bursting to bool? and renames disk-access field. |
| tools/Azure.Mcp.Tools.Compute/src/Options/ComputeOptionDescriptions.cs | New centralized option description constants replacing legacy OptionDefinitions. |
| tools/Azure.Mcp.Tools.Compute/src/Options/ComputeOptionDefinitions.cs | Removes legacy System.CommandLine option definitions. |
| tools/Azure.Mcp.Tools.Compute/src/Options/BaseComputeOptions.cs | Removes legacy base options type that customized resource-group binding. |
| tools/Azure.Mcp.Tools.Compute/src/GlobalUsings.cs | Removes global usings tied to legacy System.CommandLine usage. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssUpdateCommand.cs | Migrates VMSS update command to SubscriptionCommand<TOptions, TResult> and attribute-bound validation. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssGetCommand.cs | Migrates VMSS get command and consolidates output to VmssGetResult with null-ignored properties. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssDeleteCommand.cs | Migrates VMSS delete command to new command design and updates result record visibility. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssCreateCommand.cs | Migrates VMSS create command to new command design and moves validations to ValidateOptions. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmUpdateCommand.cs | Migrates VM update command to new command design and updates validation logic to property-based checks. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmPowerStateCommand.cs | Migrates VM power state command to new command design and moves action validation into ValidateOptions. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmGetCommand.cs | Migrates VM get command and consolidates output to VmGetResult with null-ignored properties. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmDeleteCommand.cs | Migrates VM delete command to new command design and updates result record visibility. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmCreateCommand.cs | Migrates VM create command to new command design and moves validations to ValidateOptions. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskUpdateCommand.cs | Migrates disk update command to new command design and updates binding/validation logic. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskGetCommand.cs | Migrates disk get command to new command design and updates binding to new options shape. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskDeleteCommand.cs | Migrates disk delete command to new command design and updates binding to new options shape. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/Disk/DiskCreateCommand.cs | Migrates disk create command to new command design and updates binding/validation logic. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/ComputeJsonContext.cs | Updates AOT JSON context registrations for consolidated result models and simplified type references. |
| tools/Azure.Mcp.Tools.Compute/src/Commands/BaseComputeCommand.cs | Removes legacy command base that wrapped old option registration/binding behavior. |
| tools/Azure.Mcp.Tools.Compute/src/Azure.Mcp.Tools.Compute.csproj | Removes System.CommandLine dependency and aligns Core project reference format. |
| servers/Azure.Mcp.Server/changelog-entries/1784327078851.yaml | Adds breaking-change entry related to the Compute tool migration. |
Comment on lines
+29
to
30
| [Option(Description = "Enable or disable overprovisioning. When enabled, Azure provisions more VMs than requested and deletes extra VMs after deployment")] | ||
| public string? ScaleInPolicy { get; set; } |
Comment on lines
+53
to
+56
| validationResult.Errors.Add("At least one update property must be provided " | ||
| + "(size-gb, sku, disk-iops-read-write, disk-mbps-read-write, max-shares, " | ||
| + "network-access-policy, enable-bursting, tags, disk-encryption-set, " | ||
| + "encryption-type, disk-access-id, or tier)."); |
Comment on lines
+1
to
+3
| changes: | ||
| - section: "Breaking Changes" | ||
| description: "Removed unused parameters from Compute 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 Compute 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