New-AzureDataFactoryEncryptValue
New-AzureDataFactoryEncryptValue
Encrypts sensitive data (e.g. password, SQL Server connection string) and returns an encrypted value.
Syntax
Parameter Set: ByFactoryName
New-AzureDataFactoryEncryptValue [-ResourceGroupName] <String> [-DataFactoryName] <String> [[-Value] <SecureString> ] [[-GatewayName] <String> ] [[-Credential] <PSCredential> ] [[-Type] <String> {OnPremisesSqlLinkedService | OnPremisesFileSystemLinkedService | OnPremisesOracleLinkedService | OnPremisesOdbcLinkedService | OnPremisesPostgreSqlLinkedService | OnPremisesTeradataLinkedService | OnPremisesMySQLLinkedService | OnPremisesDB2LinkedService | OnPremisesSybaseLinkedService} ] [[-NonCredentialValue] <System.String> ] [[-AuthenticationType] <System.String> {Windows | Basic | Anonymous} ] [[-Server] <System.String> ] [[-Database] <System.String> ] [-Profile <AzureProfile> ] [ <CommonParameters>]
Parameter Set: ByFactoryObject
New-AzureDataFactoryEncryptValue [-DataFactory] <PSDataFactory> [[-Value] <SecureString> ] [[-GatewayName] <String> ] [[-Credential] <PSCredential> ] [[-Type] <String> {OnPremisesSqlLinkedService | OnPremisesFileSystemLinkedService | OnPremisesOracleLinkedService | OnPremisesOdbcLinkedService | OnPremisesPostgreSqlLinkedService | OnPremisesTeradataLinkedService | OnPremisesMySQLLinkedService | OnPremisesDB2LinkedService | OnPremisesSybaseLinkedService} ] [[-NonCredentialValue] <System.String> ] [[-AuthenticationType] <System.String> {Windows | Basic | Anonymous} ] [[-Server] <System.String> ] [[-Database] <System.String> ] [-Profile <AzureProfile> ] [ <CommonParameters>]
Detailed Description
The New-AzureDataFactoryEncryptValue cmdlet encrypts sensitive data (e.g. password, SQL Server connection string) and returns an encrypted value.
Parameters
-AuthenticationType<System.String>
Aliases |
none |
Required? |
false |
Position? |
8 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Database<System.String>
Aliases |
none |
Required? |
false |
Position? |
10 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DataFactory<PSDataFactory>
Specifies a object. This cmdlet encrypts data for the data factory that this parameter specifies.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DataFactoryName<String>
Name of the data factory.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-GatewayName<String>
Name of the gateway.
Aliases |
none |
Required? |
false |
Position? |
4 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-NonCredentialValue<System.String>
Aliases |
none |
Required? |
false |
Position? |
7 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Profile<AzureProfile>
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ResourceGroupName<String>
Name of the resource group.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Server<System.String>
Aliases |
none |
Required? |
false |
Position? |
9 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Type<String>
Specifies the linked service type. This cmdlet encrypts data for the linked service type that this parameter specifies. Allowed values: OnPremisesSqlLinkedService, OnPremisesOracleLinkedService, and OnPremisesFileSystemLinkedService.
Aliases |
none |
Required? |
false |
Position? |
5 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Value<SecureString>
Value that needs to be encrypted. For an on-premises SQL Server linked service and an on-premises Oracle linked service, use a connection string. For an on-premises file system linked service, if the file system is local to the gateway machine, use Local or localhost, and if the file system is on a server different from the gateway machine, use \\servername.
Aliases |
none |
Required? |
false |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Credential<PSCredential>
Specifies the Windows authentication credentials (user name and password) to be used. This cmdlet encrypts the credential data you specify here.
Aliases |
none |
Required? |
false |
Position? |
4 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
- System.String
Examples
-------------------------- EXAMPLE 1 --------------------------
The first command uses the ConvertTo-SecureString cmdlet to convert the specified connection string to a SecureString object, and then stores that object in the $Value variable. For more information, type Get-Help ConvertTo-SecureString. Allowed values: SQL or Oracle connection string.
The second command creates an encrypted value for the object stored in $Value for the specified data factory, gateway, resource group, and linked service type.”
PS C:\> $value = ConvertTo-SecureString "Data Source=servername;Initial Catalog=catelog;user id =user123;password=password123" -AsPlainText -Force
PS C:\> New-AzureDataFactoryEncryptValue -GatewayName wikiGateway -DataFactoryName wikiadf -Value $value -ResourceGroupName ADF –Type OnPremisesSqlLinkedService
-------------------------- EXAMPLE 2 --------------------------
The first command uses the ConvertTo-SecureString cmdlet to convert the specified connection string to a SecureString object, and then stores that object in the $Value variable. For more information, type Get-Help ConvertTo-SecureString. Allowed value: SQL Server connection string.
The second command uses the Get-Credential cmdlet to collect the windows authentication credential (user name and password), and then stores that PSCredential object in the $Credential variable. For more information, type Get-Help Get-Credential.
The third command creates an encrypted value for the object stored in $Value and $Credential for the specified data factory, gateway, resource group, and linked service type.
PS C:\> $Value = ConvertTo-SecureString 'Data Source=ContosoServer;Initial Catalog=catalog;Integrated Security=True' -AsPlainText -ForeP5
PS C:\> $Credential = Get-Credential
PS C:\> New-AzureDataFactoryEncryptValue -DataFactoryName "WikiADF" -GatewayName "WikiGateway" -ResourceGroupName "ADF" -Value $Value -Credential $Credential -Type OnPremisesSqlLinkedService
-------------------------- EXAMPLE3 --------------------------
The first command uses the ConvertTo-SecureString cmdlet to convert the specified string to a SecureString object, and then stores that object in the $Value variable.
The second command uses the Get-Credential cmdlet to collect the windows authentication credentials (user name and password), and then stores the PSCredential object in the $Credential variable. For more information about the Get-Credential cmdlet, type Get-HelpGet-Credential.
The third command creates an encrypted value for the object stored in $Value and $Credential for the specifieddata factory, gateway, resource group, and linked service type.
PS C:\> $Value = ConvertTo-SecureString '\\servername' -AsPlainText -Force
PS C:\> $Credential = Get-Credential
PS C:\> New-AzureDataFactoryEncryptValue -DataFactoryName "WikiADF" -GatewayName "WikiGateway" -ResourceGroupName "ADF" -Value $Value -Credential $Credential -Type OnPremisesFileSystemLinkedService