Server DevOps Audit Settings - Create Or Update

サーバーの DevOps 監査設定を作成または更新します。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}?api-version=2021-11-01

URI パラメーター

名前 / 必須 説明
devOpsAuditingSettingsName
path True

string

devops 監査設定の名前。 これは常に "default" である必要があります。

resourceGroupName
path True

string

リソースが含まれているリソース グループの名前。 この値は、Azure リソース マネージャー API またはポータルから取得できます。

serverName
path True

string

サーバーの名前。

subscriptionId
path True

string

Azure サブスクリプションを識別するサブスクリプション ID。

api-version
query True

string

要求で使用する API のバージョン。

要求本文

名前 必須 説明
properties.state True

BlobAuditingPolicyState

監査の状態を指定します。 state が Enabled の場合、storageEndpoint または isAzureMonitorTargetEnabled が必要です。

properties.isAzureMonitorTargetEnabled

boolean

DevOps 監査イベントを Azure Monitor に送信するかどうかを指定します。 イベントを Azure Monitor に送信するには、'State' を 'Enabled' に、'IsAzureMonitorTargetEnabled' を true に指定します。

REST API を使用して DevOps 監査を構成する場合は、マスター データベースに "DevOpsOperationsAudit" 診断ログ カテゴリを含む診断設定も作成する必要があります。

診断設定 URI 形式: PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview

詳細については、「診断設定 REST API」または「診断設定 PowerShell」を参照してください。

properties.storageAccountAccessKey

string

監査ストレージ アカウントの識別子キーを指定します。 state が Enabled で storageEndpoint が指定されている場合、storageAccountAccessKey を指定しないと、SQL Server システム割り当てマネージド ID を使用してストレージにアクセスします。 マネージド ID 認証を使用するための前提条件:

  1. Azure Active Directory (AAD) でシステム割り当てマネージド ID SQL Server割り当てます。
  2. "ストレージ BLOB データ共同作成者" RBAC ロールをサーバー ID に追加して、SQL Server ID にストレージ アカウントへのアクセス権を付与します。 詳細については、「マネージド ID 認証を使用したストレージへの監査」を参照してください。
properties.storageAccountSubscriptionId

string

BLOB ストレージ サブスクリプション ID を指定します。

properties.storageEndpoint

string

BLOB ストレージ エンドポイント (例: ) を指定します。 https://MyAccount.blob.core.windows.net state が Enabled の場合、storageEndpoint または isAzureMonitorTargetEnabled が必要です。

応答

名前 説明
200 OK

ServerDevOpsAuditingSettings

DevOps 監査設定が正常に更新されました。

202 Accepted

監査 DevOps 設定の更新が進行中です。

Other Status Codes

エラー応答: ***

  • 400 InvalidServerDevOpsAuditSettingsCreateRequest - サーバー DevOps 監査ポリシーの作成要求が存在しないか、プロパティ オブジェクトがありません。

  • 400 DataSecurityInvalidUserSuppliedParameter - 無効なパラメーター値がクライアントによって提供されました。

  • 400 InvalidServerDevOpsAuditSettingsName - 無効なサーバー DevOps ポリシー名。

  • 400 DevOpsAuditInvalidStorageAccountCredentials - 指定されたストレージ アカウントまたはアクセス キーが無効です。

  • 404 SubscriptionDoesNotHaveServer - 要求されたサーバーが見つかりませんでした

  • 404 ServerNotInSubscriptionResourceGroup - 指定されたサーバーが、指定されたリソース グループとサブスクリプションに存在しません。

  • 409 ServerDevOpsAuditSettingsInProgress - Set server DevOps audit は既に進行中です。

Update a server's DevOps audit settings with all params
Update a server's DevOps audit settings with minimal input

Update a server's DevOps audit settings with all params

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default?api-version=2021-11-01

{
  "properties": {
    "state": "Enabled",
    "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==",
    "storageEndpoint": "https://mystorage.blob.core.windows.net",
    "storageAccountSubscriptionId": "00000000-1234-0000-5678-000000000000",
    "isAzureMonitorTargetEnabled": true
  }
}

Sample Response

{
  "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

Sample Request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/devAuditTestRG/providers/Microsoft.Sql/servers/devOpsAuditTestSvr/devOpsAuditingSettings/default?api-version=2021-11-01

{
  "properties": {
    "state": "Enabled",
    "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==",
    "storageEndpoint": "https://mystorage.blob.core.windows.net"
  }
}

Sample Response

{
  "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"
  }
}

定義

名前 説明
BlobAuditingPolicyState

監査の状態を指定します。 state が Enabled の場合、storageEndpoint または isAzureMonitorTargetEnabled が必要です。

createdByType

リソースを作成した ID の種類。

ServerDevOpsAuditingSettings

サーバー DevOps 監査設定。

systemData

リソースの作成と最後の変更に関連するメタデータ。

BlobAuditingPolicyState

監査の状態を指定します。 state が Enabled の場合、storageEndpoint または isAzureMonitorTargetEnabled が必要です。

名前 説明
Disabled

string

Enabled

string

createdByType

リソースを作成した ID の種類。

名前 説明
Application

string

Key

string

ManagedIdentity

string

User

string

ServerDevOpsAuditingSettings

サーバー DevOps 監査設定。

名前 説明
id

string

リソースの ID

name

string

リソース名。

properties.isAzureMonitorTargetEnabled

boolean

DevOps 監査イベントを Azure Monitor に送信するかどうかを指定します。 イベントを Azure Monitor に送信するには、'State' を 'Enabled' に、'IsAzureMonitorTargetEnabled' を true に指定します。

REST API を使用して DevOps 監査を構成する場合は、マスター データベースに "DevOpsOperationsAudit" 診断ログ カテゴリを含む診断設定も作成する必要があります。

診断設定 URI 形式: PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview

詳細については、「診断設定 REST API」または「診断設定 PowerShell」を参照してください。

properties.state

BlobAuditingPolicyState

監査の状態を指定します。 state が Enabled の場合、storageEndpoint または isAzureMonitorTargetEnabled が必要です。

properties.storageAccountAccessKey

string

監査ストレージ アカウントの識別子キーを指定します。 state が Enabled で storageEndpoint が指定されている場合、storageAccountAccessKey を指定しないと、SQL Server システム割り当てマネージド ID を使用してストレージにアクセスします。 マネージド ID 認証を使用するための前提条件:

  1. Azure Active Directory (AAD) でシステム割り当てマネージド ID SQL Server割り当てます。
  2. "ストレージ BLOB データ共同作成者" RBAC ロールをサーバー ID に追加して、SQL Server ID にストレージ アカウントへのアクセス権を付与します。 詳細については、「マネージド ID 認証を使用したストレージへの監査」を参照してください。
properties.storageAccountSubscriptionId

string

BLOB ストレージ サブスクリプション ID を指定します。

properties.storageEndpoint

string

BLOB ストレージ エンドポイント (例: ) を指定します。 https://MyAccount.blob.core.windows.net state が Enabled の場合、storageEndpoint または isAzureMonitorTargetEnabled が必要です。

systemData

systemData

ServerDevOpsAuditSettingsResource の SystemData。

type

string

リソースの種類。

systemData

リソースの作成と最後の変更に関連するメタデータ。

名前 説明
createdAt

string

リソース作成のタイムスタンプ (UTC)。

createdBy

string

リソースを作成した ID。

createdByType

createdByType

リソースを作成した ID の種類。

lastModifiedAt

string

リソースの最終変更のタイムスタンプ (UTC)

lastModifiedBy

string

リソースを最後に変更した ID。

lastModifiedByType

createdByType

リソースを最後に変更した ID の種類。