[SQL Migration] Add state check to target MI resource on target selection page (#18673)

* Add MI ready state check and error message

* Fix a typo

* Update error message logic

* Update '(Unavailable)' prefix to be localized string

* Show error messsage when non-Ready MI is initially selected (not just on Next button)

* Update error message with appropriate casing and actionable step
This commit is contained in:
Raymond Truong
2022-03-15 10:45:43 -07:00
committed by GitHub
parent cb607e34d7
commit fa227c88c9
3 changed files with 41 additions and 6 deletions

View File

@@ -249,6 +249,10 @@ export function AZURE_SQL_TARGET_PAGE_DESCRIPTION(targetInstance: string = 'inst
export const AZURE_SQL_DATABASE_MANAGED_INSTANCE = localize('sql.migration.azure.sql.database.managed.instance', "Azure SQL Managed Instance");
export const NO_MANAGED_INSTANCE_FOUND = localize('sql.migration.no.managedInstance.found', "No managed instance found.");
export const INVALID_MANAGED_INSTANCE_ERROR = localize('sql.migration.invalid.managedInstance.error', "To continue, select a valid managed instance.");
export function UNAVAILABLE_MANAGED_INSTANCE_PREFIX(miName: string): string {
return localize('sql.migration.unavailable.managedInstance', "(Unavailable) {0}", miName);
}
// Virtual Machine
export const AZURE_SQL_DATABASE_VIRTUAL_MACHINE = localize('sql.migration.azure.sql.database.virtual.machine', "SQL Server on Azure Virtual Machines");
@@ -291,6 +295,9 @@ export function ACCOUNT_ACCESS_ERROR(account: AzureAccount, error: Error) {
`${account?.properties?.tenants[0]?.displayName} (${account?.properties?.tenants[0]?.userId})`,
error.message);
}
export function MI_NOT_READY_ERROR(miName: string, state: string): string {
return localize('sql.migration.mi.not.ready', "The managed instance '{0}' is unavailable for migration because it is currently in the '{1}' state. To continue, select an available managed instance.", miName, state);
}
// database backup page
export const DATABASE_BACKUP_PAGE_TITLE = localize('sql.migration.database.page.title', "Database backup");