Workspaces - Create Or Update
建立或更新工作區。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}?api-version=2025-02-01
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
subscription
|
path | True |
string minLength: 1 |
目標訂用帳戶的標識碼。 |
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 |
---|---|---|---|
location | True |
string |
資源所在的地理位置 |
etag |
string |
工作區的 etag。 |
|
identity |
資源的身分識別。 |
||
properties.defaultDataCollectionRuleResourceId |
string |
要用於此工作區之預設數據收集規則的資源識別碼。 預期的格式為 - /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 |
資源標籤。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
確定回應定義。 |
|
201 Created |
已建立回應定義。 |
|
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 | 模擬您的用戶帳戶 |
範例
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"
}
}
定義
名稱 | Description |
---|---|
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。
值 | Description |
---|---|
100 | |
1000 | |
10000 | |
200 | |
2000 | |
25000 | |
300 | |
400 | |
500 | |
5000 | |
50000 |
createdByType
建立資源的身分識別類型。
值 | Description |
---|---|
Application | |
Key | |
ManagedIdentity | |
User |
DataIngestionStatus
此工作區的數據擷取狀態。
值 | Description |
---|---|
ApproachingQuota |
達到每日上限配額的 80%。 |
ForceOff |
擷取已停止下列服務設定變更。 |
ForceOn |
擷取開始遵循服務設定變更。 |
OverQuota |
達到每日上限配額,擷取已停止。 |
RespectQuota |
在每日上限重設或訂用帳戶啟用之後啟用擷取。 |
SubscriptionSuspended |
擷取在暫停的訂用帳戶之後停止。 |
ErrorAdditionalInfo
資源管理錯誤其他資訊。
名稱 | 類型 | Description |
---|---|---|
info |
object |
其他資訊。 |
type |
string |
其他信息類型。 |
ErrorDetail
錯誤詳細數據。
名稱 | 類型 | Description |
---|---|---|
additionalInfo |
錯誤其他資訊。 |
|
code |
string |
錯誤碼。 |
details |
錯誤詳細數據。 |
|
message |
string |
錯誤訊息。 |
target |
string |
錯誤目標。 |
ErrorResponse
錯誤回應
名稱 | 類型 | Description |
---|---|---|
error |
error 物件。 |
Identity
資源的身分識別。
名稱 | 類型 | Description |
---|---|---|
principalId |
string |
資源識別的主要標識碼。 |
tenantId |
string |
資源的租用戶標識碼。 |
type |
受控服務識別的類型。 |
|
userAssignedIdentities |
<string,
User |
與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 |
IdentityType
受控服務識別的類型。
值 | Description |
---|---|
None | |
SystemAssigned | |
UserAssigned |
PrivateLinkScopedResource
私人鏈接範圍資源參考。
名稱 | 類型 | Description |
---|---|---|
resourceId |
string |
私人連結範圍資源的完整資源標識碼。 |
scopeId |
string |
私人連結範圍唯一標識碼。 |
PublicNetworkAccessType
在 Log Analytics 工作區上運作的網路存取類型。 預設為 [啟用]
值 | Description |
---|---|
Disabled |
透過公用 DNS 停用對 Log Analytics 的公用連線。 |
Enabled |
允許透過公用 DNS 連線到 Log Analytics。 |
systemData
與建立和上次修改資源相關的元數據。
名稱 | 類型 | Description |
---|---|---|
createdAt |
string (date-time) |
資源建立的時間戳(UTC)。 |
createdBy |
string |
建立資源的身分識別。 |
createdByType |
建立資源的身分識別類型。 |
|
lastModifiedAt |
string (date-time) |
上次修改的資源時間戳 (UTC) |
lastModifiedBy |
string |
上次修改資源的身分識別。 |
lastModifiedByType |
上次修改資源的身分識別類型。 |
UserIdentityProperties
使用者指派的身分識別屬性。
名稱 | 類型 | Description |
---|---|---|
clientId |
string |
使用者指派身分識別的用戶端標識碼。 |
principalId |
string |
使用者指派身分識別的主體標識碼。 |
Workspace
最上層的工作區資源容器。
名稱 | 類型 | 預設值 | Description |
---|---|---|---|
etag |
string |
工作區的 etag。 |
|
id |
string |
資源的完整資源標識碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
|
identity |
資源的身分識別。 |
||
location |
string |
資源所在的地理位置 |
|
name |
string |
資源的名稱 |
|
properties.createdDate |
string (date-time) |
工作區建立日期。 |
|
properties.customerId |
string |
這是唯讀屬性。 表示與工作區相關聯的標識碼。 |
|
properties.defaultDataCollectionRuleResourceId |
string |
要用於此工作區之預設數據收集規則的資源識別碼。 預期的格式為 - /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
擷取的每日磁碟區上限。
名稱 | 類型 | Description |
---|---|---|
dailyQuotaGb |
number (double) |
擷取的工作區每日配額。 |
dataIngestionStatus |
此工作區的數據擷取狀態。 |
|
quotaNextResetTime |
string |
配額將休息的時間。 |
WorkspaceEntityStatus
工作區的布建狀態。
值 | Description |
---|---|
Canceled | |
Creating | |
Deleting | |
Failed | |
ProvisioningAccount | |
Succeeded | |
Updating |
WorkspaceFailoverProperties
復寫的故障轉移狀態。
名稱 | 類型 | Description |
---|---|---|
lastModifiedDate |
string (date-time) |
上次更新故障轉移狀態的時間。 |
state |
復寫的故障轉移狀態。 |
WorkspaceFailoverState
復寫的故障轉移狀態。
值 | Description |
---|---|
Activating | |
Active | |
Deactivating | |
Failed | |
Inactive |
WorkspaceFeatures
工作區功能。
名稱 | 類型 | Description |
---|---|---|
clusterResourceId |
string |
連結至工作區的專用LA叢集 resourceId。 |
disableLocalAuth |
boolean |
停用非 AAD 型驗證。 |
enableDataExport |
boolean |
旗標,指出是否應該匯出數據。 |
enableLogAccessUsingOnlyResourcePermissions |
boolean |
旗標,指出要使用哪個許可權 - 資源或工作區或兩者。 |
immediatePurgeDataOn30Days |
boolean |
旗標,描述我們想要在 30 天后移除數據。 |
unifiedSentinelBillingOnly |
boolean |
指定工作區是否僅限於 sentinel 的統一計費模型。 |
WorkspaceReplicationProperties
工作區複寫屬性。
名稱 | 類型 | Description |
---|---|---|
createdDate |
string (date-time) |
上次啟用複寫的時間。 |
enabled |
boolean |
指定是否啟用複寫。 當為 true 時,工作區組態和數據會複寫至指定的位置。 如果已啟用複寫,則必須提供位置。 |
lastModifiedDate |
string (date-time) |
上次更新復寫的時間。 |
location |
string |
複寫的位置。 |
provisioningState |
複寫的布建狀態。 |
WorkspaceReplicationState
複寫的布建狀態。
值 | Description |
---|---|
Canceled | |
DisableRequested | |
Disabling | |
EnableRequested | |
Enabling | |
Failed | |
RollbackRequested | |
RollingBack | |
Succeeded |
WorkspaceSku
工作區的 SKU(層)。
名稱 | 類型 | Description |
---|---|---|
capacityReservationLevel |
Capacity |
選取 CapacityReservation sku 時,此工作區的容量保留層級為 GB。 |
lastSkuUpdate |
string (date-time) |
上次更新 SKU 的時間。 |
name |
SKU 的名稱。 |
WorkspaceSkuNameEnum
SKU 的名稱。
值 | Description |
---|---|
CapacityReservation | |
Free | |
LACluster | |
PerGB2018 | |
PerNode | |
Premium | |
Standalone | |
Standard |