你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。

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 参数

名称 在 必需 类型 说明
resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 此名称不区分大小写。

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

tableName
path True

string

minLength: 4
maxLength: 63
pattern: ^[A-Za-z0-9-_]+$

表的名称。

workspaceName
path True

string

minLength: 4
maxLength: 63
pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$

工作区的名称。

api-version
query True

string

minLength: 1

用于此操作的 API 版本。

请求正文

名称 类型 说明
properties.plan

TablePlanEnum

指示系统如何处理和收费引入到此表的日志。

properties.protectionLevel

TableProtectionLevelEnum

桌子的防护等级。 确定默认的数据访问隔离行为。

properties.restoredLogs

RestoredLogs

启动此表的还原作的参数。

properties.retentionInDays

integer (int32)

minimum: 4
maximum: 730

在分析表中:表中的分析保留期(以天为单位),介于 4 到 730 之间。 将此属性设置为 -1 默认为工作区保留期。 在基本表和辅助表中:只读属性。

properties.schema

Schema

表架构。

properties.searchResults

SearchResults

启动此表的搜索作业的参数。

properties.totalRetentionInDays

integer (int32)

minimum: 4
maximum: 4383

表总保留期(以天为单位,介于 4 到 4383 之间)。 将此属性设置为 -1 将默认为 retentionInDays。

响应

名称 类型 说明
200 OK

Table

资源“表”更新作成功

202 Accepted

已接受资源作。

标头

  • Azure-AsyncOperation: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

未预期的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流程。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
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

定义

名称 说明
Column

表列。

ColumnDataTypeHintEnum

列数据类型逻辑提示。

ColumnTypeEnum

列数据类型。

createdByType

创建该资源的身份类型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详情

ErrorResponse

错误响应

OperationalInsightsTableProvisioningState

表的当前预配状态。 如果设置为“updateing”,则表示由于正在进行的作而导致的资源锁,禁止对表进行任何更新,直到正在进行的作结束。

RestoredLogs

还原参数。

ResultStatistics

搜索作业执行统计信息。

Schema

表的架构。

SearchResults

启动此表的搜索作业的参数。

SourceEnum

表的创建者。

systemData

与创建和上次修改资源相关的元数据。

Table

工作区数据表定义。

TablePlanEnum

指示系统如何处理和收费引入到此表的日志。

TableProtectionLevelEnum

桌子的防护等级。 确定默认的数据访问隔离行为。

TableSubTypeEnum

子类型描述了哪些 API 可用于与表交互,以及可用于表的功能。

TableTypeEnum

表的创建者。

Column

表列。

名称 类型 说明
dataTypeHint

ColumnDataTypeHintEnum

列数据类型逻辑提示。

description

string

列说明。

displayName

string

列显示名称。 可在创建时设置;创建后,更新必须匹配列名或设置为空/空。 如果未提供,则默认为列名。

isDefaultDisplay

boolean

默认显示。

isHidden

boolean

是否隐藏列。

name

string

列名称。

type

ColumnTypeEnum

列数据类型。

ColumnDataTypeHintEnum

列数据类型逻辑提示。

值 说明
uri

与 URI 模式匹配的字符串,例如,scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment

guid

标准形状 xxxxxxxx-xxxx-xxxx-xxxxxx 后的标准 128 位 GUID

armPath

Azure 资源模型 (ARM) 路径:/subscriptions/{...}/resourceGroups/{...}/providers/Microsoft。{...}/{...}/{...}/{...}...

ip

标准形状 x.x.x.x.x/y:y:y:y:

vector16

一种用于语义/相似性搜索的单精度浮点向量。

ColumnTypeEnum

列数据类型。

值 说明
string

字符串

int

int

long

long

real

real

boolean

布尔

dateTime

日期时间

guid

guid

dynamic

动态

createdByType

创建该资源的身份类型。

值 说明
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

附加信息。

type

string

其他信息类型。

ErrorDetail

错误详情

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误的附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详情。

message

string

错误消息。

target

string

错误的目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

OperationalInsightsTableProvisioningState

表的当前预配状态。 如果设置为“updateing”,则表示由于正在进行的作而导致的资源锁,禁止对表进行任何更新,直到正在进行的作结束。

值 说明
Updating

表架构仍在生成和更新中,表当前已锁定进行任何更改,直到完成该过程。

InProgress

表模式稳定,没有更改,表数据正在更新。

Succeeded

表状态稳定且没有更改,表已解锁并打开以供新更新使用。

Deleting

表状态正在删除。

RestoredLogs

还原参数。

名称 类型 说明
azureAsyncOperationId

string

搜索结果表异步作 ID。

endRestoreTime

string (date-time)

结束还原的时间戳(UTC)。

sourceTable

string

要从中还原数据的表。

startRestoreTime

string (date-time)

从 (UTC) 开始还原的时间戳。

ResultStatistics

搜索作业执行统计信息。

名称 类型 说明
ingestedRecords

integer (int32)

搜索作业返回的行数。

progress

number (float)

搜索作业完成百分比。

scannedGb

number (float)

搜索作业:扫描的数据量。

Schema

表的架构。

名称 类型 说明
categories

string[]

表类别。

columns

Column[]

表自定义列的列表。

description

string

表说明。

displayName

string

表显示名称。

labels

string[]

表标签。

name

string

表名。

solutions

string[]

该表所属的解决方案列表

source

SourceEnum

表的创建者。

standardColumns

Column[]

表标准列的列表。

tableSubType

TableSubTypeEnum

子类型描述了哪些 API 可用于与表交互,以及可用于表的功能。

tableType

TableTypeEnum

表的创建者。

SearchResults

启动此表的搜索作业的参数。

名称 类型 说明
azureAsyncOperationId

string

搜索结果表异步作 ID。

description

string

搜索作业说明。

endSearchTime

string (date-time)

按 UTC 结束搜索的时间戳

limit

integer (int32)

将搜索作业限制为最多返回指定行数。

query

string

搜索作业查询。

sourceTable

string

搜索作业中使用的表。

startSearchTime

string (date-time)

从 (UTC) 开始搜索的时间戳

SourceEnum

表的创建者。

值 说明
microsoft

由系统预配的表,通过诊断设置、代理或任何其他标准数据收集方式收集。

customer

由工作区所有者创建的表,并且仅在此工作区中找到。

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建该资源的身份。

createdByType

createdByType

创建该资源的身份类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

Table

工作区数据表定义。

名称 类型 说明
id

string (arm-id)

该资源的完全限定资源 ID。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

name

string

资源的名称

properties.archiveRetentionInDays

integer (int32)

表的长期保留期(以天为单位)。 计算公式为 (totalRetentionInDays-retentionInDays)。

properties.lastPlanModifiedDate

string

上次修改表计划的时间戳(UTC)。

properties.plan

TablePlanEnum

指示系统如何处理和收费引入到此表的日志。

properties.protectionLevel

TableProtectionLevelEnum

桌子的防护等级。 确定默认的数据访问隔离行为。

properties.provisioningState

OperationalInsightsTableProvisioningState

表的当前预配状态。 如果设置为“updateing”,则表示由于正在进行的作而导致的资源锁,禁止对表进行任何更新,直到正在进行的作结束。

properties.restoredLogs

RestoredLogs

启动此表的还原作的参数。

properties.resultStatistics

ResultStatistics

搜索作业执行统计信息。

properties.retentionInDays

integer (int32)

minimum: 4
maximum: 730

在分析表中:表中的分析保留期(以天为单位),介于 4 到 730 之间。 将此属性设置为 -1 默认为工作区保留期。 在基本表和辅助表中:只读属性。

properties.retentionInDaysAsDefault

boolean

True - 值源自工作区保留天数,False - 特定于客户。

properties.schema

Schema

表架构。

properties.searchResults

SearchResults

启动此表的搜索作业的参数。

properties.totalRetentionInDays

integer (int32)

minimum: 4
maximum: 4383

表总保留期(以天为单位,介于 4 到 4383 之间)。 将此属性设置为 -1 将默认为 retentionInDays。

properties.totalRetentionInDaysAsDefault

boolean

True - 值源自天数的保留期,False - 特定于客户。

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

TablePlanEnum

指示系统如何处理和收费引入到此表的日志。

值 说明
Basic

故障排除和事件响应所需的中接触日志。

Analytics

用于持续监控、实时检测和性能分析的高价值日志。

Auxiliary

低接触日志,例如详细日志,以及审核和合规性所需的数据。

TableProtectionLevelEnum

桌子的防护等级。 确定默认的数据访问隔离行为。

值 说明
General

默认的保护等级。 表数据可通过标准权限访问。

Protected

表数据默认是隔离的。 访问或导出数据需要明确且有范围的授权。

TableSubTypeEnum

子类型描述了哪些 API 可用于与表交互,以及可用于表的功能。

值 说明
Any

创建内置表的默认子类型。

Classic

指示通过数据收集器 API 或 MMA 代理的自定义日志功能或为其创建自定义字段的任何表创建的表。

DataCollectionRuleBased

符合通过数据收集规则支持的任何手段将数据发送到其中的条件的表:数据收集终结点 API、引入时间转换或数据收集规则提供的任何其他机制

TableTypeEnum

表的创建者。

值 说明
Microsoft

Azure Monitor 收集的标准数据。

CustomLog

自定义日志表。

RestoredLogs

还原的数据。

SearchResults

搜索作业收集的数据。