SQL-Migration: enable cross subscription service migration (#22876)

* x subscription migration support

* refresh after cutover

* fix service irregular status load behavior

* queue service status requests, fix typo

* add migationTargetServerName helper method

* save context before api call
This commit is contained in:
brian-harris
2023-04-27 16:28:32 -07:00
committed by GitHub
parent 65f8915b7e
commit fe32180c71
15 changed files with 347 additions and 240 deletions

View File

@@ -228,7 +228,7 @@ export class DatabaseBackupPage extends MigrationWizardPage {
description: constants.DATABASE_BACKUP_NETWORK_SHARE_WINDOWS_USER_INFO,
width: WIZARD_INPUT_COMPONENT_WIDTH,
requiredIndicator: true,
CSSStyles: { ...styles.LABEL_CSS }
CSSStyles: { ...styles.LABEL_CSS },
}).component();
this._windowsUserAccountText = this._view.modelBuilder.inputBox()
.withProps({
@@ -627,7 +627,13 @@ export class DatabaseBackupPage extends MigrationWizardPage {
// check for storage account connectivity
if ((this.migrationStateModel.isSqlMiTarget || this.migrationStateModel.isSqlVmTarget)) {
if (!(await canTargetConnectToStorageAccount(this.migrationStateModel._targetType, this.migrationStateModel._targetServerInstance, selectedStorageAccount, this.migrationStateModel._azureAccount, this.migrationStateModel._targetSubscription))) {
if (!(await canTargetConnectToStorageAccount(
this.migrationStateModel._targetType,
this.migrationStateModel._targetServerInstance,
selectedStorageAccount,
this.migrationStateModel._azureAccount,
this.migrationStateModel._targetSubscription))) {
this._inaccessibleStorageAccounts = [selectedStorageAccount.name];
} else {
this._inaccessibleStorageAccounts = [];
@@ -661,7 +667,11 @@ export class DatabaseBackupPage extends MigrationWizardPage {
// check for storage account connectivity
const selectedStorageAccount = this.migrationStateModel._storageAccounts.find(sa => sa.name === (this._networkShareContainerStorageAccountDropdown.value as azdata.CategoryValue).displayName);
if ((this.migrationStateModel.isSqlMiTarget || this.migrationStateModel.isSqlVmTarget) && selectedStorageAccount) {
if (!(await canTargetConnectToStorageAccount(this.migrationStateModel._targetType, this.migrationStateModel._targetServerInstance, selectedStorageAccount, this.migrationStateModel._azureAccount, this.migrationStateModel._targetSubscription))) {
if (!(await canTargetConnectToStorageAccount(
this.migrationStateModel._targetType,
this.migrationStateModel._targetServerInstance,
selectedStorageAccount, this.migrationStateModel._azureAccount,
this.migrationStateModel._targetSubscription))) {
this._inaccessibleStorageAccounts = [selectedStorageAccount.name];
} else {
this._inaccessibleStorageAccounts = [];
@@ -1129,7 +1139,13 @@ export class DatabaseBackupPage extends MigrationWizardPage {
this._inaccessibleStorageAccounts = this._inaccessibleStorageAccounts.filter(storageAccountName => storageAccountName.toLowerCase() !== oldSelectedStorageAccount.toLowerCase());
}
if (!(await canTargetConnectToStorageAccount(this.migrationStateModel._targetType, this.migrationStateModel._targetServerInstance, selectedStorageAccount, this.migrationStateModel._azureAccount, this.migrationStateModel._targetSubscription))) {
if (!(await canTargetConnectToStorageAccount(
this.migrationStateModel._targetType,
this.migrationStateModel._targetServerInstance,
selectedStorageAccount,
this.migrationStateModel._azureAccount,
this.migrationStateModel._targetSubscription))) {
this._inaccessibleStorageAccounts = this._inaccessibleStorageAccounts.filter(storageAccountName => storageAccountName.toLowerCase() !== selectedStorageAccount.name.toLowerCase());
this._inaccessibleStorageAccounts.push(selectedStorageAccount.name);
}
@@ -1452,10 +1468,10 @@ export class DatabaseBackupPage extends MigrationWizardPage {
private async getSubscriptionValues(): Promise<void> {
this._networkShareContainerSubscription.value = this.migrationStateModel._targetSubscription.name;
this._networkShareContainerLocation.value = await this.migrationStateModel.getLocationDisplayName(this.migrationStateModel._targetServerInstance.location);
this._networkShareContainerLocation.value = await this.migrationStateModel._location.displayName;
this._blobContainerSubscription.value = this.migrationStateModel._targetSubscription.name;
this._blobContainerLocation.value = await this.migrationStateModel.getLocationDisplayName(this.migrationStateModel._targetServerInstance.location);
this._blobContainerLocation.value = this.migrationStateModel._location.displayName;
this.migrationStateModel._databaseBackup.subscription = this.migrationStateModel._targetSubscription;