【问题标题】:ARM template for enabling Update Management on Azure Virtual Machine用于在 Azure 虚拟机上启用更新管理的 ARM 模板
【发布时间】:2019-05-07 08:23:25
【问题描述】:

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

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

参考:https://docs.microsoft.com/en-us/azure/automation/automation-update-management

【问题讨论】:

    标签: azure templates virtual-machine azure-resource-manager arm-template


    【解决方案1】:

    您无法启用 vm 进行更新管理,您可以将 oms 和 azure 自动化与启用更新管理相关联。或多或少。这是一个或多或少可行的变体:

    {
        "$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')]"
                ]
            }
        ]
    }
    

    【讨论】:

    • 此脚本是否适用于现有的自动化帐户和 Log Analytics 帐户
    • 如果你适应它 - 是的
    • 大家好,我有一个问题,我正在准备类似的ARM模板。我需要 ARM 来将虚拟机加入更新管理。我的 ARM 安装了 MMA 或 OMS 代理或 VM,将 VM 连接到工作区,但在 ARM 部署后 VM 仍未载入,没有安装 Hybrid Worker(VM 注册表和自动化帐户设置),有什么方法可以完全载入 VM使用 ARM 模板?
    • 应该有,提出一个新问题,也许有人能帮忙
    【解决方案2】:

    我刚刚在我的 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]"
            }
        }
    

    【讨论】:

    • 上述脚本没有在任何地方引用自动化帐户。如果我运行脚本,更新管理如何启用。
    • 任何帮助将不胜感激
    • @4c74356b41,我们将不胜感激
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-10
    相关资源
    最近更新 更多