fix dacpac wizard not using correct connection (#21387)

This commit is contained in:
Kim Santiago
2022-12-12 10:14:08 -08:00
committed by GitHub
parent 6cfa0910b6
commit 146d64435a

View File

@@ -101,7 +101,16 @@ export class DataTierApplicationWizard {
this.model.database = profile.databaseName;
}
this.connection = await azdata.connection.getCurrentConnection();
// get the connection of the node the wizard was launched from
if (profile?.id) {
this.connection = await azdata.connection.getConnection(await azdata.connection.getUriForConnection((profile.id)));
}
// if no profile was passed in if launched from command palette, try using the current active connection
if (!this.connection) {
this.connection = await azdata.connection.getCurrentConnection();
}
if (!this.connection || (profile && this.connection.connectionId !== profile.id)) {
// check if there are any active connections
const connections = await azdata.connection.getConnections(true);