mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 09:35:39 -05:00
[SQL Migration] Properly respect user's encryptConnection and trustServerCertificate settings (#21824)
* WIP * Always get latest current connection * Update more references * Clean up * Clean up * vbump * Update comments * Address PR feedback * Separate into helper methods
This commit is contained in:
@@ -628,6 +628,7 @@ export async function getLocationDisplayName(location: string): Promise<string>
|
||||
export async function validateIrSqlDatabaseMigrationSettings(
|
||||
migration: MigrationStateModel,
|
||||
sourceServerName: string,
|
||||
encryptConnection: boolean,
|
||||
trustServerCertificate: boolean,
|
||||
sourceDatabaseName: string,
|
||||
targetDatabaseName: string,
|
||||
@@ -654,17 +655,18 @@ export async function validateIrSqlDatabaseMigrationSettings(
|
||||
userName: migration._sqlServerUsername,
|
||||
password: migration._sqlServerPassword,
|
||||
authentication: migration._authenticationType,
|
||||
encryptConnection: encryptConnection,
|
||||
trustServerCertificate: trustServerCertificate,
|
||||
// encryptConnection: true,
|
||||
},
|
||||
targetSqlConnection: {
|
||||
testConnectivity: testTargetConnectivity,
|
||||
dataSource: targetDatabaseServer.properties.fullyQualifiedDomainName,
|
||||
userName: migration._targetUserName,
|
||||
password: migration._targetPassword,
|
||||
authentication: MigrationSourceAuthenticationType.Sql,
|
||||
// when connecting to a target Azure SQL DB, use true/false
|
||||
encryptConnection: true,
|
||||
trustServerCertificate: false,
|
||||
authentication: MigrationSourceAuthenticationType.Sql,
|
||||
}
|
||||
};
|
||||
|
||||
@@ -686,6 +688,7 @@ export async function validateIrSqlDatabaseMigrationSettings(
|
||||
export async function validateIrDatabaseMigrationSettings(
|
||||
migration: MigrationStateModel,
|
||||
sourceServerName: string,
|
||||
encryptConnection: boolean,
|
||||
trustServerCertificate: boolean,
|
||||
sourceDatabaseName: string,
|
||||
networkShare: NetworkShare,
|
||||
@@ -728,7 +731,7 @@ export async function validateIrDatabaseMigrationSettings(
|
||||
dataSource: sourceServerName,
|
||||
userName: migration._sqlServerUsername,
|
||||
password: migration._sqlServerPassword,
|
||||
// to-do: use correct value of encryptConnection and trustServerCertificate
|
||||
encryptConnection: encryptConnection,
|
||||
trustServerCertificate: trustServerCertificate,
|
||||
authentication: migration._authenticationType,
|
||||
}
|
||||
@@ -954,8 +957,8 @@ export interface ValdiateIrDatabaseMigrationResponse {
|
||||
sourceDatabaseName: string,
|
||||
sourceSqlConnection: {
|
||||
testConnectivity: boolean,
|
||||
encryptConnection: true,
|
||||
trustServerCertificate: false,
|
||||
encryptConnection: boolean,
|
||||
trustServerCertificate: boolean,
|
||||
dataSource: string,
|
||||
},
|
||||
backupConfiguration: {
|
||||
@@ -1042,15 +1045,6 @@ export interface CopyProgressDetail {
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
export interface SqlConnectionInfo {
|
||||
dataSource: string;
|
||||
authentication: string;
|
||||
username: string;
|
||||
password: string;
|
||||
encryptConnection: string;
|
||||
trustServerCertificate: string;
|
||||
}
|
||||
|
||||
export interface BackupConfiguration {
|
||||
sourceLocation?: SourceLocation;
|
||||
targetLocation?: TargetLocation;
|
||||
|
||||
Reference in New Issue
Block a user