用于在Azure虚拟机上启用更新管理的ARM模板

用于在Azure虚拟机上启用更新管理的ARM模板,azure,templates,virtual-machine,azure-resource-manager,arm-template,Azure,Templates,Virtual Machine,Azure Resource Manager,Arm Template,有人可以帮助我使用Azure资源管理器模板在Azure VM上启用更新管理吗 我可以在网上找到任何模板来启用它 参考:您无法为更新管理启用vm,您可以在启用更新管理的情况下链接oms和azure automation。或多或少这里有一个或多或少可行的变体: { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion":

有人可以帮助我使用Azure资源管理器模板在Azure VM上启用更新管理吗

我可以在网上找到任何模板来启用它


参考:

您无法为更新管理启用vm,您可以在启用更新管理的情况下链接oms和azure automation。或多或少这里有一个或多或少可行的变体:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.1",
    "parameters": {
        "prefix": {
            "type": "string"
        }
    },
    "variables": {
        "namespace": "[concat(parameters('prefix'), '-la')]",
        "automation": "[concat(parameters('prefix'), '-aa')]",
        "solutions": [
            "AlertManagement",
            "Updates",
            "Security"
        ]
    },
    "resources": [
        {
            "type": "Microsoft.OperationalInsights/workspaces",
            "name": "[variables('namespace')]",
            "apiVersion": "2017-03-15-preview",
            "location": "[resourceGroup().location]",
            "properties": {
                "sku": {
                    "name": "Standalone"
                }
            },
            "resources": [
                {
                    "name": "Automation",
                    "type": "linkedServices",
                    "apiVersion": "2015-11-01-preview",
                    "dependsOn": [
                        "[variables('automation')]",
                        "[variables('namespace')]"
                    ],
                    "properties": {
                        "resourceId": "[resourceId('Microsoft.Automation/automationAccounts/', variables('automation'))]"
                    }
                },
            ]
        },
        {
            "type": "Microsoft.Automation/automationAccounts",
            "name": "[variables('automation')]",
            "apiVersion": "2015-10-31",
            "location": "[resourceGroup().location]",
            "properties": {
                "sku": {
                    "name": "OMS"
                }
            }
        },
        {
            "type": "Microsoft.OperationsManagement/solutions",
            "name": "[concat(variables('solutions')[copyIndex()],'(', variables('namespace'), ')')]",
            "apiVersion": "2015-11-01-preview",
            "location": "[resourceGroup().location]",
            "copy": {
                "name": "solutions",
                "count": "[length(variables('solutions'))]"
            },
            "plan": {
                "name": "[concat(variables('solutions')[copyIndex()], '(', variables('namespace'), ')')]",
                "promotionCode": "",
                "product": "[concat('OMSGallery/', variables('solutions')[copyIndex()])]",
                "publisher": "Microsoft"
            },
            "properties": {
                "workspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('namespace'))]"
            },
            "dependsOn": [
                "[variables('namespace')]"
            ]
        }
    ]
}

您无法为更新管理启用vm,您可以在启用更新管理的情况下链接oms和azure automation。或多或少这里有一个或多或少可行的变体:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.1",
    "parameters": {
        "prefix": {
            "type": "string"
        }
    },
    "variables": {
        "namespace": "[concat(parameters('prefix'), '-la')]",
        "automation": "[concat(parameters('prefix'), '-aa')]",
        "solutions": [
            "AlertManagement",
            "Updates",
            "Security"
        ]
    },
    "resources": [
        {
            "type": "Microsoft.OperationalInsights/workspaces",
            "name": "[variables('namespace')]",
            "apiVersion": "2017-03-15-preview",
            "location": "[resourceGroup().location]",
            "properties": {
                "sku": {
                    "name": "Standalone"
                }
            },
            "resources": [
                {
                    "name": "Automation",
                    "type": "linkedServices",
                    "apiVersion": "2015-11-01-preview",
                    "dependsOn": [
                        "[variables('automation')]",
                        "[variables('namespace')]"
                    ],
                    "properties": {
                        "resourceId": "[resourceId('Microsoft.Automation/automationAccounts/', variables('automation'))]"
                    }
                },
            ]
        },
        {
            "type": "Microsoft.Automation/automationAccounts",
            "name": "[variables('automation')]",
            "apiVersion": "2015-10-31",
            "location": "[resourceGroup().location]",
            "properties": {
                "sku": {
                    "name": "OMS"
                }
            }
        },
        {
            "type": "Microsoft.OperationsManagement/solutions",
            "name": "[concat(variables('solutions')[copyIndex()],'(', variables('namespace'), ')')]",
            "apiVersion": "2015-11-01-preview",
            "location": "[resourceGroup().location]",
            "copy": {
                "name": "solutions",
                "count": "[length(variables('solutions'))]"
            },
            "plan": {
                "name": "[concat(variables('solutions')[copyIndex()], '(', variables('namespace'), ')')]",
                "promotionCode": "",
                "product": "[concat('OMSGallery/', variables('solutions')[copyIndex()])]",
                "publisher": "Microsoft"
            },
            "properties": {
                "workspaceResourceId": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('namespace'))]"
            },
            "dependsOn": [
                "[variables('namespace')]"
            ]
        }
    ]
}

我刚刚在VM部署脚本中包含了以下脚本。可以吗

{
        "type": "Microsoft.OperationsManagement/solutions",
        "name": "[concat(variables('solutions')[copyIndex()],'(', parameters('workspaceName'), ')')]",
        "apiVersion": "2015-11-01-preview",
        "location": "[resourceGroup().location]",
        "copy": {
            "name": "solutions",
            "count": "[length(variables('solutions'))]"
        },
        "plan": {
            "name": "[concat(variables('solutions')[copyIndex()], '(', parameters('workspaceName'), ')')]",
            "promotionCode": "",
            "product": "[concat('OMSGallery/', variables('solutions')[copyIndex()])]",
            "publisher": "Microsoft"
        },
        "properties": {
            "workspaceResourceId": "[reference(resourceId(parameters('workspaceRGName'), 'Microsoft.OperationalInsights/workspaces/', parameters('workspaceName')), '2015-03-20').customerId]"
        }
    }

我刚刚在VM部署脚本中包含了以下脚本。可以吗

{
        "type": "Microsoft.OperationsManagement/solutions",
        "name": "[concat(variables('solutions')[copyIndex()],'(', parameters('workspaceName'), ')')]",
        "apiVersion": "2015-11-01-preview",
        "location": "[resourceGroup().location]",
        "copy": {
            "name": "solutions",
            "count": "[length(variables('solutions'))]"
        },
        "plan": {
            "name": "[concat(variables('solutions')[copyIndex()], '(', parameters('workspaceName'), ')')]",
            "promotionCode": "",
            "product": "[concat('OMSGallery/', variables('solutions')[copyIndex()])]",
            "publisher": "Microsoft"
        },
        "properties": {
            "workspaceResourceId": "[reference(resourceId(parameters('workspaceRGName'), 'Microsoft.OperationalInsights/workspaces/', parameters('workspaceName')), '2015-03-20').customerId]"
        }
    }

这个脚本适用于已经存在的自动化帐户和日志分析帐户吗?如果你修改它-yesHi伙计们,我有一个问题,我正在准备类似的ARM模板。我需要ARM来将虚拟机安装到更新管理中。我的ARM安装MMA或OMS代理或虚拟机,将虚拟机连接到工作区,但在ARM部署虚拟机尚未安装后,没有安装混合工作程序(虚拟机注册表和自动化帐户设置),是否有任何方法使用ARM模板完全安装虚拟机?应该有,提出一个新问题,有人可能能够帮助你,这个脚本是否适用于已经存在的自动化帐户和日志分析帐户,如果你对其进行调整-yesHi伙计们,我有一个问题,我正在准备类似的ARM模板。我需要ARM来将虚拟机安装到更新管理中。我的ARM安装MMA或OMS代理或虚拟机,将虚拟机连接到工作区,但在ARM部署虚拟机尚未安装后,没有安装混合工作程序(虚拟机注册表和自动化帐户设置),是否有任何方法使用ARM模板完全安装虚拟机?应该有,提出一个新问题,有人可能会提供帮助,因为上面的脚本没有在任何地方引用自动化帐户。如果我运行脚本,更新管理将如何启用。任何帮助都将是appreciated@4c74356b41,如有任何帮助,我们将不胜感激。上述脚本未在任何地方引用自动化帐户。如果我运行脚本,更新管理将如何启用。任何帮助都将是appreciated@4c74356b41,如有任何帮助,将不胜感激