Share via


Set-AzureSqlDatabaseDataMaskingPolicy

Set-AzureSqlDatabaseDataMaskingPolicy

Sets data masking for an Azure SQL database.

Syntax

Parameter Set: Default
Set-AzureSqlDatabaseDataMaskingPolicy [-ResourceGroupName] <System.String> [-ServerName] <System.String> [-DatabaseName] <System.String> [-DataMaskingState <System.String> {Enabled | Disabled} ] [-PassThru] [-PrivilegedLogins <System.String> ] [-Profile <Microsoft.Azure.Common.Authentication.Models.AzureProfile> ] 

Detailed Description

The Set-AzureSqlDatabaseDataMaskingPolicy cmdlet sets the data masking policy for an Azure SQL database. To use this cmdlet, use the ResourceGroupName, ServerName, and DatabaseName parameters to identify the database. You can set the DataMaskingState parameter to specify whether data masking operations are enabled or disabled. You can also set the PrivilegedLogins parameter to specify which users are allowed to see the unmasked data. If the cmdlet succeeds and the PassThru parameter is used, it returns an object describing the current data masking policy as well as the database identifiers. Database identifiers include, but are not limited to, ResourceGroupName, ServerName, and DatabaseName.

Parameters

-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

-DataMaskingState<System.String>

Specifies whether data masking operation is enabled or disabled. Valid values are:
-- Enabled
-- Disabled

The default value is Enabled.

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

-PrivilegedLogins<System.String>

Specifies a semicolon separated list of privileged user ids that can view the masking data.

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

-ResourceGroupName<System.String>

Specifies the name of the resource group containing the database.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-ServerName<System.String>

Specifies the name of the server containing the database.

Aliases

none

Required?

true

Position?

2

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

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: Set the data masking policy for a database

This command sets the data masking policy from database named Database03 on the server named Server01.

PS C:\> Set-AzureSqlDatabaseDataMaskingPolicy -ResourceGroupName "ResourceGroup11" -ServerName "Server01" -DatabaseName "Database03"

Get-AzureSqlDatabaseDataMaskingPolicy

Get-AzureSqlDatabaseDataMaskingRule

New-AzureSqlDatabaseDataMaskingRule

Remove-AzureSqlDatabaseDataMaskingRule

Set-AzureSqlDatabaseDataMaskingRule

Azure SQL Database