Fix connecting to MI login bug (#21821)

This PR fixes a regression for migration login for MI instances that was introduced in https://github.com/microsoft/azuredatastudio/pull/21776/files#diff-93c1a62583fa32d99f775b71ad27922cf31f660d10717ecc6966784306de1b6f.

After that change, support for MI would fail as MI server types were going into the Sql VM path in sqlutils because the underlying logic for isSqlServerVM() was returning wrong results.

The new approach uses the targetType set in StateMachine to extract the correct serverName for connection string based on the targetType.

Testing:
- Tested SQL VM login migration end to end
- Tested SQL MI login migration end to end


This change also bumps the sql-migration version to 1.3.0
This commit is contained in:
AkshayMata
2023-02-03 06:43:39 -08:00
committed by GitHub
parent 8f638be687
commit 9f5f49e956
6 changed files with 42 additions and 55 deletions

View File

@@ -194,10 +194,6 @@ export interface AzureSqlDatabaseServer {
},
}
export function isAzureSqlDatabaseServer(instance: any): instance is AzureSqlDatabaseServer {
return (instance as AzureSqlDatabaseServer) !== undefined;
}
export type SqlVMServer = {
properties: {
virtualMachineResourceId: string,
@@ -215,10 +211,6 @@ export type SqlVMServer = {
networkInterfaces: Map<string, NetworkInterface>,
};
export function isSqlVMServer(instance: any): instance is SqlVMServer {
return (instance as SqlVMServer) !== undefined;
}
export type VirtualMachineInstanceView = {
computerName: string,
osName: string,