Skip to content

Commit 3347593

Browse files
committed
fix
1 parent 3c540df commit 3347593

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/azure-cli/azure/cli/command_modules/vm/_template_builder.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ def _build_os_profile():
360360
os_profile['secrets'] = secrets
361361

362362
if enable_auto_update is not None and custom_image_os_type.lower() == 'windows':
363+
if 'windowsConfiguration' not in os_profile:
364+
os_profile['windowsConfiguration'] = {}
363365
os_profile['windowsConfiguration']['enableAutomaticUpdates'] = enable_auto_update
364366

365367
# Windows patch settings
@@ -368,6 +370,9 @@ def _build_os_profile():
368370
raise ValidationError(
369371
'Invalid value of --patch-mode for Windows VM. Valid values are AutomaticByOS, '
370372
'AutomaticByPlatform, Manual.')
373+
374+
if 'windowsConfiguration' not in os_profile:
375+
os_profile['windowsConfiguration'] = {}
371376
os_profile['windowsConfiguration']['patchSettings'] = {
372377
'patchMode': patch_mode,
373378
'enableHotpatching': enable_hotpatching

0 commit comments

Comments
 (0)