Microsoft.Sql servers/databases/dataMaskingPolicies/rules

Template format

To create a Microsoft.Sql/servers/databases/dataMaskingPolicies/rules resource, add the following JSON to the resources section of your template.

{
  "name": "string",
  "type": "Microsoft.Sql/servers/databases/dataMaskingPolicies/rules",
  "apiVersion": "2014-04-01",
  "properties": {
    "aliasName": "string",
    "ruleState": "string",
    "schemaName": "string",
    "tableName": "string",
    "columnName": "string",
    "maskingFunction": "string",
    "numberFrom": "string",
    "numberTo": "string",
    "prefixSize": "string",
    "suffixSize": "string",
    "replacementString": "string"
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.Sql/servers/databases/dataMaskingPolicies/rules object

Name Type Required Value
name string Yes The name of the data masking rule.
type enum Yes rules
-or-
Microsoft.Sql/servers/databases/dataMaskingPolicies/rules

See Set name and type for child resources.
apiVersion enum Yes 2014-04-01
properties object Yes The properties of the resource. - DataMaskingRuleProperties object

DataMaskingRuleProperties object

Name Type Required Value
aliasName string No The alias name. This is a legacy parameter and is no longer used.
ruleState enum No 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. - Disabled or Enabled
schemaName string Yes The schema name on which the data masking rule is applied.
tableName string Yes The table name on which the data masking rule is applied.
columnName string Yes The column name on which the data masking rule is applied.
maskingFunction enum Yes The masking function that is used for the data masking rule. - Default, CCN, Email, Number, SSN, Text
numberFrom string No The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
numberTo string No The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
prefixSize string No 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.
suffixSize string No 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.
replacementString string No If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored.