Adding Azure AD tenant dropdown in migration wizard (#14637)

* Added dropdown to select azure tenant in accounts page

* Added dropdown label for tenant dropdown

* Moving deepcopy to  utils
Exporting tenant type from azurecore

* Removing unnecessary stylings

* removing unnecessary async
This commit is contained in:
Aasim Khan
2021-03-10 12:48:44 -08:00
committed by GitHub
parent 6389a5b0b0
commit ee2988f5fd
4 changed files with 104 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
import * as azdata from 'azdata';
import { azureResource } from 'azureResource';
import * as azurecore from 'azurecore';
import * as vscode from 'vscode';
import * as mssql from '../../../mssql';
import { getAvailableManagedInstanceProducts, getAvailableStorageAccounts, getBlobContainers, getFileShares, getMigrationControllers, getSubscriptions, SqlMigrationController, SqlManagedInstance, startDatabaseMigration, StartDatabaseMigrationRequest, StorageAccount, getAvailableSqlVMs, SqlVMServer } from '../api/azure';
@@ -79,6 +80,7 @@ export interface StateChangeEvent {
export class MigrationStateModel implements Model, vscode.Disposable {
public _azureAccounts!: azdata.Account[];
public _azureAccount!: azdata.Account;
public _accountTenants!: azurecore.Tenant[];
public _subscriptions!: azureResource.AzureResourceSubscription[];
@@ -197,6 +199,19 @@ export class MigrationStateModel implements Model, vscode.Disposable {
return this._azureAccounts[index];
}
public getTenantValues(): azdata.CategoryValue[] {
return this._accountTenants.map(tenant => {
return {
displayName: tenant.displayName,
name: tenant.id
};
});
}
public getTenant(index: number): azurecore.Tenant {
return this._accountTenants[index];
}
public async getSubscriptionsDropdownValues(): Promise<azdata.CategoryValue[]> {
let subscriptionsValues: azdata.CategoryValue[] = [];
try {