Skip to main content

data_masking_rules

Creates, updates, deletes, gets or lists a data_masking_rules resource.

Overview

Namedata_masking_rules
TypeResource
Idazure.synapse.data_masking_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
aliasNamestringThe alias name. This is a legacy parameter and is no longer used.
columnNamestringThe column name on which the data masking rule is applied.
kindstringThe kind of Data Masking Rule. Metadata, used for Azure portal.
locationstringThe location of the data masking rule.
maskingFunctionstringThe masking function that is used for the data masking rule. Known values are: "Default", "CCN", "Email", "Number", "SSN", and "Text".
numberFromstringThe numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
numberTostringThe numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
prefixSizestringIf maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored.
replacementStringstringIf maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored.
ruleStatestringThe rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. Known values are: "Disabled" and "Enabled".
schemaNamestringThe schema name on which the data masking rule is applied.
suffixSizestringIf maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored.
tableNamestringThe table name on which the data masking rule is applied.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, workspace_name, sql_pool_name, data_masking_rule_name, subscription_idGets the specific Sql pool data masking rule.
list_by_sql_poolselectresource_group_name, workspace_name, sql_pool_name, subscription_idGets a list of Sql pool data masking rules.
create_or_updateinsertresource_group_name, workspace_name, sql_pool_name, data_masking_rule_name, subscription_idCreates or updates a Sql pool data masking rule.
create_or_updatereplaceresource_group_name, workspace_name, sql_pool_name, data_masking_rule_name, subscription_idCreates or updates a Sql pool data masking rule.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
data_masking_rule_namestringThe name of the data masking rule. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
sql_pool_namestringSQL pool name. Required.
subscription_idstring
workspace_namestringThe name of the workspace. Required.

SELECT examples

Gets the specific Sql pool data masking rule.

SELECT
id,
name,
aliasName,
columnName,
kind,
location,
maskingFunction,
numberFrom,
numberTo,
prefixSize,
replacementString,
ruleState,
schemaName,
suffixSize,
tableName,
type
FROM azure.synapse.data_masking_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND sql_pool_name = '{{ sql_pool_name }}' -- required
AND data_masking_rule_name = '{{ data_masking_rule_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or updates a Sql pool data masking rule.

INSERT INTO azure.synapse.data_masking_rules (
properties,
resource_group_name,
workspace_name,
sql_pool_name,
data_masking_rule_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ workspace_name }}',
'{{ sql_pool_name }}',
'{{ data_masking_rule_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
kind,
location,
properties,
type
;

REPLACE examples

Creates or updates a Sql pool data masking rule.

REPLACE azure.synapse.data_masking_rules
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND sql_pool_name = '{{ sql_pool_name }}' --required
AND data_masking_rule_name = '{{ data_masking_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
kind,
location,
properties,
type;