Repository navigation
[Compute] Add Flow VMs (FlexProfile) support to az vm #34222
Description
Preconditions
- No need to upgrade Python SDK or the Python SDK is ready.
Related command
az vm update(urgent fix, see below)az vm create --preferred-sizeaz vm update --preferred-sizeaz vm show/az vm list(output gainsflexProfile)
Resource Provider
Microsoft.Compute/virtualMachines
Description of Feature or Work Requested
[Public Preview]
Add Azure CLI support for Flow VMs (API name: FlexProfile), introduced in Compute API version 2026-04-01. A customer states a preferred VM size instead of an exact one. When the preferred size is constrained by capacity or placement, Azure may deploy a compatible alternative size. The VM records the request in properties.flexProfile.preferredVMSize and reports the deployed size in properties.hardwareProfile.vmSize. Using it requires the subscription feature Microsoft.Compute/FlexProfileEnabled and a supported region.
Urgent: az vm update removes FlexProfile today. az vm update does a GET and then a PUT through the AAZ model for 2026-04-01 (aaz/latest/vm/_update.py: VirtualMachinesGet, then VirtualMachinesCreateOrUpdate). That model has no flexProfile, and the AAZ loader skips fields the model doesn't define (azure-cli-core/aaz/_field_type.py, "ignore undefined key"). So the PUT is sent without flexProfile, which the service treats as an opt-out. Any az vm update on a Flow VM, even a tag change, silently takes it off FlexProfile. Regenerating the AAZ VM model from the merged spec at 2026-04-01 fixes this. No API-version change is needed, since az vm already uses 2026-04-01.
API rules the commands must respect:
- A request that adds
flexProfileto a VM that doesn't use it yet must not includehardwareProfile.vmSize. The service rejects it withInvalidParameter. - On a VM that already uses FlexProfile, a
hardwareProfile.vmSizeequal to the deployed size is ignored, so a GET body can be sent back unchanged. A different size is rejected withInvalidParameter. - To stop using FlexProfile, send a PUT that omits
flexProfileand setshardwareProfile.vmSize. This pins the VM to that size.
Proposed command changes:
az vm create: new--preferred-size, mutually exclusive with--size.--sizehas a default today, and_template_builder.pyalways setshardwareProfile.vmSize. With--preferred-size, the template setsflexProfile.preferredVMSizeand leaves outhardwareProfile.vmSize. Steps that depend on the VM size use the preferred size.az vm update: keepsflexProfileon ordinary updates after the AAZ regeneration. New--preferred-sizesets or changes the preferred size, and also switches a VM that doesn't use FlexProfile yet. When it's used, the PUT leaves outhardwareProfile.vmSize.- Opt-out:
az vm update --size <size> --remove flexProfile. az vm show/az vm list: output gainsflexProfileafter the AAZ regeneration.- Please also check
az vm resizeand any other command that sends a full VM PUT.
The PowerShell design with the same behaviour rules is https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/1578.
Minimum API Version Required
2026-04-01
Swagger PR link / SDK link
Azure/azure-rest-api-specs#46694
Request Example
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/compute/resource-manager/Microsoft.Compute/Compute/Compute/examples/2026-04-01/virtualMachineExamples/VirtualMachine_Create_WithFlexProfile.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/compute/resource-manager/Microsoft.Compute/Compute/Compute/examples/2026-04-01/virtualMachineExamples/VirtualMachine_Get_WithFlexProfile.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/compute/resource-manager/Microsoft.Compute/Compute/Compute/examples/2026-04-01/virtualMachineExamples/VirtualMachine_Update_WithFlexProfile.json
Target Date
2026-11-10
PM Contact
Lavanya.Krishnan@microsoft.com
Engineer Contact
Sri Harsha Varma Varma Uppalapati (@suppalapati-microsoft)
Additional context
The az vm update fix (AAZ model regeneration) is the most urgent part, because it affects Flow VMs created through the API, SDKs or PowerShell.
Activity
yonzhan commentedon Oct 13, 2026
Thank you for opening this issue, we will look into it.