Set-AzureSqlDatabaseDataMaskingRule

Set-AzureSqlDatabaseDataMaskingRule

Sets the properties of a data masking rule in an Azure SQL database.

Syntax

Parameter Set: Default
Set-AzureSqlDatabaseDataMaskingRule [-ResourceGroupName] <System.String> [-ServerName] <System.String> [-DatabaseName] <System.String> -RuleId <System.String> [-ColumnName <System.String> ] [-MaskingFunction <System.String> {NoMasking | Default | Text | Number | SocialSecurityNumber | CreditCardNumber | Email} ] [-NumberFrom <Nullable [System.Double]> ] [-NumberTo <Nullable [System.Double]> ] [-PassThru] [-PrefixSize <Nullable [System.UInt32]> ] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] [-ReplacementString <System.String> ] [-SchemaName <System.String> ] [-SuffixSize <Nullable [System.UInt32]> ] [-TableName <System.String> ] 

Detailed Description

The Set-AzureSqlDatabaseDataMaskingRule cmdlet is used to set a data masking rule in an Azure SQL database. To use the cmdlet, provide the ResourceGroupName, ServerName, DatabaseName, and RuleId parameters to identify the rule. You can provide any of the parameters of SchemaName, TableName, and ColumnName to retarget the rule. Specify the MaskingFunction parameter to modify how the data is masked. If you specify a value of Number or Text for MaskingFunction, you can specify the NumberFrom and NumberTo parameters for number masking or the PrefixSize, ReplacementString, and SuffixSize parameters for text masking. If the command succeeds, and if you specify the PassThru parameter, the cmdlet returns an object that describe the data masking rule properties, and the rule identifiers. Rule identifiers include, but are not limited to, ResourceGroupName, ServerName,DatabaseName and RuleId.

Parameters

-ColumnName<System.String>

Specifies the name of the column that is the target of this masking rule.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-DatabaseName<System.String>

Specifies the name of the database.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-MaskingFunction<System.String>

Specifies the masking function that the rule uses. Valid values are:

-- Default
-- NoMasking
-- Text
-- Number
-- SocialSecurityNumber
-- CreditCardNumber
-- Email

The default value is Default.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-NumberFrom<Nullable [System.Double]>

Specifies the lower bound number of the interval from which a random value is selected. Specify this parameter only if you specify a value of Number for the MaskingFunction parameter. The default value is 0.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-NumberTo<Nullable [System.Double]>

Specifies the upper bound number of the interval from which a random value is selected. Specify this parameter only if you specify a value of Number for the MaskingFunction parameter. The default value is 0.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PrefixSize<Nullable [System.UInt32]>

Specifies the number of characters in the beginning of the text that is not masked. Specify this parameter only if you specify a value of Text for the MaskingFunction parameter. The default value is 0.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-Profile<Microsoft.Azure.Common.Authentication.Models.AzureProfile>

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ReplacementString<System.String>

Specifies the number of characters in the end of the text that is not masked. Specify this parameter only if you specify a value of Text for the MaskingFunction parameter. The default value is 0.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-ResourceGroupName<System.String>

Specifies the name of the resource group that contains the database.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-RuleId<System.String>

Specifies the identifier for the data masking rule.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-SchemaName<System.String>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-ServerName<System.String>

Specifies the name of the server that contains the database.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-SuffixSize<Nullable [System.UInt32]>

Specifies the number of characters in the end of the text that is not masked. Specify this parameter only if you specify a value of Text for the MaskingFunction parameter. The default value is 0.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-TableName<System.String>

Specifies the name of the table in the database of which the masked column is part.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Azure.Commands.Sql.Security.Model.DatabaseDataMaskingRuleModel

Notes

  • This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters.

Examples

Example 1: Change the range of a data masking rule in a database

This command modifies a data masking rule that has the ID Rule17. That rule operates in the database named Database03 on server Server01. This command changes the boundaries for the interval in which a random number is generated as the masked value. The new range is between 23 and 42.

PS C:\> Set-AzureSqlDatabaseDataMaskingRule -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database03" –RuleId "Rule17" –NumberFrom 23 –NumberTo 42

Get-AzureSqlDatabaseDataMaskingRule

New-AzureSqlDatabaseDataMaskingRule

Remove-AzureSqlDatabaseDataMaskingRule

Azure SQL Database