且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

创建后如何在Azure数据工厂中启用诊断

更新时间:2023-02-04 21:04:36

试试这个(对我有用)

让我们思考一下:

try this (This worked for me)

Let's think for example:

部署名称:AzureADF-DiagSettings-Deployment
部署资源组:ADFactoryRG
Azure数据工厂实例名称:ADFactory
诊断设置名称(在ADFactory中):DiagService
日志分析实例名称:OMSWorkspace
日志分析资源组:OMSWorkspaceRG

Deployment name: AzureADF-DiagSettings-Deployment
Deployment resource group: ADFactoryRG
Azure Data Factory instance name: ADFactory
Diagnostic settings name (In ADFactory): DiagService
Log analytics instance name: OMSWorkspace
Log analytics resource group: OMSWorkspaceRG

{
  "$schema": "https://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {},
  "variables": {},
  "resources": [
    {
      "apiVersion": "2017-05-10",
      "name": "AzureADF-DiagSettings-Deployment",
      "type": "Microsoft.Resources/deployments",
      "resourceGroup": "ADFactoryRG",
      "properties": {
        "mode": "Incremental",
        "template": {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {},
          "variables": {},
          "resources": [
            {
              "type": "microsoft.datafactory/factories/providers/diagnosticsettings",
              "name": "ADFactory/Microsoft.Insights/DiagService",
              "apiVersion": "2017-05-01-preview",
              "properties": {
                "name": "DiagService",
                "storageAccountId": null,
                "eventHubAuthorizationRuleId": null,
                "eventHubName": null,
                "workspaceId": "OMSWorkspaceRG/Microsoft.OperationalInsights/workspaces/OMSWorkspace",
                "logs": [
                  {
                    "category": "PipelineRuns",
                    "enabled": true,
                    "retentionPolicy": {
                        "enabled": false,
                        "days": 0
                    }
                  },
                  {
                    "category": "TriggerRuns",
                    "enabled": true,
                    "retentionPolicy": {
                        "enabled": false,
                        "days": 0
                    }
                  },
                  {
                    "category": "ActivityRuns",
                    "enabled": true,
                    "retentionPolicy": {
                        "enabled": false,
                        "days": 0
                    }
                  }
                ],
                "metrics": [
                  {
                    "category": "AllMetrics",
                    "timeGrain": "PT1M",
                    "enabled": true,
                    "retentionPolicy": {
                      "enabled": false,
                      "days": 0
                    }
                  }
                ]
              }
            }
          ],
          "outputs": {}
        },
        "parameters": {}
      }
    }
  ],
  "outputs": {}
}