Management Group Diagnostic Settings - Create Or Update

建立或更新指定資源的管理群組診斷設定。

PUT https://management.azure.com/providers/microsoft.management/managementGroups/{managementGroupId}/providers/microsoft.insights/diagnosticSettings/{name}?api-version=2020-01-01-preview

URI 參數

Name In Required Type Description
managementGroupId
path True
  • string

管理群組識別碼。

name
path True
  • string

診斷設定的名稱。

api-version
query True
  • string

要用於這項作業的 API 版本。

要求本文

Name Type Description
location
  • string

資源的位置

properties.eventHubAuthorizationRuleId
  • string

事件中樞授權規則的資源識別碼。

properties.eventHubName
  • string

事件中樞的名稱。 如果未指定任何專案,則會選取預設事件中樞。

properties.logs

記錄設定的清單。

properties.serviceBusRuleId
  • string

診斷設定的服務匯流排規則識別碼。 這是為了維持回溯相容性。

properties.storageAccountId
  • string

您想要傳送診斷記錄之儲存體帳戶的資源識別碼。

properties.workspaceId
  • string

您想要傳送診斷記錄之 Log Analytics 工作區的完整 ARM 資源識別碼。 範例:/subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2

回應

Name Type Description
200 OK

成功要求建立管理群組診斷設定

Other Status Codes

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation 模擬您的使用者帳戶

範例

Creates or Updates the management group diagnostic setting

Sample Request

PUT https://management.azure.com/providers/microsoft.management/managementGroups/testChildMG7/providers/microsoft.insights/diagnosticSettings/setting1?api-version=2020-01-01-preview

{
  "properties": {
    "storageAccountId": "/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5",
    "workspaceId": "/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace",
    "eventHubAuthorizationRuleId": "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
    "eventHubName": "myeventhub",
    "logs": [
      {
        "category": "Administrative",
        "enabled": true
      },
      {
        "category": "Policy",
        "enabled": true
      }
    ]
  }
}

Sample Response

{
  "id": "providers/Microsoft.Management/managementGroups/testChildMG7/providers/microsoft.insights/diagnosticSettings/setting1",
  "type": "Microsoft.Insights/diagnosticSettings",
  "name": "setting1",
  "location": "global",
  "properties": {
    "storageAccountId": "/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5",
    "workspaceId": "/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace",
    "eventHubAuthorizationRuleId": "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
    "logs": [
      {
        "category": "Administrative",
        "enabled": true
      },
      {
        "category": "Policy",
        "enabled": true
      }
    ]
  }
}

定義

ErrorResponse

描述錯誤回應的格式。

ManagementGroupDiagnosticSettingsResource

管理群組診斷設定資源。

ManagementGroupLogSettings

管理群組診斷設定的一部分。 指定特定記錄檔的設定。

ErrorResponse

描述錯誤回應的格式。

Name Type Description
code
  • string

錯誤碼

message
  • string

指出作業失敗原因的錯誤訊息。

ManagementGroupDiagnosticSettingsResource

管理群組診斷設定資源。

Name Type Description
id
  • string

Azure 資源識別碼

location
  • string

資源的位置

name
  • string

Azure 資源名稱

properties.eventHubAuthorizationRuleId
  • string

事件中樞授權規則的資源識別碼。

properties.eventHubName
  • string

事件中樞的名稱。 如果未指定任何專案,則會選取預設事件中樞。

properties.logs

記錄設定的清單。

properties.serviceBusRuleId
  • string

診斷設定的服務匯流排規則識別碼。 這是為了維持回溯相容性。

properties.storageAccountId
  • string

您想要傳送診斷記錄之儲存體帳戶的資源識別碼。

properties.workspaceId
  • string

您想要傳送診斷記錄之 Log Analytics 工作區的完整 ARM 資源識別碼。 範例:/subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2

type
  • string

Azure 資源類型

ManagementGroupLogSettings

管理群組診斷設定的一部分。 指定特定記錄檔的設定。

Name Type Description
category
  • string

套用此設定的資源類型管理群組診斷記錄類別名稱。

enabled
  • boolean

值,指出是否啟用此記錄檔。