Incident Relations - Create Or Update

建立或更新事件關聯性。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}?api-version=2025-09-01

URI 參數

名稱 位於 必要 類型 Description
incidentId
path True

string

事件 ID

relationName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-zA-Z0-9-]{3,63}$

關係名稱

resourceGroupName
path True

string

minLength: 1
maxLength: 90

資源群組的名稱。 名稱不區分大小寫。

subscriptionId
path True

string (uuid)

目標訂用帳戶的標識碼。 此值必須是 UUID。

workspaceName
path True

string

minLength: 1
maxLength: 90
pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$

監視器工作區的名稱。

api-version
query True

string

minLength: 1

用於此作業的 API 版本。

要求本文

名稱 必要 類型 Description
properties.relatedResourceId True

string

相關資源的資源識別碼

etag

string

Azure 資源的 Etag

回覆

名稱 類型 Description
200 OK

Relation

資源「關聯」更新操作成功

201 Created

Relation

資源「關係」建立操作成功

Other Status Codes

CloudError

未預期的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

Creates or updates an incident relation.

範例要求

PUT https://management.azure.com/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/incidents/afbd324f-6c48-459c-8710-8d1e1cd03812/relations/4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014?api-version=2025-09-01

{
  "properties": {
    "relatedResourceId": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096"
  }
}

範例回覆

{
  "id": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/incidents/afbd324f-6c48-459c-8710-8d1e1cd03812/relations/4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
  "name": "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
  "type": "Microsoft.SecurityInsights/incidents/relations",
  "etag": "190057d0-0000-0d00-0000-5c6f5adb0000",
  "properties": {
    "relatedResourceId": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096",
    "relatedResourceName": "2216d0e1-91e3-4902-89fd-d2df8c535096",
    "relatedResourceType": "Microsoft.SecurityInsights/bookmarks"
  }
}
{
  "id": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/incidents/afbd324f-6c48-459c-8710-8d1e1cd03812/relations/4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
  "name": "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014",
  "type": "Microsoft.SecurityInsights/incidents/relations",
  "etag": "190057d0-0000-0d00-0000-5c6f5adb0000",
  "properties": {
    "relatedResourceId": "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096",
    "relatedResourceName": "2216d0e1-91e3-4902-89fd-d2df8c535096",
    "relatedResourceType": "Microsoft.SecurityInsights/bookmarks"
  }
}

定義

名稱 Description
CloudError

錯誤回應結構。

CloudErrorBody

錯誤詳細數據。

createdByType

建立資源的身分識別類型。

Relation

代表兩個資源之間的關係

systemData

與建立和上次修改資源相關的元數據。

CloudError

錯誤回應結構。

名稱 類型 Description
error

CloudErrorBody

錯誤資料

CloudErrorBody

錯誤詳細數據。

名稱 類型 Description
code

string

錯誤的識別碼。 程序代碼是不變的,而且是要以程序設計方式取用。

message

string

描述錯誤的訊息,適用於在使用者介面中顯示。

createdByType

建立資源的身分識別類型。

值 Description
User
Application
ManagedIdentity
Key

Relation

代表兩個資源之間的關係

名稱 類型 Description
etag

string

Azure 資源的 Etag

id

string (arm-id)

資源的完整資源標識碼。 例如 “/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

name

string

資源的名稱

properties.relatedResourceId

string

相關資源的資源識別碼

properties.relatedResourceKind

string

相關資源的資源種類

properties.relatedResourceName

string

相關資源的名稱

properties.relatedResourceType

string

相關資源的資源類型

systemData

systemData

包含 createdBy 和 modifiedBy 資訊的 Azure Resource Manager 中繼資料。

type

string

資源的類型。 例如「Microsoft.Compute/virtualMachines」或「Microsoft.Storage/storageAccounts」

systemData

與建立和上次修改資源相關的元數據。

名稱 類型 Description
createdAt

string (date-time)

資源建立的時間戳(UTC)。

createdBy

string

建立資源的身分識別。

createdByType

createdByType

建立資源的身分識別類型。

lastModifiedAt

string (date-time)

上次修改的資源時間戳 (UTC)

lastModifiedBy

string

上次修改資源的身分識別。

lastModifiedByType

createdByType

上次修改資源的身分識別類型。