你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Workspaces - Create Or Update
创建或更新工作区。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}?api-version=2025-02-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 名称不区分大小写。 |
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
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 版本。 |
请求正文
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
location | True |
string |
资源所在的地理位置 |
etag |
string |
工作区的 etag。 |
|
identity |
资源的标识。 |
||
properties.defaultDataCollectionRuleResourceId |
string |
要用于此工作区的默认数据收集规则的资源 ID。 预期格式为 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}。 |
|
properties.failover |
工作区故障转移属性。 |
||
properties.features |
工作区功能。 |
||
properties.forceCmkForQuery |
boolean |
指示客户托管存储是否强制进行查询管理。 |
|
properties.publicNetworkAccessForIngestion |
用于访问 Log Analytics 引入的网络访问类型。 |
||
properties.publicNetworkAccessForQuery |
用于访问 Log Analytics 查询的网络访问类型。 |
||
properties.replication |
工作区复制属性。 |
||
properties.retentionInDays |
integer (int32) |
工作区数据保留期(以天为单位)。 允许的值按定价计划进行。 有关详细信息,请参阅定价层文档。 |
|
properties.sku |
工作区的 SKU。 |
||
properties.workspaceCapping |
引入的每日量上限。 |
||
tags |
object |
资源标记。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
确定响应定义。 |
|
201 Created |
已创建响应定义。 |
|
202 Accepted |
接受 |
|
Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
WorkspacesCreate
示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685?api-version=2025-02-01
{
"properties": {
"sku": {
"name": "PerGB2018"
},
"retentionInDays": 30
},
"location": "australiasoutheast",
"tags": {
"tag1": "val1"
}
}
示例响应
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6685/providers/microsoft.operationalinsights/workspaces/aztest2170",
"name": "AzTest2170",
"type": "Microsoft.OperationalInsights/workspaces",
"location": "australiasoutheast",
"tags": {
"tag1": "val1"
},
"properties": {
"customerId": "bc089d7b-485c-4aff-a71e-c00f362d8d2f",
"provisioningState": "Creating",
"sku": {
"name": "PerGB2018"
},
"retentionInDays": 30,
"publicNetworkAccessForQuery": "Enabled",
"publicNetworkAccessForIngestion": "Enabled"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6685/providers/microsoft.operationalinsights/workspaces/aztest2170",
"name": "AzTest2170",
"type": "Microsoft.OperationalInsights/workspaces",
"location": "australiasoutheast",
"tags": {
"tag1": "val1"
},
"properties": {
"customerId": "bc089d7b-485c-4aff-a71e-c00f362d8d2f",
"provisioningState": "Creating",
"sku": {
"name": "PerGB2018"
},
"retentionInDays": 30,
"publicNetworkAccessForQuery": "Enabled",
"publicNetworkAccessForIngestion": "Enabled"
}
}
定义
名称 | 说明 |
---|---|
Capacity |
选择 CapacityReservation sku 时,此工作区的容量预留级别为 GB。 |
created |
创建资源的标识的类型。 |
Data |
此工作区的数据引入状态。 |
Error |
资源管理错误附加信息。 |
Error |
错误详细信息。 |
Error |
错误响应 |
Identity |
资源的标识。 |
Identity |
托管服务标识的类型。 |
Private |
专用链接范围资源参考。 |
Public |
用于在 Log Analytics 工作区上运行的网络访问类型。 默认情况下,它处于启用状态 |
system |
与创建和上次修改资源相关的元数据。 |
User |
用户分配的标识属性。 |
Workspace |
顶级工作区资源容器。 |
Workspace |
引入的每日量上限。 |
Workspace |
工作区的预配状态。 |
Workspace |
复制的故障转移状态。 |
Workspace |
复制的故障转移状态。 |
Workspace |
工作区功能。 |
Workspace |
工作区复制属性。 |
Workspace |
复制的预配状态。 |
Workspace |
工作区的 SKU(层)。 |
Workspace |
SKU 的名称。 |
CapacityReservationLevel
选择 CapacityReservation sku 时,此工作区的容量预留级别为 GB。
值 | 说明 |
---|---|
100 | |
1000 | |
10000 | |
200 | |
2000 | |
25000 | |
300 | |
400 | |
500 | |
5000 | |
50000 |
createdByType
创建资源的标识的类型。
值 | 说明 |
---|---|
Application | |
Key | |
ManagedIdentity | |
User |
DataIngestionStatus
此工作区的数据引入状态。
值 | 说明 |
---|---|
ApproachingQuota |
达到每日上限配额的 80%。 |
ForceOff |
引入停止了以下服务设置更改。 |
ForceOn |
引入开始遵循服务设置更改。 |
OverQuota |
达到每日上限配额,引入已停止。 |
RespectQuota |
在每日上限配额重置或订阅启用后启用引入。 |
SubscriptionSuspended |
引入在暂停订阅后停止。 |
ErrorAdditionalInfo
资源管理错误附加信息。
名称 | 类型 | 说明 |
---|---|---|
info |
object |
其他信息。 |
type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
名称 | 类型 | 说明 |
---|---|---|
additionalInfo |
错误附加信息。 |
|
code |
string |
错误代码。 |
details |
错误详细信息。 |
|
message |
string |
错误消息。 |
target |
string |
错误目标。 |
ErrorResponse
错误响应
名称 | 类型 | 说明 |
---|---|---|
error |
错误对象。 |
Identity
资源的标识。
名称 | 类型 | 说明 |
---|---|---|
principalId |
string |
资源标识的主体 ID。 |
tenantId |
string |
资源的租户 ID。 |
type |
托管服务标识的类型。 |
|
userAssignedIdentities |
<string,
User |
与资源关联的用户标识列表。 用户标识字典密钥引用的格式为 ARM 资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 |
IdentityType
托管服务标识的类型。
值 | 说明 |
---|---|
None | |
SystemAssigned | |
UserAssigned |
PrivateLinkScopedResource
专用链接范围资源参考。
名称 | 类型 | 说明 |
---|---|---|
resourceId |
string |
专用链接范围资源的完整资源 ID。 |
scopeId |
string |
专用链接范围唯一标识符。 |
PublicNetworkAccessType
用于在 Log Analytics 工作区上运行的网络访问类型。 默认情况下,它处于启用状态
值 | 说明 |
---|---|
Disabled |
通过公共 DNS 禁用与 Log Analytics 的公共连接。 |
Enabled |
允许通过公共 DNS 连接到 Log Analytics。 |
systemData
与创建和上次修改资源相关的元数据。
名称 | 类型 | 说明 |
---|---|---|
createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
createdBy |
string |
创建资源的标识。 |
createdByType |
创建资源的标识的类型。 |
|
lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
lastModifiedBy |
string |
上次修改资源的标识。 |
lastModifiedByType |
上次修改资源的标识的类型。 |
UserIdentityProperties
用户分配的标识属性。
名称 | 类型 | 说明 |
---|---|---|
clientId |
string |
用户分配标识的客户端 ID。 |
principalId |
string |
用户分配标识的主体 ID。 |
Workspace
顶级工作区资源容器。
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
etag |
string |
工作区的 etag。 |
|
id |
string |
资源的完全限定资源 ID。 Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
|
identity |
资源的标识。 |
||
location |
string |
资源所在的地理位置 |
|
name |
string |
资源的名称 |
|
properties.createdDate |
string (date-time) |
工作区创建日期。 |
|
properties.customerId |
string |
这是一个只读属性。 表示与工作区关联的 ID。 |
|
properties.defaultDataCollectionRuleResourceId |
string |
要用于此工作区的默认数据收集规则的资源 ID。 预期格式为 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}。 |
|
properties.failover |
工作区故障转移属性。 |
||
properties.features |
工作区功能。 |
||
properties.forceCmkForQuery |
boolean |
指示客户托管存储是否强制进行查询管理。 |
|
properties.modifiedDate |
string (date-time) |
工作区修改日期。 |
|
properties.privateLinkScopedResources |
链接的专用链接范围资源列表。 |
||
properties.provisioningState |
工作区的预配状态。 |
||
properties.publicNetworkAccessForIngestion | Enabled |
用于访问 Log Analytics 引入的网络访问类型。 |
|
properties.publicNetworkAccessForQuery | Enabled |
用于访问 Log Analytics 查询的网络访问类型。 |
|
properties.replication |
工作区复制属性。 |
||
properties.retentionInDays |
integer (int32) |
工作区数据保留期(以天为单位)。 允许的值按定价计划进行。 有关详细信息,请参阅定价层文档。 |
|
properties.sku |
工作区的 SKU。 |
||
properties.workspaceCapping |
引入的每日量上限。 |
||
systemData |
与创建和上次修改资源相关的元数据。 |
||
tags |
object |
资源标记。 |
|
type |
string |
资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
WorkspaceCapping
引入的每日量上限。
名称 | 类型 | 说明 |
---|---|---|
dailyQuotaGb |
number (double) |
引入的工作区每日配额。 |
dataIngestionStatus |
此工作区的数据引入状态。 |
|
quotaNextResetTime |
string |
配额将休息的时间。 |
WorkspaceEntityStatus
工作区的预配状态。
值 | 说明 |
---|---|
Canceled | |
Creating | |
Deleting | |
Failed | |
ProvisioningAccount | |
Succeeded | |
Updating |
WorkspaceFailoverProperties
复制的故障转移状态。
名称 | 类型 | 说明 |
---|---|---|
lastModifiedDate |
string (date-time) |
上次更新故障转移状态的时间。 |
state |
复制的故障转移状态。 |
WorkspaceFailoverState
复制的故障转移状态。
值 | 说明 |
---|---|
Activating | |
Active | |
Deactivating | |
Failed | |
Inactive |
WorkspaceFeatures
工作区功能。
名称 | 类型 | 说明 |
---|---|---|
clusterResourceId |
string |
链接到工作区的专用 LA 群集 resourceId。 |
disableLocalAuth |
boolean |
禁用基于非 AAD 的身份验证。 |
enableDataExport |
boolean |
指示是否应导出数据的标志。 |
enableLogAccessUsingOnlyResourcePermissions |
boolean |
指示使用哪个权限的标志 - 资源或工作区或两者。 |
immediatePurgeDataOn30Days |
boolean |
描述是否要在 30 天后删除数据的标志。 |
unifiedSentinelBillingOnly |
boolean |
指示指定工作区是否仅限于 sentinel 的统一计费模型。 |
WorkspaceReplicationProperties
工作区复制属性。
名称 | 类型 | 说明 |
---|---|---|
createdDate |
string (date-time) |
上次启用复制的时间。 |
enabled |
boolean |
指定是否启用复制。 如果为 true,工作区配置和数据将复制到指定位置。 如果已启用复制,则必须提供位置。 |
lastModifiedDate |
string (date-time) |
上次更新复制的时间。 |
location |
string |
复制的位置。 |
provisioningState |
复制的预配状态。 |
WorkspaceReplicationState
复制的预配状态。
值 | 说明 |
---|---|
Canceled | |
DisableRequested | |
Disabling | |
EnableRequested | |
Enabling | |
Failed | |
RollbackRequested | |
RollingBack | |
Succeeded |
WorkspaceSku
工作区的 SKU(层)。
名称 | 类型 | 说明 |
---|---|---|
capacityReservationLevel |
Capacity |
选择 CapacityReservation sku 时,此工作区的容量预留级别为 GB。 |
lastSkuUpdate |
string (date-time) |
上次更新 SKU 的时间。 |
name |
SKU 的名称。 |
WorkspaceSkuNameEnum
SKU 的名称。
值 | 说明 |
---|---|
CapacityReservation | |
Free | |
LACluster | |
PerGB2018 | |
PerNode | |
Premium | |
Standalone | |
Standard |