Fixing setTargetServerName in SqlMigration extension. Previously if a case was entered it would run all code in the following cases as well (#22477)

This commit is contained in:
Austin Bryan
2023-03-29 13:44:29 -07:00
committed by GitHub
parent 4867a3747c
commit 7ecbbdf398

View File

@@ -1328,14 +1328,17 @@ export class MigrationStateModel implements Model, vscode.Disposable {
case MigrationTargetType.SQLMI:
const sqlMi = this._targetServerInstance as SqlManagedInstance;
this._targetServerName = sqlMi.properties.fullyQualifiedDomainName;
break;
case MigrationTargetType.SQLDB:
const sqlDb = this._targetServerInstance as AzureSqlDatabaseServer;
this._targetServerName = sqlDb.properties.fullyQualifiedDomainName;
break;
case MigrationTargetType.SQLVM:
// For sqlvm, we need to use ip address from the network interface to connect to the server
const sqlVm = this._targetServerInstance as SqlVMServer;
const networkInterfaces = Array.from(sqlVm.networkInterfaces.values());
this._targetServerName = NetworkInterfaceModel.getIpAddress(networkInterfaces);
break;
}
}