{ "swagger": "2.0", "info": { "title": "SqlManagementClient", "version": "2025-01-01", "description": "The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities.", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "host": "management.azure.com", "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "description": "Azure Active Directory OAuth2 Flow.", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } }, "tags": [ { "name": "ServerDevOpsAudit" } ], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings": { "get": { "operationId": "ServerDevOpsAuditSettings_ListByServer", "tags": [ "ServerDevOpsAudit" ], "description": "Lists DevOps audit settings of a server.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ServerDevOpsAuditSettingsListResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "List DevOps audit settings of a server": { "$ref": "./examples/ServerDevOpsAuditList.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}": { "get": { "operationId": "ServerDevOpsAuditSettings_Get", "tags": [ "ServerDevOpsAudit" ], "description": "Gets a server's DevOps audit settings.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server.", "required": true, "type": "string" }, { "name": "devOpsAuditingSettingsName", "in": "path", "description": "", "required": true, "type": "string", "enum": [ "Default" ], "x-ms-enum": { "name": "DevOpsAuditingSettingsName", "modelAsString": true, "values": [ { "name": "Default", "value": "Default", "description": "Default" } ] } } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/ServerDevOpsAuditingSettings" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Get a server's DevOps audit settings": { "$ref": "./examples/ServerDevOpsAuditGet.json" } } }, "put": { "operationId": "ServerDevOpsAuditSettings_CreateOrUpdate", "tags": [ "ServerDevOpsAudit" ], "description": "Creates or updates a server's DevOps audit settings.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "serverName", "in": "path", "description": "The name of the server.", "required": true, "type": "string" }, { "name": "devOpsAuditingSettingsName", "in": "path", "description": "", "required": true, "type": "string", "enum": [ "Default" ], "x-ms-enum": { "name": "DevOpsAuditingSettingsName", "modelAsString": true, "values": [ { "name": "Default", "value": "Default", "description": "Default" } ] } }, { "name": "parameters", "in": "body", "description": "Properties of DevOps audit settings", "required": true, "schema": { "$ref": "#/definitions/ServerDevOpsAuditingSettings" } } ], "responses": { "200": { "description": "Resource 'ServerDevOpsAuditingSettings' update operation succeeded", "schema": { "$ref": "#/definitions/ServerDevOpsAuditingSettings" } }, "202": { "description": "Resource operation accepted.", "headers": { "Azure-AsyncOperation": { "type": "string", "format": "uri", "description": "A link to the status monitor" }, "Location": { "type": "string", "description": "The Location header contains the URL where the status of the long running operation can be checked." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Update a server's DevOps audit settings with all params": { "$ref": "./examples/ServerDevOpsAuditCreateMax.json" }, "Update a server's DevOps audit settings with minimal input": { "$ref": "./examples/ServerDevOpsAuditCreateMin.json" } }, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation", "final-state-schema": "#/definitions/ServerDevOpsAuditingSettings" }, "x-ms-long-running-operation": true } } }, "definitions": { "ServerDevOpsAuditSettingsListResult": { "type": "object", "description": "A list of server DevOps audit settings.", "properties": { "value": { "type": "array", "description": "Array of results.", "items": { "$ref": "#/definitions/ServerDevOpsAuditingSettings" }, "readOnly": true }, "nextLink": { "type": "string", "description": "Link to retrieve next page of results.", "readOnly": true } } }, "ServerDevOpsAuditSettingsProperties": { "type": "object", "description": "Properties of a server DevOps audit settings.", "properties": { "isAzureMonitorTargetEnabled": { "type": "boolean", "description": "Specifies whether DevOps audit events are sent to Azure Monitor.\nIn order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.\n\nWhen using REST API to configure DevOps audit, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should be also created.\n\nDiagnostic Settings URI format:\nPUT 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\n\nFor more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)\nor [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)" }, "isManagedIdentityInUse": { "type": "boolean", "description": "Specifies whether Managed Identity is used to access blob storage" }, "state": { "$ref": "./common.json#/definitions/BlobAuditingPolicyState", "description": "Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required." }, "storageEndpoint": { "type": "string", "description": "Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required." }, "storageAccountAccessKey": { "type": "string", "format": "password", "description": "Specifies the identifier key of the auditing storage account.\nIf state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.\nPrerequisites for using managed identity authentication:\n1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).\n2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.\nFor more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)", "x-ms-mutability": [ "update", "create" ], "x-ms-secret": true }, "storageAccountSubscriptionId": { "$ref": "./common.json#/definitions/Azure.Core.uuid", "description": "Specifies the blob storage subscription Id." } }, "required": [ "state" ] }, "ServerDevOpsAuditingSettings": { "type": "object", "description": "A server DevOps auditing settings.", "properties": { "properties": { "$ref": "#/definitions/ServerDevOpsAuditSettingsProperties", "description": "Resource properties.", "x-ms-client-flatten": true } }, "allOf": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ] } }, "parameters": {} }