Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将VM操作系统设置为在使用ARM模板创建时自动更新-Azure_Azure_Powershell_Azure Virtual Machine - Fatal编程技术网

如何将VM操作系统设置为在使用ARM模板创建时自动更新-Azure

如何将VM操作系统设置为在使用ARM模板创建时自动更新-Azure,azure,powershell,azure-virtual-machine,Azure,Powershell,Azure Virtual Machine,我使用Powershell命令和ARM模板在Azure中构建了一个VM。我的模板包含以下部分: "osProfile": { "computerName": "[parameters('virtualMachines_abc_name')]", "adminUsername": "testadm", "windowsConfiguration": {

我使用Powershell命令和ARM模板在Azure中构建了一个VM。我的模板包含以下部分:

             "osProfile": {
                    "computerName": "[parameters('virtualMachines_abc_name')]",
                    "adminUsername": "testadm",
                    "windowsConfiguration": {
                        "provisionVMAgent": true,
                        "enableAutomaticUpdates": true
                    },
                    "secrets": [],
                    "allowExtensionOperations": true
                },
你可以看到我已经将“enableautomaticcupates”设置为true。但是当机器被配置时,它不会被启用。有人见过这个问题吗?我是否可以在特定VM上运行等效的Powershell命令?我的虚拟机是Windows数据中心操作系统


提前感谢您的指点

这在语法上看起来是正确的:


我从来没有见过这样的应用,只有各种各样的解决方案,比如Azure Automation\Log Analytics

我总是用这个选项创建VM,从来没有遇到过任何问题。您是否有某些信息表明在使用该选项后未启用Windows update

但就Powershell等效设备而言

设置AzureRmVMOperatingSystem-VM$VM-Windows-ComputerName$ComputerName-Credential$cred-ProvisionionVMAgent-EnableAutoUpdate


您可以使用模板中的PowerShell脚本尝试自定义vm扩展。