Server DevOps Audit Settings - Create Or Update
建立或更新伺服器的 DevOps 稽核設定。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/Default?api-version=2023-08-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
dev
|
path | True | ||
|
resource
|
path | True |
string |
包含資源的資源群組名稱。 您可以從 Azure Resource Manager API 或入口網站取得此值。 |
|
server
|
path | True |
string |
伺服器的名稱。 |
|
subscription
|
path | True |
string |
識別 Azure 訂用帳戶的訂用帳戶標識碼。 |
|
api-version
|
query | True |
string |
要用於要求的 API 版本。 |
要求本文
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| properties.state | True |
指定稽核的狀態。 如果狀態為 Enabled,則需要 storageEndpoint 或 isAzureMonitorTargetEnabled。 |
|
| properties.isAzureMonitorTargetEnabled |
boolean |
指定 DevOps 稽核事件是否傳送至 Azure 監視器。 若要將事件傳送至 Azure 監視器,請將 'State' 指定為 'Enabled',並將 'IsAzureMonitorTargetEnabled' 指定為 true。 使用 REST API 設定 DevOps 稽核時,也應該在 master 資料庫上建立具有 'DevOpsOperationsAudit' 診斷記錄類別的診斷設定。 診斷設定 URI 格式:PUT 如需詳細資訊,請參閱 診斷設定 REST API 或 診斷設定 PowerShell |
|
| properties.isManagedIdentityInUse |
boolean |
指定受控識別是否用來存取 Blob 記憶體 |
|
| properties.storageAccountAccessKey |
string |
指定稽核記憶體帳戶的標識碼金鑰。 如果狀態為 Enabled 且 storageEndpoint 已指定,則未指定 storageAccountAccessKey 會使用 SQL Server 系統指派的受控識別來存取記憶體。 使用受控識別驗證的必要條件:
|
|
| properties.storageAccountSubscriptionId |
string (uuid) |
指定 Blob 記憶體訂用帳戶標識碼。 |
|
| properties.storageEndpoint |
string |
指定 Blob 記憶體端點(例如 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
已成功更新DevOps稽核設定。 |
|
| 202 Accepted |
正在更新稽核 DevOps 設定。 標題 Location: string |
|
| Other Status Codes |
錯誤回應: ***
|
範例
|
Update a server's Dev |
|
Update a server's Dev |
Update a server's DevOps audit settings with all params
範例要求
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/Default?api-version=2023-08-01
{
"properties": {
"state": "Enabled",
"storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"storageEndpoint": "https://mystorage.blob.core.windows.net",
"storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000",
"isAzureMonitorTargetEnabled": true
}
}
範例回覆
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default",
"name": "Default",
"type": "Microsoft.Sql/servers/devOpsAuditingSettings",
"properties": {
"state": "Enabled",
"storageEndpoint": "https://mystorage.blob.core.windows.net",
"storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000",
"isAzureMonitorTargetEnabled": true
}
}
Update a server's DevOps audit settings with minimal input
範例要求
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/Default?api-version=2023-08-01
{
"properties": {
"state": "Enabled",
"storageAccountAccessKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"storageEndpoint": "https://mystorage.blob.core.windows.net"
}
}
範例回覆
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default",
"name": "Default",
"type": "Microsoft.Sql/servers/devOpsAuditingSettings",
"properties": {
"state": "Enabled",
"storageEndpoint": "https://mystorage.blob.core.windows.net",
"storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000"
}
}
定義
| 名稱 | Description |
|---|---|
|
Blob |
指定稽核的狀態。 如果狀態為 Enabled,則需要 storageEndpoint 或 isAzureMonitorTargetEnabled。 |
|
created |
建立資源的身分識別類型。 |
|
Dev |
|
|
Error |
資源管理錯誤其他資訊。 |
|
Error |
錯誤詳細數據。 |
|
Error |
錯誤回應 |
|
Server |
伺服器DevOps稽核設定。 |
|
system |
與建立和上次修改資源相關的元數據。 |
BlobAuditingPolicyState
指定稽核的狀態。 如果狀態為 Enabled,則需要 storageEndpoint 或 isAzureMonitorTargetEnabled。
| 值 | Description |
|---|---|
| Enabled | |
| Disabled |
createdByType
建立資源的身分識別類型。
| 值 | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DevOpsAuditingSettingsName
| 值 | Description |
|---|---|
| Default |
ErrorAdditionalInfo
資源管理錯誤其他資訊。
| 名稱 | 類型 | Description |
|---|---|---|
| info |
object |
其他資訊。 |
| type |
string |
其他信息類型。 |
ErrorDetail
錯誤詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| additionalInfo |
錯誤其他資訊。 |
|
| code |
string |
錯誤碼。 |
| details |
錯誤詳細數據。 |
|
| message |
string |
錯誤訊息。 |
| target |
string |
錯誤目標。 |
ErrorResponse
錯誤回應
| 名稱 | 類型 | Description |
|---|---|---|
| error |
error 物件。 |
ServerDevOpsAuditingSettings
伺服器DevOps稽核設定。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string |
資源標識碼。 |
| name |
string |
資源名稱。 |
| properties.isAzureMonitorTargetEnabled |
boolean |
指定 DevOps 稽核事件是否傳送至 Azure 監視器。 若要將事件傳送至 Azure 監視器,請將 'State' 指定為 'Enabled',並將 'IsAzureMonitorTargetEnabled' 指定為 true。 使用 REST API 設定 DevOps 稽核時,也應該在 master 資料庫上建立具有 'DevOpsOperationsAudit' 診斷記錄類別的診斷設定。 診斷設定 URI 格式:PUT 如需詳細資訊,請參閱 診斷設定 REST API 或 診斷設定 PowerShell |
| properties.isManagedIdentityInUse |
boolean |
指定受控識別是否用來存取 Blob 記憶體 |
| properties.state |
指定稽核的狀態。 如果狀態為 Enabled,則需要 storageEndpoint 或 isAzureMonitorTargetEnabled。 |
|
| properties.storageAccountAccessKey |
string |
指定稽核記憶體帳戶的標識碼金鑰。 如果狀態為 Enabled 且 storageEndpoint 已指定,則未指定 storageAccountAccessKey 會使用 SQL Server 系統指派的受控識別來存取記憶體。 使用受控識別驗證的必要條件:
|
| properties.storageAccountSubscriptionId |
string (uuid) |
指定 Blob 記憶體訂用帳戶標識碼。 |
| properties.storageEndpoint |
string |
指定 Blob 記憶體端點(例如 |
| systemData |
ServerDevOpsAuditSettingsResource 的 SystemData。 |
|
| type |
string |
資源類型。 |
systemData
與建立和上次修改資源相關的元數據。
| 名稱 | 類型 | Description |
|---|---|---|
| createdAt |
string (date-time) |
資源建立的時間戳(UTC)。 |
| createdBy |
string |
建立資源的身分識別。 |
| createdByType |
建立資源的身分識別類型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的資源時間戳 (UTC) |
| lastModifiedBy |
string |
上次修改資源的身分識別。 |
| lastModifiedByType |
上次修改資源的身分識別類型。 |