Skip to content

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

@Toluwaloope

Description

@Toluwaloope

Issue Type

Bug Report

Description

I created a virtual machine with the command below

az vm create -n '<vm-name>' -g '<resource-group>' --image Win2022Datacenter --size 'Standard_B2ms' --vnet-name '<vnet-name>' --subnet '<subnet-name>'

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

az vm update --resource-group '<rg-name>' --name '<vm-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/<subscriptionid>/resourceGroups/<resource-group-name>

  ~ Microsoft.Compute/virtualMachines/<vm-name> [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/<subscriptionid>/resourceGroups/<resource-group-name>

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

        ~ id: "/subscriptions/<subscriptionid>/resourceGroups/<resource-group-name>/Microsoft.Network/networkInterfaces/<nic-name>" => "/subscriptions/<subscriptionid>/resourceGroups/<resource-group-name>/providers/Microsoft.Network/networkInterfaces/defaultValue"

      ]
    ~ properties.osProfile.adminUsername:                 "<admin-username>" => "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

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamComputeaz vm/vmss/image/disk/snapshotcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions