Workspaces - Create Or Update
建立或更新工作區。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}?api-version=2025-07-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
資源群組的名稱。 名稱不區分大小寫。 |
|
subscription
|
path | True |
string (uuid) |
目標訂用帳戶的標識碼。 此值必須是 UUID。 |
|
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 |
資源 'Workspace' 更新作業成功 |
|
| 201 Created |
資源 'Workspace' 建立作業成功 標題
|
|
| 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-000000000000/resourceGroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685?api-version=2025-07-01
{
"location": "australiasoutheast",
"properties": {
"retentionInDays": 30,
"sku": {
"name": "PerGB2018"
}
},
"tags": {
"tag1": "val1"
}
}
範例回覆
{
"name": "AzTest2170",
"type": "Microsoft.OperationalInsights/workspaces",
"id": "/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6685/providers/microsoft.operationalinsights/workspaces/aztest2170",
"location": "australiasoutheast",
"properties": {
"customerId": "bc089d7b-485c-4aff-a71e-c00f362d8d2f",
"provisioningState": "Creating",
"publicNetworkAccessForIngestion": "Enabled",
"publicNetworkAccessForQuery": "Enabled",
"retentionInDays": 30,
"sku": {
"name": "PerGB2018"
}
},
"tags": {
"tag1": "val1"
}
}
{
"name": "AzTest2170",
"type": "Microsoft.OperationalInsights/workspaces",
"id": "/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6685/providers/microsoft.operationalinsights/workspaces/aztest2170",
"location": "australiasoutheast",
"properties": {
"customerId": "bc089d7b-485c-4aff-a71e-c00f362d8d2f",
"provisioningState": "Creating",
"publicNetworkAccessForIngestion": "Enabled",
"publicNetworkAccessForQuery": "Enabled",
"retentionInDays": 30,
"sku": {
"name": "PerGB2018"
}
},
"tags": {
"tag1": "val1"
}
}
定義
| 名稱 | Description |
|---|---|
|
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 的名稱。 |
createdByType
建立資源的身分識別類型。
| 值 | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DataIngestionStatus
此工作區的資料擷取狀態。
| 值 | Description |
|---|---|
| RespectQuota |
在每日上限配額重設或訂閱啟用後啟用擷取。 |
| ForceOn |
服務設定變更後開始擷取。 |
| ForceOff |
服務設定變更後,擷取已停止。 |
| OverQuota |
已達到每日上限配額,擷取已停止。 |
| SubscriptionSuspended |
暫停訂閱後,擷取停止。 |
| ApproachingQuota |
達到每日上限配額的 80%。 |
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 |
|---|---|
| SystemAssigned |
系統分配的 |
| UserAssigned |
UserAssigned |
| None |
None |
PrivateLinkScopedResource
私人鏈接範圍資源參考。
| 名稱 | 類型 | Description |
|---|---|---|
| resourceId |
string |
私人連結範圍資源的完整資源識別碼。 |
| scopeId |
string |
私人連結範圍的唯一識別碼。 |
PublicNetworkAccessType
用於存取 Log Analytics 擷取的網路存取類型。
| 值 | Description |
|---|---|
| Enabled |
透過公用 DNS 啟用與 Log Analytics 的連線。 |
| Disabled |
停用透過公用 DNS 與 Log Analytics 的公用連線。 |
| SecuredByPerimeter |
資源只能從專用網路存取,並由與此資源相關聯的網路安全性周邊核准存取。 |
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 (arm-id) |
資源的完整資源標識碼。 例如 “/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 |
包含 createdBy 和 modifiedBy 資訊的 Azure Resource Manager 元數據。 |
||
| tags |
object |
資源標籤。 |
|
| type |
string |
資源的類型。 例如「Microsoft.Compute/virtualMachines」或「Microsoft.Storage/storageAccounts」 |
WorkspaceCapping
擷取的每日磁碟區上限。
| 名稱 | 類型 | Description |
|---|---|---|
| dailyQuotaGb |
number (double) |
擷取的工作區每日配額。 |
| dataIngestionStatus |
此工作區的資料擷取狀態。 |
|
| quotaNextResetTime |
string |
配額休息的時間。 |
WorkspaceEntityStatus
工作區的布建狀態。
| 值 | Description |
|---|---|
| Creating |
建立中 |
| Succeeded |
成功 |
| Failed |
失敗 |
| Canceled |
已取消 |
| Deleting |
刪除中 |
| ProvisioningAccount |
ProvisioningAccount |
| Updating |
更新中 |
WorkspaceFailoverProperties
複寫的容錯移轉狀態。
| 名稱 | 類型 | Description |
|---|---|---|
| lastModifiedDate |
string (date-time) |
上次更新容錯移轉狀態的時間。 |
| state |
複寫的容錯移轉狀態。 |
WorkspaceFailoverState
複寫的容錯移轉狀態。
| 值 | Description |
|---|---|
| Inactive |
非啟用中 |
| Activating |
啟用中 |
| Active |
活動中 |
| Deactivating |
停用中 |
| Failed |
失敗 |
WorkspaceFeatures
工作區功能。
| 名稱 | 類型 | Description |
|---|---|---|
| associations |
string[] |
工作區的關聯清單。 指出工作區是否與下列任何體驗相關聯:MDC、Sentinel、SentinelGraph 等。 |
| 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 |
|---|---|
| Succeeded |
成功 |
| EnableRequested |
啟用請求 |
| Enabling |
啟用 |
| DisableRequested |
DisableRequested |
| Disabling |
停用 |
| RollbackRequested |
請求回滾 |
| RollingBack |
回滾 |
| Failed |
失敗 |
| Canceled |
已取消 |
WorkspaceSku
工作區的 SKU(層)。
| 名稱 | 類型 | Description |
|---|---|---|
| capacityReservationLevel |
integer (int32) |
選取 CapacityReservation sku 時,此工作區的容量保留層級為 GB。 |
| lastSkuUpdate |
string (date-time) |
上次更新SKU的時候。 |
| name |
SKU 的名稱。 |
WorkspaceSkuNameEnum
SKU 的名稱。
| 值 | Description |
|---|---|
| Free |
免費 |
| Standard |
標準 |
| Premium |
進階 |
| PerNode |
PerNode |
| PerGB2018 |
PerGB2018 |
| Standalone |
獨立 |
| CapacityReservation |
容量預留 |
| LACluster |
LACluster |