From 433e5633cfeeed6cb58f98fc2ba1cb819cbca3ac Mon Sep 17 00:00:00 2001 From: "Anup N. Kamath" <30480046+akamath46297@users.noreply.github.com> Date: Wed, 19 Jun 2019 22:53:54 -0700 Subject: [PATCH] Check provider type before throwing error message on cloud servers (#5948) * check provider type in backup action * check provider name in case of restore as well * removed harcoding of constant --- src/sql/workbench/common/actions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/common/actions.ts b/src/sql/workbench/common/actions.ts index 0f7b646150..797aa9fd7d 100644 --- a/src/sql/workbench/common/actions.ts +++ b/src/sql/workbench/common/actions.ts @@ -26,6 +26,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { mssqlProviderName } from 'sql/platform/connection/common/constants'; export interface BaseActionContext { object?: ObjectMetadata; @@ -253,7 +254,7 @@ export class BackupAction extends Task { } if (profile) { const serverInfo = connectionManagementService.getServerInfo(profile.id); - if (serverInfo && serverInfo.isCloud) { + if (serverInfo && serverInfo.isCloud && profile.providerName === mssqlProviderName) { return accessor.get(INotificationService).info(nls.localize('backup.commandNotSupported', 'Backup command is not supported for Azure SQL databases.')); } } @@ -296,7 +297,7 @@ export class RestoreAction extends Task { } if (profile) { const serverInfo = connectionManagementService.getServerInfo(profile.id); - if (serverInfo && serverInfo.isCloud) { + if (serverInfo && serverInfo.isCloud && profile.providerName === mssqlProviderName) { return accessor.get(INotificationService).info(nls.localize('restore.commandNotSupported', 'Restore command is not supported for Azure SQL databases.')); } }