Adding support for sql vm and some target page UI fixes. (#14571)

* Added SQL VM dropdown
Fixed the icons in cards

* Added a better api for sql vms

* Making some PR related changes
1. Using map instead of foreach
This commit is contained in:
Aasim Khan
2021-03-05 13:32:29 -08:00
committed by GitHub
parent df06afa2ab
commit 63c59ed920
9 changed files with 151 additions and 65 deletions

View File

@@ -0,0 +1,20 @@
<svg width="33" height="33" viewBox="0 0 33 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M31.7917 0.677246H1.08889C0.487512 0.677246 0 1.19041 0 1.82343V22.5979C0 23.2309 0.487512 23.7441 1.08889 23.7441H31.7917C32.393 23.7441 32.8806 23.2309 32.8806 22.5979V1.82343C32.8806 1.19041 32.393 0.677246 31.7917 0.677246Z" fill="url(#paint0_linear)"/>
<path d="M23.0414 30.7439C19.7942 30.2118 19.6581 27.7352 19.6775 23.7645H13.222C13.222 27.7352 13.1053 30.2118 9.8581 30.7439C9.398 30.8224 8.97998 31.0722 8.68018 31.4479C8.38039 31.8236 8.21877 32.3001 8.22477 32.7907H24.6748C24.6808 32.3001 24.5192 31.8236 24.2194 31.4479C23.9196 31.0722 23.5015 30.8224 23.0414 30.7439Z" fill="url(#paint1_linear)"/>
<path d="M24.3635 14.4109V7.2882H22.419V15.9869H27.3385V14.4109H24.3635ZM10.0912 10.8905C9.72556 10.7342 9.38462 10.5203 9.08012 10.256C8.99427 10.1649 8.92743 10.056 8.8839 9.93614C8.84037 9.8163 8.82111 9.68822 8.82734 9.56009C8.82386 9.43524 8.85059 9.31151 8.90501 9.20052C8.95943 9.08953 9.03976 8.99493 9.13845 8.92559C9.38599 8.75567 9.67991 8.67652 9.97457 8.70045C10.6664 8.67368 11.3481 8.88178 11.919 9.29401V7.49287C11.2967 7.2519 10.6375 7.13394 9.97457 7.14493C9.18494 7.10452 8.40703 7.35815 7.77734 7.86129C7.51045 8.08574 7.29747 8.37313 7.1556 8.70024C7.01373 9.02735 6.94696 9.385 6.96068 9.74429C6.9784 10.2972 7.15001 10.8325 7.45421 11.2837C7.7584 11.7349 8.18178 12.0821 8.67179 12.2823C9.11327 12.4699 9.52605 12.7251 9.89679 13.0396C9.9949 13.119 10.0741 13.2214 10.1281 13.3386C10.1821 13.4558 10.2094 13.5847 10.2079 13.715C10.2079 13.8421 10.1798 13.9674 10.1258 14.0811C10.0718 14.1948 9.99339 14.2937 9.89679 14.3699C9.65542 14.5414 9.3713 14.634 9.08012 14.636C8.27381 14.6272 7.49871 14.3067 6.90234 13.7354V15.7822C7.56481 16.1324 8.30039 16.3013 9.04123 16.2734C9.8871 16.2838 10.7131 16.0035 11.394 15.4752C11.6735 15.251 11.8973 14.9589 12.0463 14.6238C12.1953 14.2888 12.265 13.9208 12.2496 13.5512C12.2614 13.2827 12.2228 13.0143 12.1361 12.7615C12.0493 12.5086 11.9161 12.2762 11.744 12.0776C11.2758 11.5673 10.7133 11.1633 10.0912 10.8905ZM20.4746 14.2471C20.9311 13.4446 21.1605 12.5215 21.1357 11.5864C21.1462 10.7839 20.9727 9.99052 20.6301 9.27354C20.3185 8.61641 19.8321 8.06884 19.2301 7.69755C18.6376 7.34117 17.9681 7.15089 17.2857 7.14493C16.5311 7.13501 15.7872 7.33255 15.1273 7.71801C14.491 8.09693 13.9765 8.66703 13.6496 9.35541C13.2599 10.0947 13.0527 10.9251 13.0468 11.7706C13.0395 12.5353 13.1992 13.2916 13.5135 13.9811C13.8289 14.6234 14.3066 15.1616 14.894 15.5366C15.4813 15.9136 16.151 16.1251 16.8385 16.1506L18.5496 18.1974H20.9607L18.6079 15.8231C19.3883 15.5481 20.0501 14.9894 20.4746 14.2471ZM18.5301 13.715C18.3511 13.9558 18.1202 14.1483 17.8564 14.2764C17.5927 14.4046 17.3037 14.4647 17.0135 14.4518C16.7211 14.4658 16.4299 14.4041 16.1655 14.272C15.9011 14.14 15.6715 13.9417 15.4968 13.6945C15.0833 13.1038 14.8772 12.3805 14.9135 11.6478C14.8804 10.9154 15.0862 10.1932 15.4968 9.60102C15.6839 9.35809 15.9214 9.16352 16.191 9.03224C16.4607 8.90096 16.7553 8.83647 17.0523 8.84373C17.342 8.82952 17.6304 8.89128 17.8918 9.02347C18.1531 9.15565 18.3791 9.35411 18.5496 9.60102C18.9356 10.2038 19.1265 10.9216 19.094 11.6478C19.1715 12.3758 18.9991 13.109 18.6079 13.715H18.5301Z" fill="url(#paint2_radial)"/>
<defs>
<linearGradient id="paint0_linear" x1="16.45" y1="23.7646" x2="16.45" y2="0.677246" gradientUnits="userSpaceOnUse">
<stop stop-color="#0078D4"/>
<stop offset="0.82" stop-color="#5EA0EF"/>
</linearGradient>
<linearGradient id="paint1_linear" x1="16.4498" y1="32.6883" x2="16.4498" y2="23.7645" gradientUnits="userSpaceOnUse">
<stop offset="0.15" stop-color="#CCCCCC"/>
<stop offset="1" stop-color="#707070"/>
</linearGradient>
<radialGradient id="paint2_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(17.2857 12.6507) scale(14.1361 14.8798)">
<stop stop-color="#F2F2F2"/>
<stop offset="0.58" stop-color="#EEEEEE"/>
<stop offset="1" stop-color="#E6E6E6"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -38,15 +38,14 @@ export async function getResourceGroups(account: azdata.Account, subscription: S
export type SqlManagedInstance = AzureProduct;
export async function getAvailableManagedInstanceProducts(account: azdata.Account, subscription: Subscription): Promise<SqlManagedInstance[]> {
const api = await getAzureCoreAPI();
const result = await api.getSqlManagedInstances(account, [subscription], false);
sortResourceArrayByName(result.resources);
return result.resources;
}
export type SqlServer = AzureProduct;
export async function getAvailableSqlServers(account: azdata.Account, subscription: Subscription): Promise<SqlServer[]> {
const api = await getAzureCoreAPI();
const result = await api.getSqlServers(account, [subscription], false);
return result.resources;
}
@@ -54,9 +53,13 @@ export async function getAvailableSqlServers(account: azdata.Account, subscripti
export type SqlVMServer = AzureProduct;
export async function getAvailableSqlVMs(account: azdata.Account, subscription: Subscription): Promise<SqlVMServer[]> {
const api = await getAzureCoreAPI();
const result = await api.getSqlVMServers(account, [subscription], false);
return result.resources;
const path = `/subscriptions/${subscription.id}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines?api-version=2017-03-01-preview`;
const response = await api.makeAzureRestRequest(account, subscription, path, azurecore.HttpRequestMethod.GET, undefined, true);
if (response.errors.length > 0) {
throw new Error(response.errors.toString());
}
sortResourceArrayByName(response.response.data.value);
return response.response.data.value;
}
export type StorageAccount = AzureProduct;
@@ -159,10 +162,10 @@ export async function getMigrationControllerMonitoringData(account: azdata.Accou
return response.response.data;
}
export async function startDatabaseMigration(account: azdata.Account, subscription: Subscription, resourceGroupName: string, regionName: string, managedInstance: string, targetDatabaseName: string, requestBody: StartDatabaseMigrationRequest): Promise<StartDatabaseMigrationResponse> {
export async function startDatabaseMigration(account: azdata.Account, subscription: Subscription, regionName: string, targetServer: SqlManagedInstance | SqlVMServer, targetDatabaseName: string, requestBody: StartDatabaseMigrationRequest): Promise<StartDatabaseMigrationResponse> {
const api = await getAzureCoreAPI();
const host = `https://${regionName}.management.azure.com`;
const path = `/subscriptions/${subscription.id}/resourceGroups/${resourceGroupName}/providers/Microsoft.Sql/managedInstances/${managedInstance}/providers/Microsoft.DataMigration/databaseMigrations/${targetDatabaseName}?api-version=2020-09-01-preview`;
const path = `${targetServer.id}/providers/Microsoft.DataMigration/databaseMigrations/${targetDatabaseName}?api-version=2020-09-01-preview`;
const response = await api.makeAzureRestRequest(account, subscription, path, azurecore.HttpRequestMethod.PUT, requestBody, true, host);
if (response.errors.length > 0) {
throw new Error(response.errors.toString());

View File

@@ -136,6 +136,7 @@ export const CONTROLLER_NOT_FOUND = localize('sql.migration.controller.not.found
export const CONTROLLER_NOT_SETUP_ERROR = localize('sql.migration.controller.not.setup', "Please add a migration controller to proceed.");
export const MANAGED_INSTANCE = localize('sql.migration.managed.instance', "Azure SQL managed instance");
export const NO_MANAGED_INSTANCE_FOUND = localize('sql.migration.no.managedInstance.found', "No managed instance found");
export const NO_VIRTUAL_MACHINE_FOUND = localize('sql.migration.no.virtualMachine.found', "No virtual machine found");
export const TARGET_SELECTION_PAGE_TITLE = localize('sql.migration.target.page.title', "Choose the target Azure SQL");
// common strings

View File

@@ -49,9 +49,11 @@ export const ProductLookupTable: { [key in MigrationProductType]: Product } = {
'AzureSQLMI': {
type: 'AzureSQLMI',
name: localize('sql.migration.products.azuresqlmi.name', 'Azure Managed Instance (Microsoft managed)'),
icon: 'sqlMI.svg'
},
'AzureSQLVM': {
type: 'AzureSQLVM',
name: localize('sql.migration.products.azuresqlvm.name', 'Azure SQL Virtual Machine (Customer managed)'),
icon: 'sqlVM.svg'
}
};

View File

@@ -7,10 +7,12 @@ import * as azdata from 'azdata';
import { azureResource } from 'azureResource';
import * as vscode from 'vscode';
import * as mssql from '../../../mssql';
import { getAvailableManagedInstanceProducts, getAvailableStorageAccounts, getBlobContainers, getFileShares, getMigrationControllers, getSubscriptions, SqlMigrationController, SqlManagedInstance, startDatabaseMigration, StartDatabaseMigrationRequest, StorageAccount } from '../api/azure';
import { getAvailableManagedInstanceProducts, getAvailableStorageAccounts, getBlobContainers, getFileShares, getMigrationControllers, getSubscriptions, SqlMigrationController, SqlManagedInstance, startDatabaseMigration, StartDatabaseMigrationRequest, StorageAccount, getAvailableSqlVMs, SqlVMServer } from '../api/azure';
import { SKURecommendations } from './externalContract';
import * as constants from '../constants/strings';
import { MigrationLocalStorage } from './migrationLocalStorage';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
export enum State {
INIT,
@@ -82,8 +84,8 @@ export class MigrationStateModel implements Model, vscode.Disposable {
public _targetSubscription!: azureResource.AzureResourceSubscription;
public _targetManagedInstances!: SqlManagedInstance[];
public _targetManagedInstance!: SqlManagedInstance;
public _targetSqlVirtualMachines!: SqlVMServer[];
public _targetServerInstance!: SqlManagedInstance;
public _databaseBackup!: DatabaseBackupModel;
public _migrationDbs: string[] = [];
public _storageAccounts!: StorageAccount[];
@@ -266,6 +268,41 @@ export class MigrationStateModel implements Model, vscode.Disposable {
return this._targetManagedInstances[index];
}
public async getSqlVirtualMachineValues(subscription: azureResource.AzureResourceSubscription): Promise<azdata.CategoryValue[]> {
let virtualMachineValues: azdata.CategoryValue[] = [];
try {
this._targetSqlVirtualMachines = await getAvailableSqlVMs(this._azureAccount, subscription);
virtualMachineValues = this._targetSqlVirtualMachines.map((virtualMachine) => {
return {
name: virtualMachine.id,
displayName: `${virtualMachine.name}`
};
});
if (virtualMachineValues.length === 0) {
virtualMachineValues = [
{
displayName: constants.NO_VIRTUAL_MACHINE_FOUND,
name: ''
}
];
}
} catch (e) {
console.log(e);
virtualMachineValues = [
{
displayName: constants.NO_VIRTUAL_MACHINE_FOUND,
name: ''
}
];
}
return virtualMachineValues;
}
public getVirtualMachine(index: number): SqlVMServer {
return this._targetSqlVirtualMachines[index];
}
public async getStorageAccountValues(subscription: azureResource.AzureResourceSubscription): Promise<azdata.CategoryValue[]> {
let storageAccountValues: azdata.CategoryValue[] = [];
try {
@@ -441,7 +478,7 @@ export class MigrationStateModel implements Model, vscode.Disposable {
Username: currentConnection?.userName!,
Password: connectionPassword.password
},
Scope: this._targetManagedInstance.id
Scope: this._targetServerInstance.id
}
};
@@ -452,10 +489,9 @@ export class MigrationStateModel implements Model, vscode.Disposable {
const response = await startDatabaseMigration(
this._azureAccount,
this._targetSubscription,
this._targetManagedInstance.resourceGroup!,
this._migrationController?.properties.location!,
this._targetManagedInstance.name,
currentConnection?.databaseName!,
this._targetServerInstance,
db,
requestBody
);
@@ -463,12 +499,12 @@ export class MigrationStateModel implements Model, vscode.Disposable {
MigrationLocalStorage.saveMigration(
currentConnection!,
response.databaseMigration,
this._targetManagedInstance,
this._targetServerInstance,
this._azureAccount,
this._targetSubscription,
this._migrationController
);
vscode.window.showInformationMessage(`Starting migration for database ${db} to ${this._targetManagedInstance.name}`);
vscode.window.showInformationMessage(localize("sql.migration.starting.migration.message", 'Starting migration for database {0} to {1}', db, this._targetServerInstance.name));
}
} catch (e) {
vscode.window.showInformationMessage(e);

View File

@@ -150,7 +150,7 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
public async populateMigrationController(): Promise<void> {
this.migrationControllerDropdown.loading = true;
try {
this.migrationControllerDropdown.values = await this.migrationStateModel.getMigrationControllerValues(this.migrationStateModel._targetSubscription, this.migrationStateModel._targetManagedInstance);
this.migrationControllerDropdown.values = await this.migrationStateModel.getMigrationControllerValues(this.migrationStateModel._targetSubscription, this.migrationStateModel._targetServerInstance);
if (this.migrationStateModel._migrationController) {
this.migrationControllerDropdown.value = {
name: this.migrationStateModel._migrationController.id,

View File

@@ -30,7 +30,8 @@ export class SKURecommendationPage extends MigrationWizardPage {
private _chooseTargetComponent: azdata.FormComponent<azdata.DivContainer> | undefined;
private _azureSubscriptionText: azdata.FormComponent<azdata.TextComponent> | undefined;
private _managedInstanceSubscriptionDropdown!: azdata.DropDownComponent;
private _managedInstanceDropdown!: azdata.DropDownComponent;
private _resourceDropdownLabel!: azdata.TextComponent;
private _resourceDropdown!: azdata.DropDownComponent;
private _view: azdata.ModelView | undefined;
private _rbg!: azdata.RadioCardGroupComponent;
@@ -48,20 +49,27 @@ export class SKURecommendationPage extends MigrationWizardPage {
this._managedInstanceSubscriptionDropdown.onValueChanged((e) => {
if (e.selected) {
this.migrationStateModel._targetSubscription = this.migrationStateModel.getSubscription(e.index);
this.migrationStateModel._targetManagedInstance = undefined!;
this.migrationStateModel._targetServerInstance = undefined!;
this.migrationStateModel._migrationController = undefined!;
this.populateManagedInstanceDropdown();
this.populateResourceInstanceDropdown();
}
});
const managedInstanceDropdownLabel = view.modelBuilder.text().withProps({
this._resourceDropdownLabel = view.modelBuilder.text().withProps({
value: constants.MANAGED_INSTANCE
}).component();
this._managedInstanceDropdown = view.modelBuilder.dropDown().component();
this._managedInstanceDropdown.onValueChanged((e) => {
if (e.selected) {
this._resourceDropdown = view.modelBuilder.dropDown().component();
this._resourceDropdown.onValueChanged((e) => {
if (e.selected &&
e.selected !== constants.NO_MANAGED_INSTANCE_FOUND &&
e.selected !== constants.NO_VIRTUAL_MACHINE_FOUND) {
this.migrationStateModel._migrationControllers = undefined!;
this.migrationStateModel._targetManagedInstance = this.migrationStateModel.getManagedInstance(e.index);
if (this._rbg.selectedCardId === 'AzureSQLVM') {
this.migrationStateModel._targetServerInstance = this.migrationStateModel.getVirtualMachine(e.index);
} else {
this.migrationStateModel._targetServerInstance = this.migrationStateModel.getManagedInstance(e.index);
}
}
});
@@ -69,8 +77,8 @@ export class SKURecommendationPage extends MigrationWizardPage {
[
managedInstanceSubscriptionDropdownLabel,
this._managedInstanceSubscriptionDropdown,
managedInstanceDropdownLabel,
this._managedInstanceDropdown
this._resourceDropdownLabel,
this._resourceDropdown
]
).withLayout({
flexFlow: 'column'
@@ -151,41 +159,49 @@ export class SKURecommendationPage extends MigrationWizardPage {
this._rbg = this._view!.modelBuilder.radioCardGroup().withProperties<azdata.RadioCardGroupComponentProperties>({
cards: [],
cardWidth: '600px',
cardHeight: '60px',
cardHeight: '40px',
orientation: azdata.Orientation.Vertical,
iconHeight: '30px',
iconWidth: '30px'
}).component();
products.forEach((product) => {
const imagePath = path.resolve(this.migrationStateModel.getExtensionPath(), 'media', product.icon ?? 'ads.svg');
let dbCount = 0;
if (product.type === 'AzureSQLVM') {
dbCount = 0;
} else {
dbCount = this.migrationStateModel._migrationDbs.length;
}
const imagePath = path.resolve(this.migrationStateModel.getExtensionPath(), 'images', product.icon ?? 'ads.svg');
const dbCount = this.migrationStateModel._migrationDbs.length;
const descriptions: azdata.RadioCardDescription[] = [
{
textValue: product.name,
linkDisplayValue: 'Learn more',
displayLinkCodicon: true,
textStyles: {
'font-size': '1rem',
'font-weight': 550,
'font-size': '14px',
'font-weight': 'bold',
'line-height': '20px'
},
linkDisplayValue: 'Learn more',
linkStyles: {
'font-size': '14px',
'line-height': '20px'
},
displayLinkCodicon: true,
linkCodiconStyles: {
'font-size': '1em',
'color': 'royalblue'
}
'font-size': '14px',
'line-height': '20px'
},
},
{
textValue: `${dbCount} databases will be migrated`,
textStyles: {
'font-size': '13px',
'line-height': '18px'
},
linkStyles: {
'font-size': '14px',
'line-height': '20px'
},
linkDisplayValue: 'View/Change',
displayLinkCodicon: true,
linkCodiconStyles: {
'font-size': '1em',
'color': 'royalblue'
'font-size': '13px',
'line-height': '18px'
}
}
];
@@ -206,10 +222,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
});
this._rbg.onSelectionChanged((value) => {
if (value.cardId === 'AzureSQLVM') {
vscode.window.showInformationMessage('Feature coming soon');
this._rbg.selectedCardId = 'AzureSQLMI';
}
this.populateResourceInstanceDropdown();
});
this._rbg.selectedCardId = 'AzureSQLMI';
@@ -220,7 +233,10 @@ export class SKURecommendationPage extends MigrationWizardPage {
private createAzureSubscriptionText(view: azdata.ModelView): azdata.FormComponent<azdata.TextComponent> {
const component = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'Select an Azure subscription and an Azure SQL Managed Instance for your target.', //TODO: Localize
CSSStyles: {
'font-size': '13px',
'line-height': '18px'
}
});
return {
@@ -232,7 +248,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
private async populateSubscriptionDropdown(): Promise<void> {
if (!this.migrationStateModel._targetSubscription) {
this._managedInstanceSubscriptionDropdown.loading = true;
this._managedInstanceDropdown.loading = true;
this._resourceDropdown.loading = true;
try {
this._managedInstanceSubscriptionDropdown.values = await this.migrationStateModel.getSubscriptionsDropdownValues();
} catch (e) {
@@ -243,16 +259,21 @@ export class SKURecommendationPage extends MigrationWizardPage {
}
}
private async populateManagedInstanceDropdown(): Promise<void> {
if (!this.migrationStateModel._targetManagedInstance) {
this._managedInstanceDropdown.loading = true;
try {
this._managedInstanceDropdown.values = await this.migrationStateModel.getManagedInstanceValues(this.migrationStateModel._targetSubscription);
} catch (e) {
console.log(e);
} finally {
this._managedInstanceDropdown.loading = false;
private async populateResourceInstanceDropdown(): Promise<void> {
this._resourceDropdown.loading = true;
try {
if (this._rbg.selectedCardId === 'AzureSQLVM') {
this._resourceDropdownLabel.value = constants.AZURE_SQL_DATABASE_VIRTUAL_MACHINE;
this._resourceDropdown.values = await this.migrationStateModel.getSqlVirtualMachineValues(this.migrationStateModel._targetSubscription);
} else {
this._resourceDropdownLabel.value = constants.AZURE_SQL_DATABASE_MANAGED_INSTANCE;
this._resourceDropdown.values = await this.migrationStateModel.getManagedInstanceValues(this.migrationStateModel._targetSubscription);
}
} catch (e) {
console.log(e);
} finally {
this._resourceDropdown.loading = false;
}
}
@@ -278,7 +299,8 @@ export class SKURecommendationPage extends MigrationWizardPage {
if ((<azdata.CategoryValue>this._managedInstanceSubscriptionDropdown.value).displayName === constants.NO_SUBSCRIPTIONS_FOUND) {
errors.push(constants.INVALID_SUBSCRIPTION_ERROR);
}
if ((<azdata.CategoryValue>this._managedInstanceDropdown.value).displayName === constants.NO_MANAGED_INSTANCE_FOUND) {
const resourceDropdownValue = (<azdata.CategoryValue>this._resourceDropdown.value).displayName;
if (resourceDropdownValue === constants.NO_MANAGED_INSTANCE_FOUND || resourceDropdownValue === constants.NO_VIRTUAL_MACHINE_FOUND) {
errors.push(constants.INVALID_STORAGE_ACCOUNT_ERROR);
}
@@ -317,6 +339,8 @@ export class SKURecommendationPage extends MigrationWizardPage {
};
const textValue: string = `${count} databases will be migrated`;
this._rbg.cards[0].descriptions[1].textValue = textValue;
this._rbg.cards[1].descriptions[1].textValue = textValue;
this._rbg.updateProperties({
cards: this._rbg.cards
});

View File

@@ -39,9 +39,9 @@ export class SummaryPage extends MigrationWizardPage {
createHeadingTextComponent(this._view, constants.AZURE_ACCOUNT_LINKED),
createHeadingTextComponent(this._view, this.migrationStateModel._azureAccount.displayInfo.displayName),
createHeadingTextComponent(this._view, constants.MIGRATION_TARGET),
createInformationRow(this._view, constants.TYPE, constants.SUMMARY_MI_TYPE),
createInformationRow(this._view, constants.TYPE, (this.migrationStateModel._targetServerInstance.type === 'microsoft.compute/virtualmachines') ? constants.SUMMARY_VM_TYPE : constants.SUMMARY_MI_TYPE),
createInformationRow(this._view, constants.SUBSCRIPTION, this.migrationStateModel._targetSubscription.name),
createInformationRow(this._view, constants.SUMMARY_MI_TYPE, this.migrationStateModel._targetManagedInstance.name),
createInformationRow(this._view, constants.SUMMARY_MI_TYPE, this.migrationStateModel._targetServerInstance.name),
createInformationRow(this._view, constants.SUMMARY_DATABASE_COUNT_LABEL, this.migrationStateModel._migrationDbs.length.toString()),
createHeadingTextComponent(this._view, constants.DATABASE_BACKUP_PAGE_TITLE),
this.createNetworkContainerRows(),

View File

@@ -32,7 +32,7 @@ export class TempTargetSelectionPage extends MigrationWizardPage {
this._managedInstanceSubscriptionDropdown.onValueChanged((e) => {
if (e.selected) {
this.migrationStateModel._targetSubscription = this.migrationStateModel.getSubscription(e.index);
this.migrationStateModel._targetManagedInstance = undefined!;
this.migrationStateModel._targetServerInstance = undefined!;
this.migrationStateModel._migrationController = undefined!;
this.populateManagedInstanceDropdown();
}
@@ -49,7 +49,7 @@ export class TempTargetSelectionPage extends MigrationWizardPage {
this._managedInstanceDropdown.onValueChanged((e) => {
if (e.selected) {
this.migrationStateModel._migrationControllers = undefined!;
this.migrationStateModel._targetManagedInstance = this.migrationStateModel.getManagedInstance(e.index);
this.migrationStateModel._targetServerInstance = this.migrationStateModel.getManagedInstance(e.index);
}
});
@@ -97,7 +97,7 @@ export class TempTargetSelectionPage extends MigrationWizardPage {
}
private async populateManagedInstanceDropdown(): Promise<void> {
if (!this.migrationStateModel._targetManagedInstance) {
if (!this.migrationStateModel._targetServerInstance) {
this._managedInstanceDropdown.loading = true;
try {
this._managedInstanceDropdown.values = await this.migrationStateModel.getManagedInstanceValues(this.migrationStateModel._targetSubscription);