Tables - Create Or Update
更新或建立 Log Analytics 工作區資料表。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}?api-version=2026-03-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
|
subscription
|
path | True |
string (uuid) |
目標訂用帳戶的標識碼。 此值必須是 UUID。 |
|
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.protectionLevel |
桌子的防護等級。 決定預設的資料存取隔離行為。 |
|
| 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 |
資源「Table」更新操作成功 |
|
| 202 Accepted |
已接受資源作業。 標題
|
|
| Other Status Codes |
未預期的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
類型:
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-000000000000/resourceGroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/AzureNetworkFlow?api-version=2026-03-01
{
"properties": {
"schema": {
"name": "AzureNetworkFlow",
"columns": [
{
"name": "MyNewColumn",
"type": "guid"
}
]
},
"retentionInDays": 45,
"totalRetentionInDays": 70
}
}
範例回覆
{
"name": "AzureNetworkFlow",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/AzureNetworkFlow",
"properties": {
"schema": {
"name": "AzureNetworkFlow",
"columns": [
{
"name": "MyNewColumn",
"type": "guid",
"isDefaultDisplay": false,
"isHidden": false
}
],
"solutions": [
"LogManagement"
],
"standardColumns": [
{
"name": "TenantId",
"type": "guid",
"isDefaultDisplay": false,
"isHidden": true
},
{
"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,
"isHidden": false
}
],
"tableSubType": "DataCollectionRuleBased",
"tableType": "Microsoft"
},
"archiveRetentionInDays": 25,
"plan": "Analytics",
"provisioningState": "Succeeded",
"retentionInDays": 45,
"retentionInDaysAsDefault": false,
"totalRetentionInDays": 70,
"totalRetentionInDaysAsDefault": false
}
}
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/oiautorest6685/providers/Microsoft.OperaitonalInsights/workspaces/oiautorest6685/tables/table1_CL/operationresults/62e4d893-d233-4005-988e-a428d9f77076?api-version=2026-03-01
azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.OperaitonalInsights/locations/eastus/operationstatuses/62e4d893-d233-4005-988e-a428d9f77076?api-version=2026-03-01
定義
| 名稱 | Description |
|---|---|
| Column |
數據表數據行。 |
|
Column |
數據行數據類型邏輯提示。 |
|
Column |
數據行數據類型。 |
|
created |
建立此資源的身分識別類型。 |
|
Error |
資源管理錯誤其他資訊。 |
|
Error |
錯誤詳細資料。 |
|
Error |
錯誤回應 |
|
Operational |
資料表目前的佈建狀態。 如果設定為「更新中」,則表示由於進行中的作業而導致資源鎖定,禁止對資料表進行任何更新,直到進行中的作業結束為止。 |
|
Restored |
還原參數。 |
|
Result |
搜尋作業執行統計數據。 |
| Schema |
數據表的架構。 |
|
Search |
起始此數據表之搜尋作業的參數。 |
|
Source |
桌子的創建者。 |
|
system |
與建立和上次修改資源相關的元數據。 |
| Table |
工作區數據表定義。 |
|
Table |
指示系統如何處理並收取內嵌至此數據表的記錄費用。 |
|
Table |
桌子的防護等級。 決定預設的資料存取隔離行為。 |
|
Table |
子類型說明哪些 API 可用來與表格互動,以及針對表格可用的特性。 |
|
Table |
桌子的創建者。 |
Column
數據表數據行。
| 名稱 | 類型 | Description |
|---|---|---|
| dataTypeHint |
數據行數據類型邏輯提示。 |
|
| description |
string |
數據列描述。 |
| displayName |
string |
數據行顯示名稱。 可在創建時設定;建立後,更新必須與欄位名稱相符,或設定為 null/empty。 若未提供,則預設為欄位名稱。 |
| 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 |
標準 128 位 GUID,遵循標準圖形 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxx |
| armPath |
Azure 資源模型 (ARM) 路徑:/subscriptions/{...}/resourceGroups/{...}/providers/Microsoft。{...}/{...}/{...}/{...}... |
| ip |
標準 V4/V6 ip 位址,遵循標準圖形 x.x.x.x/y:y:y |
| vector16 |
一組用於語意/相似度搜尋的單精度浮點數向量。 |
ColumnTypeEnum
數據行數據類型。
| 值 | Description |
|---|---|
| string |
字串 |
| int |
int |
| long |
long |
| real |
real |
| boolean |
布林值 |
| dateTime |
dateTime |
| guid |
guid |
| dynamic |
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 |
錯誤物件。 |
OperationalInsightsTableProvisioningState
資料表目前的佈建狀態。 如果設定為「更新中」,則表示由於進行中的作業而導致資源鎖定,禁止對資料表進行任何更新,直到進行中的作業結束為止。
| 值 | 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 (float) |
搜尋作業完成百分比。 |
| scannedGb |
number (float) |
搜尋作業:掃描的數據量。 |
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 (arm-id) |
資源的完整資源標識碼。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| name |
string |
資源的名稱 |
| properties.archiveRetentionInDays |
integer (int32) |
這些表格的長期保留率(以天為單位)。 計算方式為 (totalRetentionInDays-retentionInDays)。 |
| properties.lastPlanModifiedDate |
string |
上次修改數據表計劃的時間戳(UTC)。 |
| properties.plan |
指示系統如何處理並收取內嵌至此數據表的記錄費用。 |
|
| properties.protectionLevel |
桌子的防護等級。 決定預設的資料存取隔離行為。 |
|
| 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 |
包含 createdBy 和 modifiedBy 資訊的 Azure Resource Manager 元數據。 |
|
| type |
string |
資源的類型。 例如:「Microsoft.Compute/virtualMachines」或「Microsoft.Storage/storageAccounts」 |
TablePlanEnum
指示系統如何處理並收取內嵌至此數據表的記錄費用。
| 值 | Description |
|---|---|
| Basic |
疑難排解和事件回應所需的中等接觸記錄。 |
| Analytics |
用於持續監控、即時偵測和效能分析的高價值日誌。 |
| Auxiliary |
低接觸記錄,例如詳細記錄,以及稽核和合規所需的資料。 |
TableProtectionLevelEnum
桌子的防護等級。 決定預設的資料存取隔離行為。
| 值 | Description |
|---|---|
| General |
預設的保護等級。 資料表資料可透過標準權限存取。 |
| Protected |
表格資料預設是隔離的。 存取或匯出資料需要明確且有範圍的授權。 |
TableSubTypeEnum
子類型說明哪些 API 可用來與表格互動,以及針對表格可用的特性。
| 值 | Description |
|---|---|
| Any |
建立內建數據表的預設子類型。 |
| Classic |
指出透過數據收集器 API 或 MMA 代理程式的自訂記錄功能所建立的數據表,或建立自定義欄位的任何資料表。 |
| DataCollectionRuleBased |
數據表,可透過資料收集規則所支援的任何方式傳送數據:數據收集端點 API、擷取時間轉換,或數據收集規則所提供的任何其他機制 |
TableTypeEnum
桌子的創建者。
| 值 | Description |
|---|---|
| Microsoft |
Azure 監視器所收集的標準數據。 |
| CustomLog |
自訂記錄數據表。 |
| RestoredLogs |
還原的數據。 |
| SearchResults |
搜尋作業收集的數據。 |