The New-AzDataFactoryEncryptValue cmdlet encrypts sensitive data, such as a password or a Microsoft SQL Server connection string, and returns an encrypted value.
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.
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
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
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-AzDataFactoryEncryptValue 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
The ConvertTo-SecureString command converts the specified string to a secure string.
The New-AzDataFactoryEncryptValue command creates an encrypted value for the object stored in $Value for the specified data factory, gateway, resource group, and linked service type.
Parameters
-AuthenticationType
Specifies the type of authentication to be used to connect to the data source.
The acceptable values for this parameter are:
Specifies the non-credential part of the Open Database Connectivity (ODBC) connection string.
This parameter is applicable only for the ODBC linked service.
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:
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.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.