共用方式為


Log Profiles - Update

匯報 現有的LogProfilesResource。 若要更新其他欄位,請使用 CreateOrUpdate 方法。

PATCH https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}?api-version=2016-03-01

URI 參數

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

string

記錄檔配置檔的名稱。

subscriptionId
path True

string

minLength: 1

目標訂用帳戶的標識碼。

api-version
query True

string

minLength: 1

用於此作業的 API 版本。

要求本文

名稱 必要 類型 Description
properties.categories True

string[]

記錄的類別。 這些類別會建立為使用者方便使用。 某些值包括:『Write』、『Delete』和/或 'Action'。

properties.locations True

string[]

應儲存或串流活動記錄事件的區域清單。 它是有效 ARM 位置的逗號分隔清單,包括 「全域」位置。

properties.retentionPolicy True

RetentionPolicy

記錄中事件的保留原則。

properties.serviceBusRuleId

string

您想要在其中建立事件中樞以串流活動記錄之服務總線命名空間的服務總線規則標識碼。 規則標識碼的格式為:『{服務總線資源標識符}/authorizationrules/{key name}』。

properties.storageAccountId

string

您想要傳送活動記錄之記憶體帳戶的資源識別碼。

tags

object

資源標籤

回應

名稱 類型 Description
200 OK

LogProfileResource

已成功更新現有的記錄檔配置檔。

Other Status Codes

ErrorResponse

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

安全性

azure_auth

Azure Active Directory OAuth2 Flow

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

範圍

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

範例

Patch a log profile

範例要求

PATCH https://management.azure.com/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/Microsoft.Insights/logprofiles/Rac46PostSwapRG?api-version=2016-03-01

{
  "tags": {
    "key1": "value1"
  },
  "properties": {
    "locations": [
      "global"
    ],
    "categories": [
      "Write",
      "Delete",
      "Action"
    ],
    "retentionPolicy": {
      "enabled": true,
      "days": 3
    },
    "storageAccountId": "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
    "serviceBusRuleId": ""
  }
}

範例回覆

{
  "id": "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/microsoft.insights/logprofiles/default",
  "type": "",
  "name": "default",
  "location": "",
  "tags": {
    "key1": "value1"
  },
  "properties": {
    "storageAccountId": "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
    "serviceBusRuleId": "",
    "locations": [
      "global"
    ],
    "categories": [
      "Delete",
      "Write",
      "Action"
    ],
    "retentionPolicy": {
      "enabled": true,
      "days": 3
    }
  }
}

定義

名稱 Description
ErrorResponse

描述錯誤回應的格式。

LogProfileResource

記錄檔配置檔資源。

LogProfileResourcePatch

修補作業的記錄檔配置檔資源。

RetentionPolicy

指定記錄檔的保留原則。

ErrorResponse

描述錯誤回應的格式。

名稱 類型 Description
code

string

錯誤碼

message

string

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

LogProfileResource

記錄檔配置檔資源。

名稱 類型 Description
id

string

Azure 資源標識碼

location

string

資源位置

name

string

Azure 資源名稱

properties.categories

string[]

記錄的類別。 這些類別會建立為使用者方便使用。 某些值包括:『Write』、『Delete』和/或 'Action'。

properties.locations

string[]

應儲存或串流活動記錄事件的區域清單。 它是有效 ARM 位置的逗號分隔清單,包括 「全域」位置。

properties.retentionPolicy

RetentionPolicy

記錄中事件的保留原則。

properties.serviceBusRuleId

string

您想要在其中建立事件中樞以串流活動記錄之服務總線命名空間的服務總線規則標識碼。 規則標識碼的格式為:『{服務總線資源標識符}/authorizationrules/{key name}』。

properties.storageAccountId

string

您想要傳送活動記錄之記憶體帳戶的資源識別碼。

tags

object

資源標籤

type

string

Azure 資源類型

LogProfileResourcePatch

修補作業的記錄檔配置檔資源。

名稱 類型 Description
properties.categories

string[]

記錄的類別。 這些類別會建立為使用者方便使用。 某些值包括:『Write』、『Delete』和/或 'Action'。

properties.locations

string[]

應儲存或串流活動記錄事件的區域清單。 它是有效 ARM 位置的逗號分隔清單,包括 「全域」位置。

properties.retentionPolicy

RetentionPolicy

記錄中事件的保留原則。

properties.serviceBusRuleId

string

您想要在其中建立事件中樞以串流活動記錄之服務總線命名空間的服務總線規則標識碼。 規則標識碼的格式為:『{服務總線資源標識符}/authorizationrules/{key name}』。

properties.storageAccountId

string

您想要傳送活動記錄之記憶體帳戶的資源識別碼。

tags

object

資源標籤

RetentionPolicy

指定記錄檔的保留原則。

名稱 類型 Description
days

integer (int32)

minimum: 0

保留天數。 值為 0 會無限期地保留事件。

enabled

boolean

值,指出是否啟用保留原則。