-
Notifications
You must be signed in to change notification settings - Fork 3.4k
VM update commands fails to update VM OS configs with azure cli v2.81 & v2.82 #32671
Copy link
Copy link
Open
Labels
Auto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamBreaking ChangeComputeaz vm/vmss/image/disk/snapshotaz vm/vmss/image/disk/snapshotact-observability-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-triageThis issue needs the team to triage.This issue needs the team to triage.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Metadata
Metadata
Assignees
Labels
Auto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamBreaking ChangeComputeaz vm/vmss/image/disk/snapshotaz vm/vmss/image/disk/snapshotact-observability-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-triageThis issue needs the team to triage.This issue needs the team to triage.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
The latest azure cli version fails to update the OS profile with below error.
"ERROR: Couldn't find 'automaticByPlatformSettings' in 'osProfile.windowsConfiguration.patchSettings'. Available options: ['assessmentMode', 'patchMode']
"
Command:
az vm update --resource-group $AzResourceGroup.name--name $VirtualMachineName
--set osProfile.windowsConfiguration.enableAutomaticUpdates=trueosProfile.windowsConfiguration.patchSettings.patchMode=AutomaticByPlatform
osProfile.windowsConfiguration.patchSettings.automaticByPlatformSettings.bypassPlatformSafetyChecksOnUserSchedule=true| Out-Null`
Note: The above used to work as expected until v2.78 and probably for later releases before v2.81. We noticed our pipelines started with fail after AzureManagedPools updated the underneath azure cli version to v2.81. We figured out a workaround but wanted to highlist so this can be fixed in later versions of azure cli.
Steps to reproduce:
Work Around:
Instead of az vm update we are direcly utlizing the az rest api calls.
Example:
$azVmId = $result.id $body = '{"properties":{"osProfile":{"windowsConfiguration":{"enableAutomaticUpdates":true,"patchSettings":{"patchMode":"AutomaticByPlatform","automaticByPlatformSettings":{"bypassPlatformSafetyChecksOnUserSchedule":true}}}}}}' $jsonBody = $body | ConvertTo-Json -Depth 10 -Compress az rest --uri "https://management.azure.com/$azVmId?api-version=2024-03-01"--method patch
--headers "Content-Type=application/json"--body $jsonBody
| Out-NullRelated command
az vm update
Errors
ERROR: Couldn't find 'automaticByPlatformSettings' in 'osProfile.windowsConfiguration.patchSettings'. Available options: ['assessmentMode', 'patchMode']
Issue script & Debug output
Not sure. But added a workaround which might help the backend team to figure the root cause.
Expected behavior
az vm update should be able to update the automatic upgrade configs without any errors.
Environment Summary
azure cli v2.82
Additional context
NA