Share via


DataMaskingRule Class

Represents a database data masking rule.

Variables are only populated by the server, and will be ignored when sending a request.

Constructor

DataMaskingRule(*, alias_name: str | None = None, rule_state: str | _models.DataMaskingRuleState | None = None, schema_name: str | None = None, table_name: str | None = None, column_name: str | None = None, masking_function: str | _models.DataMaskingFunction | None = None, number_from: str | None = None, number_to: str | None = None, prefix_size: str | None = None, suffix_size: str | None = None, replacement_string: str | None = None, **kwargs: Any)

Keyword-Only Parameters

Name Description
alias_name
str

The alias name. This is a legacy parameter and is no longer used.

Default value: None
rule_state

The 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".

Default value: None
schema_name
str

The schema name on which the data masking rule is applied.

Default value: None
table_name
str

The table name on which the data masking rule is applied.

Default value: None
column_name
str

The column name on which the data masking rule is applied.

Default value: None
masking_function

The masking function that is used for the data masking rule. Known values are: "Default", "CCN", "Email", "Number", "SSN", and "Text".

Default value: None
number_from
str

The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.

Default value: None
number_to
str

The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.

Default value: None
prefix_size
str

If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored.

Default value: None
suffix_size
str

If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored.

Default value: None
replacement_string
str

If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored.

Default value: None

Variables

Name Description
id
str

Resource ID.

name
str

Resource name.

type
str

Resource type.

location
str

The location of the data masking rule.

kind
str

The kind of Data Masking Rule. Metadata, used for Azure portal.

id_properties_id
str

The rule Id.

alias_name
str

The alias name. This is a legacy parameter and is no longer used.

rule_state

The 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".

schema_name
str

The schema name on which the data masking rule is applied.

table_name
str

The table name on which the data masking rule is applied.

column_name
str

The column name on which the data masking rule is applied.

masking_function

The masking function that is used for the data masking rule. Known values are: "Default", "CCN", "Email", "Number", "SSN", and "Text".

number_from
str

The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.

number_to
str

The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.

prefix_size
str

If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored.

suffix_size
str

If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored.

replacement_string
str

If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored.