Azure / Azure/azure-cli

Inconsistent Output to az vm update with --what-if

Open
#32,515 1 comment 0 reactions 2 assignees Claimed by @zhoxing-ms View on GitHub
act-observability-squad Auto-Assign Azure CLI Team Compute customer-reported question
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Issue Type

Bug Report

### Description

I created a virtual machine with the command below

````
az vm create -n '' -g '' --image Win2022Datacenter --size 'Standard_B2ms' --vnet-name '' --subnet ''
````

I decided to upsize the server to Standard_B4ms and noticed an inconsistency in the --what-if output when I executed the command 4 times in a row.

### Command or Script

```shell
az vm update --resource-group '' --name '' --set hardwareProfile.vmSize=Standard_B4ms --what-if
```

### Expected Behavior

````
Resource and property changes are indicated with this symbol:
~ Modify

The deployment will update the following scope:

Scope: /subscriptions//resourceGroups/

~ Microsoft.Compute/virtualMachines/ [2025-04-01]
~ properties.hardwareProfile.vmSize: "Standard_B2ms" => "Standard_B4ms"

Resource changes: 1 to modify.
````

### Actual Behavior

````
Resource and property changes are indicated with this symbol:
~ Modify

The deployment will update the following scope:

Scope: /subscriptions//resourceGroups/

~ Microsoft.Compute/virtualMachines/ [2025-04-01]
~ properties.hardwareProfile.vmSize: "Standard_B2ms" => "Standard_B4ms"
~ properties.networkProfile.networkInterfaces: [
~ 0:

~ id: "/subscriptions//resourceGroups//Microsoft.Network/networkInterfaces/" => "/subscriptions//resourceGroups//providers/Microsoft.Network/networkInterfaces/defaultValue"

]
~ properties.osProfile.adminUsername: "" => "defaultValue"
~ properties.storageProfile.imageReference.offer: "WindowsServer" => "UbuntuServer"
~ properties.storageProfile.imageReference.publisher: "MicrosoftWindowsServer" => "Canonical"
~ properties.storageProfile.imageReference.sku: "2022-datacenter-g2" => "18.04-LTS"
~ properties.storageProfile.osDisk.name: "test-whatif-vm_OsDisk_1_db22fbcb060944d6953000750b63c40e" => "osdisk"

Resource changes: 1 to modify.
````

### Environment

- OS: macOS Tahoe 26.1
- Tool Version: Azure CLI 2.81.0.post20251202050623
- Python Version: 3.12.10

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.