Recommended Sensitivity Labels - Update

Update recommended sensitivity labels states of a given database using an operations batch.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels?api-version=2021-11-01

URI Parameters

Name In Required Type Description
databaseName
path True

string

The name of the database.

resourceGroupName
path True

string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

serverName
path True

string

The name of the server.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Request Body

Name Type Description
operations

RecommendedSensitivityLabelUpdate[]

A recommended sensitivity label update operation.

Responses

Name Type Description
200 OK

Successfully updated recommended sensitivity labels.

Other Status Codes

*** Error Responses: ***

  • 400 DatawarehouseDatabaseIsDeactivated - Could not execute Data Classification operation because the database is paused. Please resume it.

  • 400 DatawarehouseDatabaseIsDeactivated - Could not execute Data Classification operation because the database is paused. Please resume it.

  • 400 SensitivityLabelSourceNameNotSupported - The specified sensitivity label source is not valid

  • 400 InvalidRecommendedSensitivityLabelsBatch - The specified recommended sensitivity labels operations are not valid

  • 400 SensitivityLabelsMissingSchema - Operation[{0}]: Missing schema information

  • 400 SensitivityLabelsMissingTable - Operation[{0}]: Missing table information

  • 400 SensitivityLabelsMissingColumn - Operation[{0}]: Missing column information

  • 400 SensitivityLabelsUpdateSameColumnMoreThanOnce - The column {0} can not be updated more than once in a single command

  • 400 InvalidSensitivityLabelResource - The specified sensitivity label resource is not valid

  • 400 SensitivityLabelLabelNameAndInfoTypeNotProvided - At least one of LabelName and InformationType must be specified

  • 400 LabelNameTooLong - Label name cannot exceed {0} characters

  • 400 InformationTypeTooLong - Information type cannot exceed {0} characters

  • 400 LabelIdMustBeGuid - The provided ‘labelId’ is invalid. Value must be a GUID

  • 400 InformationTypeIdMustBeGuid - The provided ‘informationTypeId’ is invalid. Value must be a GUID

  • 400 LabelMissing - Label is required. At least one of ‘labelName’ or ‘labelId’ must be provided

  • 400 InformationTypeMissing - Information type is required. At least one of ‘informationType’ or ‘informationTypeId’ must be provided

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

  • 404 SensitivityLabelsLabelNotFound - The specified sensitivity label could not be found

  • 404 SensitivityLabelsSchemaNotFound - The schema {0} could not be found

  • 404 SensitivityLabelsTableNotFound - The table {0} could not be found in schema {1}

  • 404 SensitivityLabelsColumnNotFound - The column {0} could not be found in table {2}.{1}

  • 501 SensitivityLabelRecommendedSourceNameNotSupported - 'Recommended' sensitivity label source is not supported yet

  • 501 SensitivityLabelRecommendedSourceNameNotSupported - 'Recommended' sensitivity label source is not supported yet

  • 503 DatabaseUnavailable - The operation failed because the database is unavailable.

Examples

Sample request

PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/recommendedSensitivityLabels?api-version=2021-11-01

{
  "operations": [
    {
      "properties": {
        "op": "enable",
        "schema": "dbo",
        "table": "table1",
        "column": "column1"
      }
    },
    {
      "properties": {
        "op": "enable",
        "schema": "dbo",
        "table": "table2",
        "column": "column2"
      }
    },
    {
      "properties": {
        "op": "disable",
        "schema": "dbo",
        "table": "table1",
        "column": "column3"
      }
    }
  ]
}

Sample response

Definitions

Name Description
RecommendedSensitivityLabelUpdate

A recommended sensitivity label update operation.

RecommendedSensitivityLabelUpdateKind
RecommendedSensitivityLabelUpdateList

A list of recommended sensitivity label update operations.

RecommendedSensitivityLabelUpdate

A recommended sensitivity label update operation.

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.column

string

Column name to update.

properties.op

RecommendedSensitivityLabelUpdateKind

properties.schema

string

Schema name of the column to update.

properties.table

string

Table name of the column to update.

type

string

Resource type.

RecommendedSensitivityLabelUpdateKind

Name Type Description
disable

string

enable

string

RecommendedSensitivityLabelUpdateList

A list of recommended sensitivity label update operations.

Name Type Description
operations

RecommendedSensitivityLabelUpdate[]

A recommended sensitivity label update operation.