Fixing migration extension to reflect latest RP changes (#15157)

* Fixing sms object

* extension vbump
This commit is contained in:
Aasim Khan
2021-04-16 05:20:07 -07:00
committed by GitHub
parent 0a707c2b96
commit 47584544e2
4 changed files with 17 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
"name": "sql-migration",
"displayName": "%displayName%",
"description": "%description%",
"version": "0.0.8",
"version": "0.0.9",
"publisher": "Microsoft",
"preview": true,
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",

View File

@@ -127,6 +127,7 @@ export async function getSqlMigrationService(account: azdata.Account, subscripti
if (response.errors.length > 0) {
throw new Error(response.errors.toString());
}
response.response.data.properties.resourceGroup = getResourceGroupFromId(response.response.data.id);
return response.response.data;
}
@@ -138,6 +139,9 @@ export async function getSqlMigrationServices(account: azdata.Account, subscript
throw new Error(response.errors.toString());
}
sortResourceArrayByName(response.response.data.value);
response.response.data.value.forEach((sms: SqlMigrationService) => {
sms.properties.resourceGroup = getResourceGroupFromId(sms.id);
});
return response.response.data.value;
}
@@ -287,6 +291,10 @@ function sortResourceArrayByName(resourceArray: SortableAzureResources[]): void
});
}
function getResourceGroupFromId(id: string): string {
return id.replace(RegExp('^(.*?)/resourceGroups/'), '').replace(RegExp('/providers/.*'), '').toLowerCase();
}
export interface SqlMigrationServiceProperties {
name: string;
subscriptionId: string;

View File

@@ -648,7 +648,7 @@ export class MigrationStateModel implements Model, vscode.Disposable {
});
const requestBody: StartDatabaseMigrationRequest = {
location: this._sqlMigrationService?.properties.location!,
location: this._sqlMigrationService?.location!,
properties: {
sourceDatabaseName: '',
migrationService: this._sqlMigrationService?.id!,
@@ -682,7 +682,7 @@ export class MigrationStateModel implements Model, vscode.Disposable {
const response = await startDatabaseMigration(
this._azureAccount,
this._targetSubscription,
this._sqlMigrationService?.properties.location!,
this._sqlMigrationService?.location!,
this._targetServerInstance,
this._targetDatabaseNames[i],
requestBody

View File

@@ -172,14 +172,14 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
this.migrationStateModel._azureAccount,
this.migrationStateModel._targetSubscription,
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
this.migrationStateModel._sqlMigrationService.properties.location,
this.migrationStateModel._sqlMigrationService.location,
this.migrationStateModel._sqlMigrationService.name);
this.migrationStateModel._sqlMigrationService = migrationService;
const migrationServiceMonitoringStatus = await getSqlMigrationServiceMonitoringData(
this.migrationStateModel._azureAccount,
this.migrationStateModel._targetSubscription,
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
this.migrationStateModel._sqlMigrationService.properties.location,
this.migrationStateModel._sqlMigrationService.location,
this.migrationStateModel._sqlMigrationService!.name);
this.migrationStateModel._nodeNames = migrationServiceMonitoringStatus.nodes.map((node) => {
return node.nodeName;
@@ -188,7 +188,7 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
this.migrationStateModel._azureAccount,
this.migrationStateModel._targetSubscription,
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
this.migrationStateModel._sqlMigrationService.properties.location,
this.migrationStateModel._sqlMigrationService.location,
this.migrationStateModel._sqlMigrationService!.name
);
@@ -239,14 +239,14 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
this.migrationStateModel._azureAccount,
this.migrationStateModel._targetSubscription,
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
this.migrationStateModel._sqlMigrationService.properties.location,
this.migrationStateModel._sqlMigrationService.location,
this.migrationStateModel._sqlMigrationService.name);
this.migrationStateModel._sqlMigrationService = migrationService;
const migrationServiceMonitoringStatus = await getSqlMigrationServiceMonitoringData(
this.migrationStateModel._azureAccount,
this.migrationStateModel._targetSubscription,
this.migrationStateModel._sqlMigrationService.properties.resourceGroup,
this.migrationStateModel._sqlMigrationService.properties.location,
this.migrationStateModel._sqlMigrationService.location,
this.migrationStateModel._sqlMigrationService!.name);
this.migrationStateModel._nodeNames = migrationServiceMonitoringStatus.nodes.map((node) => {
return node.nodeName;
@@ -399,7 +399,7 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
migrationServiceTitle,
createInformationRow(this._view, constants.SUBSCRIPTION, this.migrationStateModel._targetSubscription.name),
createInformationRow(this._view, constants.RESOURCE_GROUP, migrationService.properties.resourceGroup),
createInformationRow(this._view, constants.LOCATION, await this.migrationStateModel.getLocationDisplayName(migrationService.properties.location)),
createInformationRow(this._view, constants.LOCATION, await this.migrationStateModel.getLocationDisplayName(migrationService.location)),
connectionLabelContainer,
connectionStatusLoader,
authenticationKeysLabel,