Skip to content

Add compute VM and VMSS create/update commands with smart workload-based defaults#1705

Merged
g2vinay merged 36 commits intomicrosoft:mainfrom
haagha:haagha/vm-create
Mar 5, 2026
Merged

Add compute VM and VMSS create/update commands with smart workload-based defaults#1705
g2vinay merged 36 commits intomicrosoft:mainfrom
haagha:haagha/vm-create

Conversation

@haagha
Copy link
Copy Markdown
Contributor

@haagha haagha commented Feb 11, 2026

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 machine
  • azmcp compute vm update - Update an existing virtual machine
  • azmcp compute vmss create - Create a new virtual machine scale set
  • azmcp compute vmss update - Update an existing virtual machine scale set

Command Parameters

compute vm create

Parameter Description
--vm-name Name of the VM (required)
--resource-group Resource group name (required)
--subscription Subscription ID or name (required)
--location Azure region
--vm-size VM size (e.g., Standard_D2s_v5)
--image OS image (e.g., Ubuntu2204, Win2022)
--admin-username Admin username
--admin-password Admin password (Windows or Linux without SSH)
--ssh-public-key SSH public key (Linux)
--workload Workload type for smart defaults (development, web, database, compute, memory, gpu, general)
--os-type OS type (Linux, Windows)
--virtual-network Existing VNet name
--subnet Existing subnet name
--public-ip-address Public IP address name
--network-security-group NSG name
--no-public-ip Create without public IP
--zone Availability zone
--os-disk-size-gb OS disk size in GB
--os-disk-type OS disk type (Premium_LRS, Standard_LRS)

compute vm update

Parameter Description
--vm-name Name of the VM (required)
--resource-group Resource group name (required)
--subscription Subscription ID or name (required)
--vm-size Resize VM
--tags Add/update tags (key=value,key2=value2)
--license-type Enable/disable Azure Hybrid Benefit
--boot-diagnostics Enable/disable boot diagnostics (true/false)
--user-data Update base64-encoded user data

compute vmss create

Parameter Description
--vmss-name Name of the VMSS (required)
--resource-group Resource group name (required)
--subscription Subscription ID or name (required)
--location Azure region
--vm-size VM size
--image OS image
--admin-username Admin username
--admin-password Admin password
--ssh-public-key SSH public key (Linux)
--workload Workload type for smart defaults
--os-type OS type (Linux, Windows)
--virtual-network Existing VNet name
--subnet Existing subnet name
--instance-count Initial number of instances
--upgrade-policy Upgrade policy (Automatic, Manual, Rolling)
--zone Availability zone
--os-disk-size-gb OS disk size in GB
--os-disk-type OS disk type

compute vmss update

Parameter Description
--vmss-name Name of the VMSS (required)
--resource-group Resource group name (required)
--subscription Subscription ID or name (required)
--vm-size Resize VMs
--capacity Scale out/in instance count
--upgrade-policy Change upgrade policy (Automatic, Manual, Rolling)
--overprovision Enable/disable overprovisioning
--enable-auto-os-upgrade Enable/disable automatic OS upgrades
--scale-in-policy Set scale-in policy (Default, OldestVM, NewestVM)
--tags Add/update tags (key=value,key2=value2)

Changes

Documentation

  • Updated azmcp-commands.md with full command documentation
  • Added 25+ test prompts to e2eTestPrompts.md
  • Updated consolidated-tools.json with tool groupings
  • Updated README.md with example prompts

Tests

  • Unit Tests: 98 tests covering all commands
  • Live Tests: 11 recorded tests (7 get + 4 update tests)

Changelog

  • Added changelog entry for the new commands

ToolDescriptionEvaluator Results

43 prompts tested for compute tools:

Metric Result
Top Choice Success 97.7% (42/43) ✅
Acceptable Confidence (≥0.4) 97.7% (42/43) ✅

Testing

  • ✅ All 98 unit tests pass
  • ✅ All 11 live tests recorded and pass in playback mode
  • ✅ Recordings pushed to Azure/azure-sdk-assets with tag Azure.Mcp.Tools.Compute.LiveTests_8c431d915f
  • ✅ ToolDescriptionEvaluator: 97.7% top choice success
  • ✅ Spelling check passes
  • ✅ Build succeeds

## Tool Selection Analysis Results Summary

Total Prompts Tested: 46
Analysis Execution Time: 7.9322877s

Success Rate Metrics

Top Choice Success: 97.8% (45/46 tests)

Confidence Level Distribution

💪 Very High Confidence (≥0.8): 0.0% (0/46 tests)
🎯 High Confidence (≥0.7): 4.3% (2/46 tests)
✅ Good Confidence (≥0.6): 34.8% (16/46 tests)
👍 Fair Confidence (≥0.5): 87.0% (40/46 tests)
👌 Acceptable Confidence (≥0.4): 100.0% (46/46 tests)
❌ Low Confidence (<0.4): 0.0% (0/46 tests)

Top Choice + Confidence Combinations

💪 Top Choice + Very High Confidence (≥0.8): 0.0% (0/46 tests)
🎯 Top Choice + High Confidence (≥0.7): 4.3% (2/46 tests)
✅ Top Choice + Good Confidence (≥0.6): 34.8% (16/46 tests)
👍 Top Choice + Fair Confidence (≥0.5): 84.8% (39/46 tests)
👌 Top Choice + Acceptable Confidence (≥0.4): 97.8% (45/46 tests)

Success Rate Analysis

🟢 Excellent - The tool selection system is performing exceptionally well.

⚠️ Recommendation: Tool descriptions need improvement to better match user intent (targets: ≥0.6 good, ≥0.7 high).

Haider Agha added 18 commits January 12, 2026 16:57
- 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.
- 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.
- 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
Copilot AI review requested due to automatic review settings February 11, 2026 19:55
@haagha haagha requested review from a team and g2vinay as code owners February 11, 2026 19:55
@haagha
Copy link
Copy Markdown
Contributor Author

haagha commented Mar 2, 2026

@g2vinay resolved the changes and added tool description analysis in the description:

Tool Selection Analysis Results Summary

Total Prompts Tested: 46
Analysis Execution Time: 7.9322877s

Success Rate Metrics

Top Choice Success: 97.8% (45/46 tests)

Confidence Level Distribution

💪 Very High Confidence (≥0.8): 0.0% (0/46 tests)
🎯 High Confidence (≥0.7): 4.3% (2/46 tests)
✅ Good Confidence (≥0.6): 34.8% (16/46 tests)
👍 Fair Confidence (≥0.5): 87.0% (40/46 tests)
👌 Acceptable Confidence (≥0.4): 100.0% (46/46 tests)
❌ Low Confidence (<0.4): 0.0% (0/46 tests)

Top Choice + Confidence Combinations

💪 Top Choice + Very High Confidence (≥0.8): 0.0% (0/46 tests)
🎯 Top Choice + High Confidence (≥0.7): 4.3% (2/46 tests)
✅ Top Choice + Good Confidence (≥0.6): 34.8% (16/46 tests)
👍 Top Choice + Fair Confidence (≥0.5): 84.8% (39/46 tests)
👌 Top Choice + Acceptable Confidence (≥0.4): 97.8% (45/46 tests)

Success Rate Analysis

🟢 Excellent - The tool selection system is performing exceptionally well.

⚠️ Recommendation: Tool descriptions need improvement to better match user intent (targets: ≥0.6 good, ≥0.7 high).

@haagha haagha requested a review from g2vinay March 2, 2026 18:03
Comment thread tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmCreateCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmUpdateCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Compute/src/Commands/Vmss/VmssCreateCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Compute/src/Services/ComputeService.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Compute/src/Services/ComputeService.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Compute/src/Services/ComputeService.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Compute/src/Services/ComputeService.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Compute/src/Commands/Vm/VmCreateCommand.cs Outdated
Comment thread servers/Azure.Mcp.Server/changelog-entries/1770833341707.yaml Outdated
Copy link
Copy Markdown
Member

@KarishmaGhiya KarishmaGhiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the other feedback. Also what kind of secrets do the create commands emit?

…ress-prefix, fix GUIDs, improve error handling and validation
@haagha
Copy link
Copy Markdown
Contributor Author

haagha commented Mar 4, 2026

All feedback has been addressed. The secret emitted by the create commands is the admin password (--admin-password), which is why they're marked Secret = true.

@haagha haagha requested review from KarishmaGhiya and g2vinay March 4, 2026 17:23
Comment thread tools/Azure.Mcp.Tools.Compute/tests/test-resources.bicep Outdated
@github-project-automation github-project-automation Bot moved this from Untriaged to In Progress in Azure MCP Server Mar 5, 2026
@g2vinay g2vinay merged commit 0942bf6 into microsoft:main Mar 5, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure MCP Server Mar 5, 2026
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants