Tables - Create Or Update
更新或建立 Log Analytics 工作區資料表。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}?api-version=2025-07-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
|
subscription
|
path | True |
string minLength: 1 |
目標訂用帳戶的標識碼。 |
|
table
|
path | True |
string minLength: 4maxLength: 63 pattern: ^[A-Za-z0-9-_]+$ |
數據表的名稱。 |
|
workspace
|
path | True |
string minLength: 4maxLength: 63 pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$ |
工作區的名稱。 |
|
api-version
|
query | True |
string minLength: 1 |
用於此作業的 API 版本。 |
要求本文
| 名稱 | 類型 | Description |
|---|---|---|
| properties.plan |
指示系統如何處理並收取內嵌至此數據表的記錄費用。 |
|
| properties.restoredLogs |
起始此數據表之還原作業的參數。 |
|
| properties.retentionInDays |
integer (int32) minimum: 4maximum: 730 |
在分析表格中:表格分析保留天數,介於 4 到 730 之間。 將此屬性設定為 -1 預設為工作區保留期。 在基本和輔助表格中:唯讀屬性。 |
| properties.schema |
數據表架構。 |
|
| properties.searchResults |
起始此數據表之搜尋作業的參數。 |
|
| properties.totalRetentionInDays |
integer (int32) minimum: 4maximum: 4383 |
數據表總保留天數,介於 4 到 4383 之間。 將此屬性設定為 -1 會預設為 retentionInDays。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
確定回應定義。 |
|
| 202 Accepted |
接受的回應定義 (長時間執行作業)。 |
|
| Other Status Codes |
描述作業失敗原因的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 | Description |
|---|---|
| user_impersonation | 模擬您的用戶帳戶 |
範例
TablesUpsert
範例要求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/AzureNetworkFlow?api-version=2025-07-01
{
"properties": {
"schema": {
"name": "AzureNetworkFlow",
"columns": [
{
"name": "MyNewColumn",
"type": "guid"
}
]
},
"retentionInDays": 45,
"totalRetentionInDays": 70
}
}
範例回覆
{
"properties": {
"schema": {
"name": "AzureNetworkFlow",
"tableSubType": "DataCollectionRuleBased",
"tableType": "Microsoft",
"columns": [
{
"isHidden": false,
"name": "MyNewColumn",
"type": "guid",
"isDefaultDisplay": false
}
],
"standardColumns": [
{
"isHidden": true,
"name": "TenantId",
"type": "guid",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "SourceSystem",
"type": "string",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "TimeGenerated",
"type": "dateTime",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "AgentID",
"type": "string",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "SourceIP",
"type": "string",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "Protocol",
"type": "string",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "SourcePort",
"type": "int",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "DestinationPort",
"type": "int",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "TcpFlags",
"type": "int",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "Packets",
"type": "int",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "Bytes",
"type": "int",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "BytesOut",
"type": "int",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "DurationInMs",
"type": "int",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "RstCount",
"type": "int",
"isDefaultDisplay": false
},
{
"isHidden": false,
"name": "MaxSampleRtt",
"type": "int",
"isDefaultDisplay": false
}
],
"solutions": [
"LogManagement"
]
},
"provisioningState": "Succeeded",
"retentionInDays": 45,
"totalRetentionInDays": 70,
"archiveRetentionInDays": 25,
"retentionInDaysAsDefault": false,
"totalRetentionInDaysAsDefault": false,
"plan": "Analytics"
},
"id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/AzureNetworkFlow",
"name": "AzureNetworkFlow"
}
azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/providers/Microsoft.OperaitonalInsights/locations/eastus/operationstatuses/62e4d893-d233-4005-988e-a428d9f77076?api-version=2025-07-01
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/oiautorest6685/providers/Microsoft.OperaitonalInsights/workspaces/oiautorest6685/tables/table1_CL/operationresults/62e4d893-d233-4005-988e-a428d9f77076?api-version=2025-07-01
定義
| 名稱 | Description |
|---|---|
| Column |
表格欄。 |
|
Column |
數據行數據類型邏輯提示。 |
|
Column |
數據行數據類型。 |
|
created |
建立資源的身分識別類型。 |
|
Error |
資源管理錯誤其他資訊。 |
|
Error |
錯誤詳細數據。 |
|
Error |
錯誤回應 |
|
Provisioning |
資料表目前的佈建狀態。 如果設定為「更新中」,則表示由於進行中的作業而導致資源鎖定,禁止對資料表進行任何更新,直到進行中的作業結束為止。 |
|
Restored |
還原參數。 |
|
Result |
搜尋作業執行統計數據。 |
| Schema |
資料表的結構描述。 |
|
Search |
起始此數據表之搜尋作業的參數。 |
|
Source |
桌子的創建者。 |
|
system |
與建立和上次修改資源相關的元數據。 |
| Table |
工作區資料表定義。 |
|
Table |
指示系統如何處理並收取內嵌至此數據表的記錄費用。 |
|
Table |
子類型說明哪些 API 可用來與表格互動,以及針對表格可用的特性。 |
|
Table |
桌子的創建者。 |
Column
表格欄。
| 名稱 | 類型 | Description |
|---|---|---|
| dataTypeHint |
數據行數據類型邏輯提示。 |
|
| description |
string |
數據列描述。 |
| displayName |
string |
數據行顯示名稱。 |
| isDefaultDisplay |
boolean |
預設顯示。 |
| isHidden |
boolean |
是否隱藏欄。 |
| name |
string |
數據行名稱。 |
| type |
數據行數據類型。 |
ColumnDataTypeHintEnum
數據行數據類型邏輯提示。
| 值 | Description |
|---|---|
| uri |
符合 URI 型樣的字串,例如 scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment |
| guid |
遵循標準圖形 xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxx 的標準 128 位 GUID |
| armPath |
Azure 資源模型 (ARM) 路徑:/subscriptions/{...}/resourceGroups/{...}/providers/Microsoft 的。{...}/{...}/{...}/{...}... |
| ip |
遵循標準形狀的標準 V4/V6 IP 位址 x.x.x.x/y:y:y: |
ColumnTypeEnum
數據行數據類型。
| 值 | Description |
|---|---|
| string | |
| int | |
| long | |
| real | |
| boolean | |
| dateTime | |
| guid | |
| dynamic |
createdByType
建立資源的身分識別類型。
| 值 | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorAdditionalInfo
資源管理錯誤其他資訊。
| 名稱 | 類型 | Description |
|---|---|---|
| info |
object |
其他資訊。 |
| type |
string |
其他信息類型。 |
ErrorDetail
錯誤詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| additionalInfo |
錯誤其他資訊。 |
|
| code |
string |
錯誤碼。 |
| details |
錯誤詳細資料。 |
|
| message |
string |
錯誤訊息。 |
| target |
string |
錯誤目標。 |
ErrorResponse
錯誤回應
| 名稱 | 類型 | Description |
|---|---|---|
| error |
error 物件。 |
ProvisioningStateEnum
資料表目前的佈建狀態。 如果設定為「更新中」,則表示由於進行中的作業而導致資源鎖定,禁止對資料表進行任何更新,直到進行中的作業結束為止。
| 值 | Description |
|---|---|
| Updating |
表格結構描述仍在建置和更新中,表格目前已鎖定任何變更,直到程序完成為止。 |
| InProgress |
表格結構描述穩定且沒有變更,表格資料正在更新中。 |
| Succeeded |
表狀態穩定且沒有更改,表已解鎖並開放以進行新的更新。 |
| Deleting |
資料表狀態正在刪除。 |
RestoredLogs
還原參數。
| 名稱 | 類型 | Description |
|---|---|---|
| azureAsyncOperationId |
string |
搜尋結果資料表非同步作業識別碼。 |
| endRestoreTime |
string (date-time) |
以 (UTC) 結束還原的時間戳。 |
| sourceTable |
string |
要從中還原數據的數據表。 |
| startRestoreTime |
string (date-time) |
從 (UTC) 開始還原的時間戳。 |
ResultStatistics
搜尋作業執行統計數據。
| 名稱 | 類型 | Description |
|---|---|---|
| ingestedRecords |
integer (int32) |
搜尋工作傳回的列數。 |
| progress |
number multipleOf: 0.01 |
搜尋作業完成百分比。 |
| scannedGb |
number multipleOf: 0.01 |
搜尋工作:掃描的資料量。 |
Schema
資料表的結構描述。
| 名稱 | 類型 | Description |
|---|---|---|
| categories |
string[] |
表格類別。 |
| columns |
Column[] |
數據表自定義資料列的清單。 |
| description |
string |
數據表描述。 |
| displayName |
string |
數據表顯示名稱。 |
| labels |
string[] |
表格標籤。 |
| name |
string |
數據表名稱。 |
| solutions |
string[] |
表格所關聯的解決方案清單 |
| source |
桌子的創建者。 |
|
| standardColumns |
Column[] |
表格標準欄的清單。 |
| tableSubType |
子類型說明哪些 API 可用來與表格互動,以及針對表格可用的特性。 |
|
| tableType |
桌子的創建者。 |
SearchResults
起始此數據表之搜尋作業的參數。
| 名稱 | 類型 | Description |
|---|---|---|
| azureAsyncOperationId |
string |
搜尋結果資料表非同步作業識別碼。 |
| description |
string |
搜尋作業描述。 |
| endSearchTime |
string (date-time) |
結束搜尋的時間戳(UTC) |
| limit |
integer (int32) |
限制搜尋作業最多傳回指定的數據列數目。 |
| query |
string |
搜尋作業查詢。 |
| sourceTable |
string |
搜尋工作中使用的表格。 |
| startSearchTime |
string (date-time) |
從 (UTC) 開始搜尋的時間戳 |
SourceEnum
桌子的創建者。
| 值 | Description |
|---|---|
| microsoft |
由系統佈建的資料表,透過診斷設定、代理程式或任何其他標準資料收集方式收集。 |
| customer |
由工作區擁有者建立的資料表,且只能在此工作區中找到。 |
systemData
與建立和上次修改資源相關的元數據。
| 名稱 | 類型 | Description |
|---|---|---|
| createdAt |
string (date-time) |
資源建立的時間戳(UTC)。 |
| createdBy |
string |
建立資源的身分識別。 |
| createdByType |
建立資源的身分識別類型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的資源時間戳 (UTC) |
| lastModifiedBy |
string |
上次修改資源的身分識別。 |
| lastModifiedByType |
上次修改資源的身分識別類型。 |
Table
工作區資料表定義。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string |
資源的完整資源標識碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| name |
string |
資源的名稱 |
| properties.archiveRetentionInDays |
integer (int32) |
這些表格的長期保留率(以天為單位)。 計算方式為 (totalRetentionInDays-retentionInDays)。 |
| properties.lastPlanModifiedDate |
string |
資料表計劃上次修改的時間戳記 (UTC)。 |
| properties.plan |
指示系統如何處理並收取內嵌至此數據表的記錄費用。 |
|
| properties.provisioningState |
資料表目前的佈建狀態。 如果設定為「更新中」,則表示由於進行中的作業而導致資源鎖定,禁止對資料表進行任何更新,直到進行中的作業結束為止。 |
|
| properties.restoredLogs |
起始此數據表之還原作業的參數。 |
|
| properties.resultStatistics |
搜尋作業執行統計數據。 |
|
| properties.retentionInDays |
integer (int32) minimum: 4maximum: 730 |
在分析表格中:表格分析保留天數,介於 4 到 730 之間。 將此屬性設定為 -1 預設為工作區保留期。 在基本和輔助表格中:唯讀屬性。 |
| properties.retentionInDaysAsDefault |
boolean |
True - 值源自工作區保留天數,False - 客戶特定。 |
| properties.schema |
數據表架構。 |
|
| properties.searchResults |
起始此數據表之搜尋作業的參數。 |
|
| properties.totalRetentionInDays |
integer (int32) minimum: 4maximum: 4383 |
數據表總保留天數,介於 4 到 4383 之間。 將此屬性設定為 -1 會預設為 retentionInDays。 |
| properties.totalRetentionInDaysAsDefault |
boolean |
True - 值源自以天為單位的保留,False - 客戶特定。 |
| systemData |
與建立和上次修改資源相關的元數據。 |
|
| type |
string |
資源的類型。 例如「Microsoft.Compute/virtualMachines」或「Microsoft.Storage/storageAccounts」 |
TablePlanEnum
指示系統如何處理並收取內嵌至此數據表的記錄費用。
| 值 | Description |
|---|---|
| Basic |
疑難排解和事件回應所需的中等接觸記錄。 |
| Analytics |
用於持續監控、即時偵測和效能分析的高價值日誌。 |
| Auxiliary |
低接觸記錄,例如詳細記錄,以及稽核和合規所需的資料。 |
TableSubTypeEnum
子類型說明哪些 API 可用來與表格互動,以及針對表格可用的特性。
| 值 | Description |
|---|---|
| Any |
用於建立內建表格的預設子類型。 |
| Classic |
指出透過資料收集器 API 或使用 MMA 代理程式的自訂記錄功能建立的資料表,或建立自訂欄位的任何資料表。 |
| DataCollectionRuleBased |
符合資格透過資料收集規則支援的任何方式將資料傳送到其中的資料表:資料收集端點 API、擷取時間轉換或資料收集規則提供的任何其他機制 |
TableTypeEnum
桌子的創建者。
| 值 | Description |
|---|---|
| Microsoft |
Azure 監視器所收集的標準資料。 |
| CustomLog |
自訂記錄表。 |
| RestoredLogs |
恢復的數據。 |
| SearchResults |
搜尋工作所收集的資料。 |