共用方式為


Log Profiles - Create Or Update

在 Azure 監視 REST API 中建立或更新記錄配置檔。

PUT 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

目標訂用帳戶的標識碼。

api-version
query True

string

用於此作業的 API 版本。

要求本文

名稱 必要 類型 Description
location True

string

資源位置

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

成功建立或更新記錄檔配置檔的要求

安全性

azure_auth

Azure Active Directory OAuth2 Flow

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

範圍

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

範例

Create or update a log profile

範例要求

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

{
  "location": "",
  "tags": {},
  "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": null,
  "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
LogProfileResource

記錄檔配置檔資源。

RetentionPolicy

指定記錄檔的保留原則。

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 資源類型

RetentionPolicy

指定記錄檔的保留原則。

名稱 類型 Description
days

integer

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

enabled

boolean

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