< Back
New-AzureRmDataFactoryEncryptValue
Post
NAME New-AzureRmDataFactoryEncryptValue
SYNOPSIS
Encrypts sensitive data.
SYNTAX
New-AzureRmDataFactoryEncryptValue [-DataFactory] <PSDataFactory> [[-Value] <SecureString>] [[-GatewayName] <String>] [[-Credential]
<PSCredential>] [[-Type] {OnPremisesSqlLinkedService | OnPremisesFileSystemLinkedService | OnPremisesOracleLinkedService |
OnPremisesOdbcLinkedService | OnPremisesPostgreSqlLinkedService | OnPremisesTeradataLinkedService | OnPremisesMySQLLinkedService |
OnPremisesDB2LinkedService | OnPremisesSybaseLinkedService | HdfsLinkedService}] [[-NonCredentialValue] <String>] [[-AuthenticationType] {Windows
| Basic | Anonymous}] [[-Server] <String>] [[-Database] <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
New-AzureRmDataFactoryEncryptValue [-ResourceGroupName] <String> [-DataFactoryName] <String> [[-Value] <SecureString>] [[-GatewayName] <String>]
[[-Credential] <PSCredential>] [[-Type] {OnPremisesSqlLinkedService | OnPremisesFileSystemLinkedService | OnPremisesOracleLinkedService |
OnPremisesOdbcLinkedService | OnPremisesPostgreSqlLinkedService | OnPremisesTeradataLinkedService | OnPremisesMySQLLinkedService |
OnPremisesDB2LinkedService | OnPremisesSybaseLinkedService | HdfsLinkedService}] [[-NonCredentialValue] <String>] [[-AuthenticationType] {Windows
| Basic | Anonymous}] [[-Server] <String>] [[-Database] <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
DESCRIPTION
The New-AzureRmDataFactoryEncryptValue cmdlet encrypts sensitive data, such as a password or a Microsoft SQL Server connection string, and returns
an encrypted value.
PARAMETERS
-AuthenticationType <String>
Specifies the type of authentication to be used to connect to the data source. The acceptable values for this parameter are:
- Windows
- Basic
- Anonymous.
Required? false
Position? 6
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.
Required? false
Position? 3
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Database <String>
Specifies the database name of the linked service.
Required? false
Position? 8
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DataFactory <PSDataFactory>
Specifies a PSDataFactory object. This cmdlet encrypts data for the data factory that this parameter specifies.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DataFactoryName <String>
Specifies the name of a data factory. This cmdlet encrypts data for the data factory that this parameter specifies.
Required? true
Position? 1
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
-GatewayName <String>
Specifies the name of the gateway. This cmdlet encrypts data for the gateway that this parameter specifies.
Required? false
Position? 2
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-NonCredentialValue <String>
Specifies the non-credential part of the Open Database Connectivity (ODBC) connection string. This parameter is applicable only for the ODBC
linked service.
Required? false
Position? 5
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ResourceGroupName <String>
Specifies the name of an Azure resource group. This cmdlet encrypts data for the group that this parameter specifies.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Server <String>
Specifies the server name of the linked service.
Required? false
Position? 7
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. The acceptable values
for this parameter are:
- OnPremisesSqlLinkedService
- OnPremisesFileSystemLinkedService
- OnPremisesOracleLinkedService
- OnPremisesOdbcLinkedService
- OnPremisesPostgreSqlLinkedService
- OnPremisesTeradataLinkedService
- OnPremisesMySQLLinkedService
- OnPremisesDB2LinkedService
- OnPremisesSybaseLinkedService
Required? false
Position? 4
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Value <SecureString>
Specifies the value to encrypt. For an on-premises SQL Server linked service and an on-premises Oracle linked service, use a connection
string. For an on-premises ODBC linked service, use the credential part of the connection string. For on premises file system linked service,
if the file system is local to the gateway computer, use Local or localhost, and if the file system is on a server different from the gateway
computer, use \\\\servername.
Required? false
Position? 1
Default value None
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
This cmdlet does not accept any input.
OUTPUTS
System.String
NOTES
* Keywords: azure, azurerm, arm, resource, management, manager, data, factories
Example 1: Encrypt a non-ODBC connection string
PS C:\\>$Value = ConvertTo-SecureString 'Data Source=ContosoServer;Initial Catalog=catelog;user id =user123;password=password123' -AsPlainText
-Force
PS C:\\> New-AzureRmDataFactoryEncryptValue -GatewayName "WikiGateway" -DataFactoryName "WikiAdf" -Value $value -ResourceGroupName "ADF" -Type
OnPremisesSqlLinkedService
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 Server 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.
Example 2: Encrypt a non-ODBC connection string that uses Windows authentication.
PS C:\\>$Value = ConvertTo-SecureString 'Data Source=ContosoServer;Initial Catalog=catelog;Integrated Security=True' -AsPlainText -Force
PS C:\\> $Credential = Get-Credential
PS C:\\> New-AzureRmDataFactoryEncryptValue -DataFactoryName "WikiADF" -GatewayName "WikiGateway" -ResourceGroupName "ADF" -Value $Value
-Credential $Credential -Type OnPremisesSqlLinkedService $Value = ConvertTo-SecureString 'Data Source=ContosoServer;Initial
Catalog=catelog;Integrated Security=True' -AsPlainText -Force
The first command uses ConvertTo-SecureString to convert the specified connection string to a secure string object, and then stores that object in
the $Value variable.
The second command uses the Get-Credential cmdlet to collect the windows authentication (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.
Example 3: Encrypt server name and credentials for File system linked service
PS C:\\>$Value = ConvertTo-SecureString '\\\\servername' -AsPlainText -Force
PS C:\\> $Credential = Get-Credential
PS C:\\> New-AzureRmDataFactoryEncryptValue -DataFactoryName "WikiADF" -GatewayName "WikiGateway" -ResourceGroupName "ADF" -Value $Value
-Credential $Credential -Type OnPremisesFileSystemLinkedService
The first command uses ConvertTo-SecureString to convert the specified string to a secure string, and then stores that object in the $Value
variable.
The second command uses Get-Credential to collect the windows authentication (user name and password), and then stores that PSCredential object in
the $Credential variable.
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.
Example 4: Encrypt credentials for HDFS linked service
PS C:\\>$UserName = ConvertTo-SecureString "domain\\\\username" -AsPlainText -Force
$Password = ConvertTo-SecureString "password" -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($UserName, $Password)
New-AzureRmDataFactoryEncryptValue -DataFactoryName "MyDataFactory" -ResourceGroupName "MyResourceGroup" -GatewayName "MyDataManagementGateway"
-Type HdfsLinkedService -AuthenticationType Windows -Credential $Credential -NonCredentialValue
"http://server01.com:50070/webhdfs/v1/user/username"
The ConvertTo-SecureString command converts the specified string to a secure string. The New-Object command creates a PSCredential object using
the secure username and password strings. Instead, you could use the Get-Credential command to collect windows authentication (user name and
password), and then store the returned PSCredential object in the $credential variable as shown in previous examples.
The New-AzureRmDataFactoryEncryptValue command creates an encrypted value for the object stored in $Credential for the specified data factory,
gateway, resource group, and linked service type.
Example 5: Encrypt credentials for ODBC linked service
PS C:\\>$Content = ConvertTo-SecureString "UID=username@contoso;PWD=password;" -AsPlainText -Force
New-AzureRmDataFactoryEncryptValue -ResourceGroupName $RGName -DataFactoryName $DFName -GatewayName $Gateway -Type OnPremisesOdbcLinkedService
-AuthenticationType Basic -NonCredentialValue "Driver={SQL Server};Server=server01.database.contoso.net; Database=HDISScenarioTest;" -Value
$content
The ConvertTo-SecureString command converts the specified string to a secure string.
The New-AzureRmDataFactoryEncryptValue command creates an encrypted value for the object stored in $Value for the specified data factory, gateway,
resource group, and linked service type.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... cryptvalue
New-AzureRmDataFactoryEncryptValue
SYNOPSIS
Encrypts sensitive data.
SYNTAX
New-AzureRmDataFactoryEncryptValue [-DataFactory] <PSDataFactory> [[-Value] <SecureString>] [[-GatewayName] <String>] [[-Credential]
<PSCredential>] [[-Type] {OnPremisesSqlLinkedService | OnPremisesFileSystemLinkedService | OnPremisesOracleLinkedService |
OnPremisesOdbcLinkedService | OnPremisesPostgreSqlLinkedService | OnPremisesTeradataLinkedService | OnPremisesMySQLLinkedService |
OnPremisesDB2LinkedService | OnPremisesSybaseLinkedService | HdfsLinkedService}] [[-NonCredentialValue] <String>] [[-AuthenticationType] {Windows
| Basic | Anonymous}] [[-Server] <String>] [[-Database] <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
New-AzureRmDataFactoryEncryptValue [-ResourceGroupName] <String> [-DataFactoryName] <String> [[-Value] <SecureString>] [[-GatewayName] <String>]
[[-Credential] <PSCredential>] [[-Type] {OnPremisesSqlLinkedService | OnPremisesFileSystemLinkedService | OnPremisesOracleLinkedService |
OnPremisesOdbcLinkedService | OnPremisesPostgreSqlLinkedService | OnPremisesTeradataLinkedService | OnPremisesMySQLLinkedService |
OnPremisesDB2LinkedService | OnPremisesSybaseLinkedService | HdfsLinkedService}] [[-NonCredentialValue] <String>] [[-AuthenticationType] {Windows
| Basic | Anonymous}] [[-Server] <String>] [[-Database] <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
DESCRIPTION
The New-AzureRmDataFactoryEncryptValue cmdlet encrypts sensitive data, such as a password or a Microsoft SQL Server connection string, and returns
an encrypted value.
PARAMETERS
-AuthenticationType <String>
Specifies the type of authentication to be used to connect to the data source. The acceptable values for this parameter are:
- Windows
- Basic
- Anonymous.
Required? false
Position? 6
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.
Required? false
Position? 3
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Database <String>
Specifies the database name of the linked service.
Required? false
Position? 8
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DataFactory <PSDataFactory>
Specifies a PSDataFactory object. This cmdlet encrypts data for the data factory that this parameter specifies.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-DataFactoryName <String>
Specifies the name of a data factory. This cmdlet encrypts data for the data factory that this parameter specifies.
Required? true
Position? 1
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
-GatewayName <String>
Specifies the name of the gateway. This cmdlet encrypts data for the gateway that this parameter specifies.
Required? false
Position? 2
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-NonCredentialValue <String>
Specifies the non-credential part of the Open Database Connectivity (ODBC) connection string. This parameter is applicable only for the ODBC
linked service.
Required? false
Position? 5
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-ResourceGroupName <String>
Specifies the name of an Azure resource group. This cmdlet encrypts data for the group that this parameter specifies.
Required? true
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Server <String>
Specifies the server name of the linked service.
Required? false
Position? 7
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. The acceptable values
for this parameter are:
- OnPremisesSqlLinkedService
- OnPremisesFileSystemLinkedService
- OnPremisesOracleLinkedService
- OnPremisesOdbcLinkedService
- OnPremisesPostgreSqlLinkedService
- OnPremisesTeradataLinkedService
- OnPremisesMySQLLinkedService
- OnPremisesDB2LinkedService
- OnPremisesSybaseLinkedService
Required? false
Position? 4
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Value <SecureString>
Specifies the value to encrypt. For an on-premises SQL Server linked service and an on-premises Oracle linked service, use a connection
string. For an on-premises ODBC linked service, use the credential part of the connection string. For on premises file system linked service,
if the file system is local to the gateway computer, use Local or localhost, and if the file system is on a server different from the gateway
computer, use \\\\servername.
Required? false
Position? 1
Default value None
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
This cmdlet does not accept any input.
OUTPUTS
System.String
NOTES
* Keywords: azure, azurerm, arm, resource, management, manager, data, factories
Example 1: Encrypt a non-ODBC connection string
PS C:\\>$Value = ConvertTo-SecureString 'Data Source=ContosoServer;Initial Catalog=catelog;user id =user123;password=password123' -AsPlainText
-Force
PS C:\\> New-AzureRmDataFactoryEncryptValue -GatewayName "WikiGateway" -DataFactoryName "WikiAdf" -Value $value -ResourceGroupName "ADF" -Type
OnPremisesSqlLinkedService
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 Server 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.
Example 2: Encrypt a non-ODBC connection string that uses Windows authentication.
PS C:\\>$Value = ConvertTo-SecureString 'Data Source=ContosoServer;Initial Catalog=catelog;Integrated Security=True' -AsPlainText -Force
PS C:\\> $Credential = Get-Credential
PS C:\\> New-AzureRmDataFactoryEncryptValue -DataFactoryName "WikiADF" -GatewayName "WikiGateway" -ResourceGroupName "ADF" -Value $Value
-Credential $Credential -Type OnPremisesSqlLinkedService $Value = ConvertTo-SecureString 'Data Source=ContosoServer;Initial
Catalog=catelog;Integrated Security=True' -AsPlainText -Force
The first command uses ConvertTo-SecureString to convert the specified connection string to a secure string object, and then stores that object in
the $Value variable.
The second command uses the Get-Credential cmdlet to collect the windows authentication (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.
Example 3: Encrypt server name and credentials for File system linked service
PS C:\\>$Value = ConvertTo-SecureString '\\\\servername' -AsPlainText -Force
PS C:\\> $Credential = Get-Credential
PS C:\\> New-AzureRmDataFactoryEncryptValue -DataFactoryName "WikiADF" -GatewayName "WikiGateway" -ResourceGroupName "ADF" -Value $Value
-Credential $Credential -Type OnPremisesFileSystemLinkedService
The first command uses ConvertTo-SecureString to convert the specified string to a secure string, and then stores that object in the $Value
variable.
The second command uses Get-Credential to collect the windows authentication (user name and password), and then stores that PSCredential object in
the $Credential variable.
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.
Example 4: Encrypt credentials for HDFS linked service
PS C:\\>$UserName = ConvertTo-SecureString "domain\\\\username" -AsPlainText -Force
$Password = ConvertTo-SecureString "password" -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($UserName, $Password)
New-AzureRmDataFactoryEncryptValue -DataFactoryName "MyDataFactory" -ResourceGroupName "MyResourceGroup" -GatewayName "MyDataManagementGateway"
-Type HdfsLinkedService -AuthenticationType Windows -Credential $Credential -NonCredentialValue
"http://server01.com:50070/webhdfs/v1/user/username"
The ConvertTo-SecureString command converts the specified string to a secure string. The New-Object command creates a PSCredential object using
the secure username and password strings. Instead, you could use the Get-Credential command to collect windows authentication (user name and
password), and then store the returned PSCredential object in the $credential variable as shown in previous examples.
The New-AzureRmDataFactoryEncryptValue command creates an encrypted value for the object stored in $Credential for the specified data factory,
gateway, resource group, and linked service type.
Example 5: Encrypt credentials for ODBC linked service
PS C:\\>$Content = ConvertTo-SecureString "UID=username@contoso;PWD=password;" -AsPlainText -Force
New-AzureRmDataFactoryEncryptValue -ResourceGroupName $RGName -DataFactoryName $DFName -GatewayName $Gateway -Type OnPremisesOdbcLinkedService
-AuthenticationType Basic -NonCredentialValue "Driver={SQL Server};Server=server01.database.contoso.net; Database=HDISScenarioTest;" -Value
$content
The ConvertTo-SecureString command converts the specified string to a secure string.
The New-AzureRmDataFactoryEncryptValue command creates an encrypted value for the object stored in $Value for the specified data factory, gateway,
resource group, and linked service type.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... cryptvalue
New-AzureRmDataFactoryEncryptValue