< Back

Set-AzureRmSqlDatabaseDataMaskingRule

Tue Jan 29, 2019 10:10 pm

NAME Set-AzureRmSqlDatabaseDataMaskingRule



SYNOPSIS

Sets the properties of a data masking rule for a database.





SYNTAX

Set-AzureRmSqlDatabaseDataMaskingRule [-ResourceGroupName] <String> [-ServerName] <String> [-DatabaseName] <String> -ColumnName <String>

[-DefaultProfile <IAzureContextContainer>] [-MaskingFunction {NoMasking | Default | Text | Number | SocialSecurityNumber | CreditCardNumber |

Email}] [-NumberFrom <Double>] [-NumberTo <Double>] [-PassThru] [-PrefixSize <UInt32>] [-ReplacementString <String>] -SchemaName <String>

[-SuffixSize <UInt32>] -TableName <String> [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Set-AzureRmSqlDatabaseDataMaskingRule cmdlet sets a data masking rule for 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 describes the data masking rule properties and the rule identifiers. Rule identifiers include, but are not

limited to, ResourceGroupName , ServerName , DatabaseName , and RuleId .



This cmdlet is also supported by the SQL Server Stretch Database service on Azure.





PARAMETERS

-ColumnName <String>

Specifies the name of the column targeted by the masking rule.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DatabaseName <String>

Specifies the name of the database.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-MaskingFunction <String>

Specifies the masking function that the rule uses. The acceptable values for this parameter are:



- Default



- NoMasking



- Text



- Number



- SocialSecurityNumber



- CreditCardNumber



- Email





The default value is Default.





Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-NumberFrom <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.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-NumberTo <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.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-PrefixSize <UInt32>

Specifies the number of characters at the start of the text that are not masked. Specify this parameter only if you specify a value of Text

for the MaskingFunction parameter. The default value is 0.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ReplacementString <String>

Specifies the number of characters at the end of the text that are not masked. Specify this parameter only if you specify a value of Text for

the MaskingFunction parameter. The default value is 0.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group to which the database is assigned.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SchemaName <String>

Specifies the name of a schema.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ServerName <String>

Specifies the name of the server that hosts the database.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SuffixSize <UInt32>

Specifies the number of characters at the end of the text that are not masked. Specify this parameter only if you specify a value of Text for

the MaskingFunction parameter. The default value is 0.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-TableName <String>

Specifies the name of the database table that contains the masked column.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



None





OUTPUTS

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







NOTES









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



PS C:\\>Set-AzureRmSqlDatabaseDataMaskingRule -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName

-SchemaName "dbo" -TableName "table1" -ColumnName "column1" -MaskingFunction "Default"



This command modifies a data masking rule that has the ID Rule17. That rule operates in the database named Database01 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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... askingrule

Get-AzureRmSqlDatabaseDataMaskingRule

New-AzureRmSqlDatabaseDataMaskingRule

Remove-AzureRmSqlDatabaseDataMaskingRule

SQL Database Documentation https://docs.microsoft.com/azure/sql-database/