Add compute VM and VMSS create/update commands with smart workload-based defaults#1705
Open
haagha wants to merge 25 commits intomicrosoft:mainfrom
Open
Add compute VM and VMSS create/update commands with smart workload-based defaults#1705haagha wants to merge 25 commits intomicrosoft:mainfrom
haagha wants to merge 25 commits intomicrosoft:mainfrom
Conversation
added 18 commits
January 12, 2026 16:57
…up, VmName, and VmssName
- Created assets.json for test asset configuration. - Added Azure.Mcp.Tools.Compute.UnitTests project file. - Implemented VmGetCommandTests to validate VM retrieval commands. - Developed PowerShell script for post-deployment resource checks. - Created Bicep template for resource provisioning in tests. - Added JSON deployment template for resource management.
…nce ID and VMSS name; update JSON serialization and error handling for improved clarity and flexibility.
…get-operations
- Removed unused ListVmSizesAsync method from IComputeService. - Updated ComputeCommandTests to reflect changes in VM and VMSS naming conventions. - Adjusted test resources to deploy a single VM and VMSS with updated sizes. - Added new unit tests for VMSS get operations, including validation and error handling. - Updated changelog to document the addition of VMSS get operations.
…anitization; update assets.json with tag value.
- Updated the description for VmGetCommand to clarify the behavior based on parameters and streamline the information provided. - Revised the description for VmssGetCommand to enhance clarity on the retrieval of VMSS and their instances, focusing on the details returned. - Removed outdated specialized resource collection patterns from new-command.md to simplify documentation.
- Implemented VmCreateCommand to facilitate the creation of Azure VMs. - Introduced VmCreateResult model to encapsulate the results of VM creation. - Enhanced ComputeOptionDefinitions with new options for VM creation, including size, image, and workload. - Created VmCreateOptions class to manage input parameters for VM creation. - Updated ComputeService to handle VM creation logic, including network and security group setup. - Added workload configurations to suggest optimal VM sizes based on workload type. - Implemented unit tests for VmCreateCommand to ensure correct behavior and validation of inputs.
…ements and SSH key discovery
- Removed SSH key auto-discovery from ~/.ssh/ (problematic for remote MCP servers) - Require explicit --ssh-public-key or --admin-password for Linux VMs - Updated tool description with clear instructions for SSH key workflow - Added helpful validation error message guiding users to read SSH public key first
- Add VmUpdateCommand for updating VM properties (size, tags, license type, boot diagnostics, user data) - Add VmssCreateCommand for creating VMSS with smart workload defaults - Add VmssUpdateCommand for updating VMSS properties (capacity, upgrade policy, overprovision, auto-os-upgrade, scale-in-policy, tags) - Add corresponding Options, Result models, and service implementations - Register new commands in ComputeSetup and JSON serialization context
…create/update commands
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive VM and VMSS creation and update capabilities to the Azure MCP Compute tool. The implementation introduces four new commands with smart workload-based defaults that automatically suggest appropriate VM sizes and configurations based on workload type (development, web, database, compute, memory, gpu, general).
Changes:
- Added 4 new commands:
compute vm create,compute vm update,compute vmss create, andcompute vmss update - Implemented workload-based VM sizing with 7 predefined workload profiles
- Added comprehensive unit tests (98 tests) and live tests (4 new tests)
- Updated documentation with detailed command examples and parameter descriptions
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ComputeService.cs | Core implementation of VM/VMSS create/update operations with network resource auto-creation |
| VmCreateCommand.cs, VmUpdateCommand.cs | Command handlers for VM lifecycle operations |
| VmssCreateCommand.cs, VmssUpdateCommand.cs | Command handlers for VMSS lifecycle operations |
| IComputeService.cs | Interface definitions for new operations |
| ComputeOptionDefinitions.cs | Option definitions for all new parameters |
| VmCreateCommandTests.cs, VmUpdateCommandTests.cs | Unit tests for VM commands (46 tests total) |
| VmssCreateCommandTests.cs, VmssUpdateCommandTests.cs | Unit tests for VMSS commands (52 tests total) |
| ComputeCommandTests.cs | Live/recorded tests for update operations |
| azmcp-commands.md | Complete command documentation with examples |
| e2eTestPrompts.md | Test prompts for end-to-end validation |
| consolidated-tools.json | Tool grouping definitions |
| CODEOWNERS | Code ownership assignments (with duplicate entry) |
added 5 commits
February 11, 2026 15:44
…new examples and clearer instructions
…ermination; add Network Contributor role for VM create tests
…ove obsolete vmcreate.md file
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.
Summary
Addresses tools from #1452
This PR adds four new compute commands for creating and updating Azure Virtual Machines (VMs) and Virtual Machine Scale Sets (VMSS):
azmcp compute vm create- Create a new virtual machineazmcp compute vm update- Update an existing virtual machineazmcp compute vmss create- Create a new virtual machine scale setazmcp compute vmss update- Update an existing virtual machine scale setCommand Parameters
compute vm create--vm-name--resource-group--subscription--location--vm-size--image--admin-username--admin-password--ssh-public-key--workload--os-type--virtual-network--subnet--public-ip-address--network-security-group--no-public-ip--zone--os-disk-size-gb--os-disk-typecompute vm update--vm-name--resource-group--subscription--vm-size--tags--license-type--boot-diagnostics--user-datacompute vmss create--vmss-name--resource-group--subscription--location--vm-size--image--admin-username--admin-password--ssh-public-key--workload--os-type--virtual-network--subnet--instance-count--upgrade-policy--zone--os-disk-size-gb--os-disk-typecompute vmss update--vmss-name--resource-group--subscription--vm-size--capacity--upgrade-policy--overprovision--enable-auto-os-upgrade--scale-in-policy--tagsChanges
Documentation
azmcp-commands.mdwith full command documentatione2eTestPrompts.mdconsolidated-tools.jsonwith tool groupingsREADME.mdwith example promptsTests
Changelog
ToolDescriptionEvaluator Results
43 prompts tested for compute tools:
Testing
Azure/azure-sdk-assetswith tagAzure.Mcp.Tools.Compute.LiveTests_8c431d915f