gpt4 book ai didi

azure - 如何配置逻辑应用以登录到 ARM 模板中的 Log Analytics?

转载 作者:行者123 更新时间:2023-12-02 07:39:38 25 4
gpt4 key购买 nike

我正在尝试使用逻辑应用部署解决方案,我希望将其日志数据转到 Log Analytics 工作区。通过诊断设置 > 添加诊断设置 > 选中“发送到 Log Analytics”并选择预先存在的工作区,可以轻松在门户中进行配置。

但是,通过查看逻辑应用、工作区或整个资源组的导出模板,我看不到如何在 ARM 模板中配置此链接。文档似乎也根本没有提及此设置。

最佳答案

以下是流式传输到事件中心\存储帐户\日志分析的示例:

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
"type": "string",
"metadata": {
"description": "Name of the Logic App that will be created."
}
},
"testUri": {
"type": "string",
"defaultValue": "https://azure.microsoft.com/status/feed/"
},
"settingName": {
"type": "string",
"metadata": {
"description": "Name of the setting. Name for the diagnostic setting resource. Eg. 'archiveToStorage' or 'forSecurityTeam'."
}
},
"storageAccountName": {
"type": "string",
"metadata": {
"description": "Name of the Storage Account in which Diagnostic Logs should be saved."
}
},
"eventHubAuthorizationRuleId": {
"type": "string",
"metadata": {
"description": "Resource ID of the event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to."
}
},
"eventHubName": {
"type": "string",
"metadata": {
"description": "Optional. Name of the event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category."
}
},
"workspaceId": {
"type": "string",
"metadata": {
"description": "Log Analytics workspace ID for the Log Analytics workspace to which logs will be sent."
}
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Logic/workflows",
"name": "[parameters('logicAppName')]",
"apiVersion": "2016-06-01",
"location": "[resourceGroup().location]",
"properties": {
"definition": {
"$schema": "https://schema.management.azure.com/schemas/2016-06-01/Microsoft.Logic.json",
"contentVersion": "1.0.0.0",
"parameters": {
"testURI": {
"type": "string",
"defaultValue": "[parameters('testUri')]"
}
},
"triggers": {
"recurrence": {
"type": "recurrence",
"recurrence": {
"frequency": "Hour",
"interval": 1
}
}
},
"actions": {
"http": {
"type": "Http",
"inputs": {
"method": "GET",
"uri": "@parameters('testUri')"
},
"runAfter": {}
}
},
"outputs": {}
},
"parameters": {}
},
"resources": [
{
"type": "providers/diagnosticSettings",
"name": "[concat('Microsoft.Insights/', parameters('settingName'))]",
"dependsOn": [
"[resourceId('Microsoft.Logic/workflows', parameters('logicAppName'))]"
],
"apiVersion": "2017-05-01-preview",
"properties": {
"name": "[parameters('settingName')]",
"storageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]",
"eventHubAuthorizationRuleId": "[parameters('eventHubAuthorizationRuleId')]",
"eventHubName": "[parameters('eventHubName')]",
"workspaceId": "[parameters('workspaceId')]",
"logs": [
{
"category": "WorkflowRuntime",
"enabled": true,
"retentionPolicy": {
"days": 0,
"enabled": false
}
}
],
"metrics": [
{
"timeGrain": "PT1M",
"enabled": true,
"retentionPolicy": {
"enabled": false,
"days": 0
}
}
]
}
}
]
}
]
}

https://learn.microsoft.com/en-us/azure/azure-monitor/platform/diagnostic-logs-stream-template

关于azure - 如何配置逻辑应用以登录到 ARM 模板中的 Log Analytics?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57805073/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com