Data Masking Policies - Create Or Update
Creates or updates a database data masking policy.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/Default?api-version=2023-08-01 URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| database | path | True | string | The name of the database. |
| data | path | True | The name of the database for which the data masking policy applies. | |
| resource | 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. |
| server | path | True | string | The name of the server. |
| subscription | 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 | Required | Type | Description |
|---|---|---|---|
| properties.dataMaskingState | True | The state of the data masking policy. | |
| properties.exemptPrincipals | string | The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK | Successfully created database data masking policy. | |
| 201 Created | Successfully created database data masking policy.. | |
| Other Status Codes | *** Error Responses: ***
|
Examples
| Create or update data masking policy max |
| Create or update data masking policy min. |
Create or update data masking policy max
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-2080/databases/sqlcrudtest-331/dataMaskingPolicies/Default?api-version=2023-08-01 { "properties": { "dataMaskingState": "Enabled", "exemptPrincipals": "testuser;" } } Sample response
{ "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-2080/databases/sqlcrudtest-331/dataMaskingPolicies/Default", "name": "Default", "type": "Microsoft.Sql/servers/databases/dataMaskingPolicies", "location": "Central US", "kind": null, "properties": { "dataMaskingState": "Enabled", "applicationPrincipals": "", "exemptPrincipals": "testuser;", "maskingLevel": "" } } { "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-2080/databases/sqlcrudtest-331/dataMaskingPolicies/Default", "name": "Default", "type": "Microsoft.Sql/servers/databases/dataMaskingPolicies", "location": "Central US", "kind": null, "properties": { "dataMaskingState": "Enabled", "applicationPrincipals": "", "exemptPrincipals": "testuser;", "maskingLevel": "" } } Create or update data masking policy min.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-2080/databases/sqlcrudtest-331/dataMaskingPolicies/Default?api-version=2023-08-01 { "properties": { "dataMaskingState": "Enabled" } } Sample response
{ "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-2080/databases/sqlcrudtest-331/dataMaskingPolicies/Default", "name": "Default", "type": "Microsoft.Sql/servers/databases/dataMaskingPolicies", "location": "Central US", "kind": null, "properties": { "dataMaskingState": "Enabled", "applicationPrincipals": "", "exemptPrincipals": "", "maskingLevel": "" } } { "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6852/providers/Microsoft.Sql/servers/sqlcrudtest-2080/databases/sqlcrudtest-331/dataMaskingPolicies/Default", "name": "Default", "type": "Microsoft.Sql/servers/databases/dataMaskingPolicies", "location": "Central US", "kind": null, "properties": { "dataMaskingState": "Enabled", "applicationPrincipals": "", "exemptPrincipals": "", "maskingLevel": "" } } Definitions
| Name | Description |
|---|---|
| Data | A database data masking policy. |
| Data | The name of the database for which the data masking policy applies. |
| Data | The state of the data masking policy. |
| Error | The resource management error additional info. |
| Error | The error detail. |
| Error | Error response |
DataMaskingPolicy
A database data masking policy.
| Name | Type | Description |
|---|---|---|
| id | string | Resource ID. |
| kind | string | The kind of Data Masking Policy. Metadata, used for Azure portal. |
| location | string | The location of the data masking policy. |
| name | string | Resource name. |
| properties.applicationPrincipals | string | The list of the application principals. This is a legacy parameter and is no longer used. |
| properties.dataMaskingState | The state of the data masking policy. | |
| properties.exemptPrincipals | string | The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries. |
| properties.maskingLevel | string | The masking level. This is a legacy parameter and is no longer used. |
| type | string | Resource type. |
DataMaskingPolicyName
The name of the database for which the data masking policy applies.
| Value | Description |
|---|---|
| Default |
DataMaskingState
The state of the data masking policy.
| Value | Description |
|---|---|
| Enabled | |
| Disabled |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info | object | The additional info. |
| type | string | The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo | The error additional info. | |
| code | string | The error code. |
| details | The error details. | |
| message | string | The error message. |
| target | string | The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error | The error object. |