mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Removing migration contracts from mssql (#21966)
* Removing migration contracts from sts * Update sts * Pushing latest sts
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
||||||
"version": "4.5.0.20",
|
"version": "4.5.0.22",
|
||||||
"downloadFileNames": {
|
"downloadFileNames": {
|
||||||
"Windows_86": "win-x86-net7.0.zip",
|
"Windows_86": "win-x86-net7.0.zip",
|
||||||
"Windows_64": "win-x64-net7.0.zip",
|
"Windows_64": "win-x64-net7.0.zip",
|
||||||
|
|||||||
@@ -21,10 +21,8 @@ export const SchemaCompareService = 'schemaCompareService';
|
|||||||
export const LanguageExtensionService = 'languageExtensionService';
|
export const LanguageExtensionService = 'languageExtensionService';
|
||||||
export const objectExplorerPrefix: string = 'objectexplorer://';
|
export const objectExplorerPrefix: string = 'objectexplorer://';
|
||||||
export const SqlAssessmentService = 'sqlAssessmentService';
|
export const SqlAssessmentService = 'sqlAssessmentService';
|
||||||
export const SqlMigrationService = 'sqlMigrationService';
|
|
||||||
export const NotebookConvertService = 'notebookConvertService';
|
export const NotebookConvertService = 'notebookConvertService';
|
||||||
export const AzureBlobService = 'azureBlobService';
|
export const AzureBlobService = 'azureBlobService';
|
||||||
export const TdeMigrationService = 'tdeMigrationService';
|
|
||||||
|
|
||||||
// CONFIGURATION VALUES //////////////////////////////////////////////////////////
|
// CONFIGURATION VALUES //////////////////////////////////////////////////////////
|
||||||
export const configObjectExplorerGroupBySchemaFlagName = 'mssql.objectExplorer.groupBySchema';
|
export const configObjectExplorerGroupBySchemaFlagName = 'mssql.objectExplorer.groupBySchema';
|
||||||
|
|||||||
@@ -1125,93 +1125,6 @@ export namespace ProfilerSessionCreatedNotification {
|
|||||||
|
|
||||||
// ------------------------------- < SQL Profiler > ------------------------------------
|
// ------------------------------- < SQL Profiler > ------------------------------------
|
||||||
|
|
||||||
/// ------------------------------- <Sql Migration> -----------------------------
|
|
||||||
export interface SqlMigrationAssessmentParams {
|
|
||||||
ownerUri: string;
|
|
||||||
databases: string[];
|
|
||||||
xEventsFilesFolderPath: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace GetSqlMigrationAssessmentItemsRequest {
|
|
||||||
export const type = new RequestType<SqlMigrationAssessmentParams, mssql.AssessmentResult, void, void>('migration/getassessments');
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SqlMigrationSkuRecommendationsParams {
|
|
||||||
dataFolder: string;
|
|
||||||
perfQueryIntervalInSec: number;
|
|
||||||
targetPlatforms: string[];
|
|
||||||
targetSqlInstance: string;
|
|
||||||
targetPercentile: number;
|
|
||||||
scalingFactor: number;
|
|
||||||
startTime: string;
|
|
||||||
endTime: string;
|
|
||||||
includePreviewSkus: boolean;
|
|
||||||
databaseAllowList: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace GetSqlMigrationSkuRecommendationsRequest {
|
|
||||||
export const type = new RequestType<SqlMigrationSkuRecommendationsParams, mssql.SkuRecommendationResult, void, void>('migration/getskurecommendations');
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SqlMigrationStartPerfDataCollectionParams {
|
|
||||||
ownerUri: string,
|
|
||||||
dataFolder: string,
|
|
||||||
perfQueryIntervalInSec: number,
|
|
||||||
staticQueryIntervalInSec: number,
|
|
||||||
numberOfIterations: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace SqlMigrationStartPerfDataCollectionRequest {
|
|
||||||
export const type = new RequestType<SqlMigrationStartPerfDataCollectionParams, mssql.StartPerfDataCollectionResult, void, void>('migration/startperfdatacollection');
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SqlMigrationStopPerfDataCollectionParams {
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace SqlMigrationStopPerfDataCollectionRequest {
|
|
||||||
export const type = new RequestType<SqlMigrationStopPerfDataCollectionParams, mssql.StopPerfDataCollectionResult, void, void>('migration/stopperfdatacollection');
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SqlMigrationRefreshPerfDataCollectionParams {
|
|
||||||
lastRefreshTime: Date
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace SqlMigrationRefreshPerfDataCollectionRequest {
|
|
||||||
export const type = new RequestType<SqlMigrationRefreshPerfDataCollectionParams, mssql.RefreshPerfDataCollectionResult, void, void>('migration/refreshperfdatacollection');
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StartLoginMigrationsParams {
|
|
||||||
sourceConnectionString: string;
|
|
||||||
targetConnectionString: string;
|
|
||||||
loginList: string[];
|
|
||||||
aadDomainName: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace StartLoginMigrationRequest {
|
|
||||||
export const type = new RequestType<StartLoginMigrationsParams, mssql.StartLoginMigrationResult, void, void>('migration/startloginmigration');
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace ValidateLoginMigrationRequest {
|
|
||||||
export const type = new RequestType<StartLoginMigrationsParams, mssql.StartLoginMigrationResult, void, void>('migration/validateloginmigration');
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace MigrateLoginsRequest {
|
|
||||||
export const type = new RequestType<StartLoginMigrationsParams, mssql.StartLoginMigrationResult, void, void>('migration/migratelogins');
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace EstablishUserMappingRequest {
|
|
||||||
export const type = new RequestType<StartLoginMigrationsParams, mssql.StartLoginMigrationResult, void, void>('migration/establishusermapping');
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace MigrateServerRolesAndSetPermissionsRequest {
|
|
||||||
export const type = new RequestType<StartLoginMigrationsParams, mssql.StartLoginMigrationResult, void, void>('migration/migrateserverrolesandsetpermissions');
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace LoginMigrationNotification {
|
|
||||||
export const type = new NotificationType<mssql.StartLoginMigrationResult, void>('migration/loginmigrationnotification"');
|
|
||||||
}
|
|
||||||
// ------------------------------- <Sql Migration> -----------------------------
|
|
||||||
|
|
||||||
// ------------------------------- < Table Designer > ------------------------------------
|
// ------------------------------- < Table Designer > ------------------------------------
|
||||||
|
|
||||||
export interface TableDesignerEditRequestParams {
|
export interface TableDesignerEditRequestParams {
|
||||||
@@ -1278,35 +1191,3 @@ export namespace ExecutionPlanComparisonRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------- < Execution Plan > ------------------------------------
|
// ------------------------------- < Execution Plan > ------------------------------------
|
||||||
|
|
||||||
// ------------------------------- < Tde Migration > ------------------------------------
|
|
||||||
|
|
||||||
export namespace TdeMigrateRequest {
|
|
||||||
export const type = new RequestType<TdeMigrationParams, mssql.TdeMigrationResult, void, void>('migration/tdemigration');
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TdeMigrationParams {
|
|
||||||
encryptedDatabases: string[];
|
|
||||||
sourceSqlConnectionString: string;
|
|
||||||
targetSubscriptionId: string;
|
|
||||||
targetResourceGroupName: string;
|
|
||||||
targetManagedInstanceName: string;
|
|
||||||
networkSharePath: string;
|
|
||||||
networkShareDomain: string;
|
|
||||||
networkShareUserName: string;
|
|
||||||
networkSharePassword: string;
|
|
||||||
accessToken: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace TdeMigrateProgressEvent {
|
|
||||||
export const type = new NotificationType<TdeMigrateProgressParams, void>('migration/tdemigrationprogress');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export interface TdeMigrateProgressParams {
|
|
||||||
name: string;
|
|
||||||
success: boolean;
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------- < Tde Migration > ------------------------------------
|
|
||||||
|
|||||||
443
extensions/mssql/src/mssql.d.ts
vendored
443
extensions/mssql/src/mssql.d.ts
vendored
@@ -44,11 +44,7 @@ declare module 'mssql' {
|
|||||||
|
|
||||||
readonly sqlAssessment: ISqlAssessmentService;
|
readonly sqlAssessment: ISqlAssessmentService;
|
||||||
|
|
||||||
readonly sqlMigration: ISqlMigrationService;
|
|
||||||
|
|
||||||
readonly azureBlob: IAzureBlobService;
|
readonly azureBlob: IAzureBlobService;
|
||||||
|
|
||||||
readonly tdeMigration: ITdeMigrationService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -426,397 +422,6 @@ declare module 'mssql' {
|
|||||||
generateAssessmentScript(items: azdata.SqlAssessmentResultItem[], targetServerName: string, targetDatabaseName: string, taskExecutionMode: azdata.TaskExecutionMode): Promise<azdata.ResultStatus>;
|
generateAssessmentScript(items: azdata.SqlAssessmentResultItem[], targetServerName: string, targetDatabaseName: string, taskExecutionMode: azdata.TaskExecutionMode): Promise<azdata.ResultStatus>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sql Migration
|
|
||||||
*/
|
|
||||||
|
|
||||||
// SKU recommendation interfaces, mirrored from Microsoft.SqlServer.Migration.SkuRecommendation
|
|
||||||
export interface AzureSqlSkuCategory {
|
|
||||||
sqlTargetPlatform: AzureSqlTargetPlatform;
|
|
||||||
computeTier: ComputeTier;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AzureSqlSkuPaaSCategory extends AzureSqlSkuCategory {
|
|
||||||
sqlPurchasingModel: AzureSqlPurchasingModel;
|
|
||||||
sqlServiceTier: AzureSqlPaaSServiceTier;
|
|
||||||
hardwareType: AzureSqlPaaSHardwareType;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AzureSqlSkuIaaSCategory extends AzureSqlSkuCategory {
|
|
||||||
virtualMachineFamilyType: VirtualMachineFamilyType;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AzureManagedDiskSku {
|
|
||||||
tier: AzureManagedDiskTier;
|
|
||||||
size: string;
|
|
||||||
caching: AzureManagedDiskCaching;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AzureVirtualMachineSku {
|
|
||||||
virtualMachineFamily: VirtualMachineFamily;
|
|
||||||
sizeName: string;
|
|
||||||
computeSize: number;
|
|
||||||
azureSkuName: string;
|
|
||||||
vCPUsAvailable: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AzureSqlSkuMonthlyCost {
|
|
||||||
computeCost: number;
|
|
||||||
storageCost: number;
|
|
||||||
totalCost: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AzureSqlSku {
|
|
||||||
category: AzureSqlSkuPaaSCategory | AzureSqlSkuIaaSCategory;
|
|
||||||
computeSize: number;
|
|
||||||
predictedDataSizeInMb: number;
|
|
||||||
predictedLogSizeInMb: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AzureSqlPaaSSku extends AzureSqlSku {
|
|
||||||
category: AzureSqlSkuPaaSCategory;
|
|
||||||
storageMaxSizeInMb: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AzureSqlIaaSSku extends AzureSqlSku {
|
|
||||||
category: AzureSqlSkuIaaSCategory;
|
|
||||||
virtualMachineSize: AzureVirtualMachineSku;
|
|
||||||
dataDiskSizes: AzureManagedDiskSku[];
|
|
||||||
logDiskSizes: AzureManagedDiskSku[];
|
|
||||||
tempDbDiskSizes: AzureManagedDiskSku[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SkuRecommendationResultItem {
|
|
||||||
sqlInstanceName: string;
|
|
||||||
databaseName: string;
|
|
||||||
targetSku: AzureSqlIaaSSku | AzureSqlPaaSSku;
|
|
||||||
monthlyCost: AzureSqlSkuMonthlyCost;
|
|
||||||
ranking: number;
|
|
||||||
positiveJustifications: string[];
|
|
||||||
negativeJustifications: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SqlInstanceRequirements {
|
|
||||||
cpuRequirementInCores: number;
|
|
||||||
dataStorageRequirementInMB: number;
|
|
||||||
logStorageRequirementInMB: number;
|
|
||||||
memoryRequirementInMB: number;
|
|
||||||
dataIOPSRequirement: number;
|
|
||||||
logIOPSRequirement: number;
|
|
||||||
ioLatencyRequirementInMs: number;
|
|
||||||
ioThroughputRequirementInMBps: number;
|
|
||||||
tempDBSizeInMB: number;
|
|
||||||
dataPointsStartTime: string;
|
|
||||||
dataPointsEndTime: string;
|
|
||||||
aggregationTargetPercentile: number;
|
|
||||||
perfDataCollectionIntervalInSeconds: number;
|
|
||||||
databaseLevelRequirements: SqlDatabaseRequirements[];
|
|
||||||
numberOfDataPointsAnalyzed: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SqlDatabaseRequirements {
|
|
||||||
cpuRequirementInCores: number;
|
|
||||||
dataIOPSRequirement: number;
|
|
||||||
logIOPSRequirement: number;
|
|
||||||
ioLatencyRequirementInMs: number;
|
|
||||||
ioThroughputRequirementInMBps: number;
|
|
||||||
dataStorageRequirementInMB: number;
|
|
||||||
logStorageRequirementInMB: number;
|
|
||||||
databaseName: string;
|
|
||||||
memoryRequirementInMB: number;
|
|
||||||
cpuRequirementInPercentageOfTotalInstance: number;
|
|
||||||
numberOfDataPointsAnalyzed: number;
|
|
||||||
fileLevelRequirements: SqlFileRequirements[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SqlFileRequirements {
|
|
||||||
fileName: string;
|
|
||||||
fileType: DatabaseFileType;
|
|
||||||
sizeInMB: number;
|
|
||||||
readLatencyInMs: number;
|
|
||||||
writeLatencyInMs: number;
|
|
||||||
iopsRequirement: number;
|
|
||||||
ioThroughputRequirementInMBps: number;
|
|
||||||
numberOfDataPointsAnalyzed: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PaaSSkuRecommendationResultItem extends SkuRecommendationResultItem {
|
|
||||||
targetSku: AzureSqlPaaSSku;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IaaSSkuRecommendationResultItem extends SkuRecommendationResultItem {
|
|
||||||
targetSku: AzureSqlIaaSSku;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SkuRecommendationResult {
|
|
||||||
sqlDbRecommendationResults: PaaSSkuRecommendationResultItem[];
|
|
||||||
sqlDbRecommendationDurationInMs: number;
|
|
||||||
sqlMiRecommendationResults: PaaSSkuRecommendationResultItem[];
|
|
||||||
sqlMiRecommendationDurationInMs: number;
|
|
||||||
sqlVmRecommendationResults: IaaSSkuRecommendationResultItem[];
|
|
||||||
sqlVmRecommendationDurationInMs: number;
|
|
||||||
elasticSqlDbRecommendationResults: PaaSSkuRecommendationResultItem[];
|
|
||||||
elasticSqlDbRecommendationDurationInMs: number;
|
|
||||||
elasticSqlMiRecommendationResults: PaaSSkuRecommendationResultItem[];
|
|
||||||
elasticSqlMiRecommendationDurationInMs: number;
|
|
||||||
elasticSqlVmRecommendationResults: IaaSSkuRecommendationResultItem[];
|
|
||||||
elasticSqlVmRecommendationDurationInMs: number;
|
|
||||||
instanceRequirements: SqlInstanceRequirements;
|
|
||||||
skuRecommendationReportPaths: string[];
|
|
||||||
elasticSkuRecommendationReportPaths: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// SKU recommendation enums, mirrored from Microsoft.SqlServer.Migration.SkuRecommendation
|
|
||||||
export const enum DatabaseFileType {
|
|
||||||
Rows = 0,
|
|
||||||
Log = 1,
|
|
||||||
Filestream = 2,
|
|
||||||
NotSupported = 3,
|
|
||||||
Fulltext = 4
|
|
||||||
}
|
|
||||||
|
|
||||||
export const enum AzureSqlTargetPlatform {
|
|
||||||
AzureSqlDatabase = 0,
|
|
||||||
AzureSqlManagedInstance = 1,
|
|
||||||
AzureSqlVirtualMachine = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
export const enum ComputeTier {
|
|
||||||
Provisioned = 0,
|
|
||||||
ServerLess = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
export const enum AzureManagedDiskTier {
|
|
||||||
Standard = 0,
|
|
||||||
Premium = 1,
|
|
||||||
Ultra = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
export const enum AzureManagedDiskCaching {
|
|
||||||
NotApplicable = 0,
|
|
||||||
None = 1,
|
|
||||||
ReadOnly = 2,
|
|
||||||
ReadWrite = 3
|
|
||||||
}
|
|
||||||
|
|
||||||
export const enum AzureSqlPurchasingModel {
|
|
||||||
vCore = 0,
|
|
||||||
}
|
|
||||||
|
|
||||||
export const enum AzureSqlPaaSServiceTier {
|
|
||||||
GeneralPurpose = 0,
|
|
||||||
BusinessCritical,
|
|
||||||
HyperScale,
|
|
||||||
}
|
|
||||||
|
|
||||||
export const enum AzureSqlPaaSHardwareType {
|
|
||||||
Gen5 = 0,
|
|
||||||
PremiumSeries,
|
|
||||||
PremiumSeriesMemoryOptimized
|
|
||||||
}
|
|
||||||
|
|
||||||
export const enum VirtualMachineFamilyType {
|
|
||||||
GeneralPurpose,
|
|
||||||
ComputeOptimized,
|
|
||||||
MemoryOptimized,
|
|
||||||
StorageOptimized,
|
|
||||||
GPU,
|
|
||||||
HighPerformanceCompute
|
|
||||||
}
|
|
||||||
|
|
||||||
export const enum VirtualMachineFamily {
|
|
||||||
basicAFamily,
|
|
||||||
standardA0_A7Family,
|
|
||||||
standardAv2Family,
|
|
||||||
standardBSFamily,
|
|
||||||
standardDFamily,
|
|
||||||
standardDv2Family,
|
|
||||||
standardDv2PromoFamily,
|
|
||||||
standardDADSv5Family,
|
|
||||||
standardDASv4Family,
|
|
||||||
standardDASv5Family,
|
|
||||||
standardDAv4Family,
|
|
||||||
standardDDSv4Family,
|
|
||||||
standardDDSv5Family,
|
|
||||||
standardDDv4Family,
|
|
||||||
standardDDv5Family,
|
|
||||||
standardDSv3Family,
|
|
||||||
standardDSv4Family,
|
|
||||||
standardDSv5Family,
|
|
||||||
standardDv3Family,
|
|
||||||
standardDv4Family,
|
|
||||||
standardDv5Family,
|
|
||||||
standardDCADSv5Family,
|
|
||||||
standardDCASv5Family,
|
|
||||||
standardDCSv2Family,
|
|
||||||
standardDSFamily,
|
|
||||||
standardDSv2Family,
|
|
||||||
standardDSv2PromoFamily,
|
|
||||||
standardEIDSv5Family,
|
|
||||||
standardEIDv5Family,
|
|
||||||
standardEISv5Family,
|
|
||||||
standardEIv5Family,
|
|
||||||
standardEADSv5Family,
|
|
||||||
standardEASv4Family,
|
|
||||||
standardEASv5Family,
|
|
||||||
standardEDSv4Family,
|
|
||||||
standardEDSv5Family,
|
|
||||||
standardEBDSv5Family,
|
|
||||||
standardESv3Family,
|
|
||||||
standardESv4Family,
|
|
||||||
standardESv5Family,
|
|
||||||
standardEBSv5Family,
|
|
||||||
standardEAv4Family,
|
|
||||||
standardEDv4Family,
|
|
||||||
standardEDv5Family,
|
|
||||||
standardEv3Family,
|
|
||||||
standardEv4Family,
|
|
||||||
standardEv5Family,
|
|
||||||
standardEISv3Family,
|
|
||||||
standardEIv3Family,
|
|
||||||
standardXEIDSv4Family,
|
|
||||||
standardXEISv4Family,
|
|
||||||
standardECADSv5Family,
|
|
||||||
standardECASv5Family,
|
|
||||||
standardECIADSv5Family,
|
|
||||||
standardECIASv5Family,
|
|
||||||
standardFFamily,
|
|
||||||
standardFSFamily,
|
|
||||||
standardFSv2Family,
|
|
||||||
standardGFamily,
|
|
||||||
standardGSFamily,
|
|
||||||
standardHFamily,
|
|
||||||
standardHPromoFamily,
|
|
||||||
standardLSFamily,
|
|
||||||
standardLSv2Family,
|
|
||||||
standardMSFamily,
|
|
||||||
standardMDSMediumMemoryv2Family,
|
|
||||||
standardMSMediumMemoryv2Family,
|
|
||||||
standardMIDSMediumMemoryv2Family,
|
|
||||||
standardMISMediumMemoryv2Family,
|
|
||||||
standardMSv2Family,
|
|
||||||
standardNCSv3Family,
|
|
||||||
StandardNCASv3_T4Family,
|
|
||||||
standardNVSv2Family,
|
|
||||||
standardNVSv3Family,
|
|
||||||
standardNVSv4Family
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StartPerfDataCollectionResult {
|
|
||||||
dateTimeStarted: Date;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StopPerfDataCollectionResult {
|
|
||||||
dateTimeStopped: Date;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RefreshPerfDataCollectionResult {
|
|
||||||
isCollecting: boolean;
|
|
||||||
messages: string[];
|
|
||||||
errors: string[];
|
|
||||||
refreshTime: Date;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ISqlMigrationService {
|
|
||||||
getAssessments(ownerUri: string, databases: string[], xEventsFilesFolderPath: string): Promise<AssessmentResult | undefined>;
|
|
||||||
getSkuRecommendations(dataFolder: string, perfQueryIntervalInSec: number, targetPlatforms: string[], targetSqlInstance: string, targetPercentile: number, scalingFactor: number, startTime: string, endTime: string, includePreviewSkus: boolean, databaseAllowList: string[]): Promise<SkuRecommendationResult | undefined>;
|
|
||||||
startPerfDataCollection(ownerUri: string, dataFolder: string, perfQueryIntervalInSec: number, staticQueryIntervalInSec: number, numberOfIterations: number): Promise<StartPerfDataCollectionResult | undefined>;
|
|
||||||
stopPerfDataCollection(): Promise<StopPerfDataCollectionResult | undefined>;
|
|
||||||
refreshPerfDataCollection(lastRefreshedTime: Date): Promise<RefreshPerfDataCollectionResult | undefined>;
|
|
||||||
startLoginMigration(sourceConnectionString: string, targetConnectionString: string, loginList: string[], aadDomainName: string): Promise<StartLoginMigrationResult | undefined>;
|
|
||||||
validateLoginMigration(sourceConnectionString: string, targetConnectionString: string, loginList: string[], aadDomainName: string): Promise<StartLoginMigrationResult | undefined>;
|
|
||||||
migrateLogins(sourceConnectionString: string, targetConnectionString: string, loginList: string[], aadDomainName: string): Promise<StartLoginMigrationResult | undefined>;
|
|
||||||
establishUserMapping(sourceConnectionString: string, targetConnectionString: string, loginList: string[], aadDomainName: string): Promise<StartLoginMigrationResult | undefined>;
|
|
||||||
migrateServerRolesAndSetPermissions(sourceConnectionString: string, targetConnectionString: string, loginList: string[], aadDomainName: string): Promise<StartLoginMigrationResult | undefined>;
|
|
||||||
}
|
|
||||||
|
|
||||||
// SqlMigration interfaces -----------------------------------------------------------------------
|
|
||||||
|
|
||||||
export interface SqlMigrationImpactedObjectInfo {
|
|
||||||
name: string;
|
|
||||||
impactDetail: string;
|
|
||||||
objectType: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SqlMigrationAssessmentResultItem {
|
|
||||||
rulesetVersion: string;
|
|
||||||
rulesetName: string;
|
|
||||||
ruleId: string;
|
|
||||||
targetType: string;
|
|
||||||
checkId: string;
|
|
||||||
tags: string[];
|
|
||||||
displayName: string;
|
|
||||||
description: string;
|
|
||||||
helpLink: string;
|
|
||||||
level: string;
|
|
||||||
timestamp: string;
|
|
||||||
kind: azdata.sqlAssessment.SqlAssessmentResultItemKind;
|
|
||||||
message: string;
|
|
||||||
appliesToMigrationTargetPlatform: string;
|
|
||||||
issueCategory: string;
|
|
||||||
databaseName: string;
|
|
||||||
impactedObjects: SqlMigrationImpactedObjectInfo[];
|
|
||||||
databaseRestoreFails: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ServerTargetReadiness {
|
|
||||||
numberOfDatabasesReadyForMigration: number;
|
|
||||||
numberOfNonOnlineDatabases: number;
|
|
||||||
totalNumberOfDatabases: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ErrorModel {
|
|
||||||
errorId: number;
|
|
||||||
message: string;
|
|
||||||
errorSummary: string;
|
|
||||||
possibleCauses: string;
|
|
||||||
guidance: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DatabaseTargetReadiness {
|
|
||||||
noSelectionForMigration: boolean;
|
|
||||||
numOfBlockerIssues: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DatabaseAssessmentProperties {
|
|
||||||
compatibilityLevel: string;
|
|
||||||
databaseSize: number;
|
|
||||||
isReplicationEnabled: boolean;
|
|
||||||
assessmentTimeInMilliseconds: number;
|
|
||||||
items: SqlMigrationAssessmentResultItem[];
|
|
||||||
errors: ErrorModel[];
|
|
||||||
sqlManagedInstanceTargetReadiness: DatabaseTargetReadiness;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ServerAssessmentProperties {
|
|
||||||
cpuCoreCount: number;
|
|
||||||
physicalServerMemory: number;
|
|
||||||
serverHostPlatform: string;
|
|
||||||
serverVersion: string;
|
|
||||||
serverEngineEdition: string;
|
|
||||||
serverEdition: string;
|
|
||||||
isClustered: boolean;
|
|
||||||
numberOfUserDatabases: number;
|
|
||||||
sqlAssessmentStatus: number;
|
|
||||||
assessedDatabaseCount: number;
|
|
||||||
sqlManagedInstanceTargetReadiness: ServerTargetReadiness;
|
|
||||||
items: SqlMigrationAssessmentResultItem[];
|
|
||||||
errors: ErrorModel[];
|
|
||||||
databases: DatabaseAssessmentProperties[];
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AssessmentResult {
|
|
||||||
startTime: string;
|
|
||||||
endedTime: string;
|
|
||||||
assessmentResult: ServerAssessmentProperties;
|
|
||||||
rawAssessmentResult: any;
|
|
||||||
errors: ErrorModel[];
|
|
||||||
assessmentReportPath: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateSasResponse {
|
export interface CreateSasResponse {
|
||||||
sharedAccessSignature: string;
|
sharedAccessSignature: string;
|
||||||
}
|
}
|
||||||
@@ -833,52 +438,4 @@ declare module 'mssql' {
|
|||||||
*/
|
*/
|
||||||
createSas(connectionUri: string, blobContainerUri: string, blobStorageKey: string, storageAccountName: string, expirationDate: string): Promise<CreateSasResponse>;
|
createSas(connectionUri: string, blobContainerUri: string, blobStorageKey: string, storageAccountName: string, expirationDate: string): Promise<CreateSasResponse>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LoginMigrationStep {
|
|
||||||
StartValidations = 0,
|
|
||||||
MigrateLogins = 1,
|
|
||||||
EstablishUserMapping = 2,
|
|
||||||
MigrateServerRoles = 3,
|
|
||||||
EstablishServerRoleMapping = 4,
|
|
||||||
SetLoginPermissions = 5,
|
|
||||||
SetServerRolePermissions = 6,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StartLoginMigrationResult {
|
|
||||||
exceptionMap: { [login: string]: any };
|
|
||||||
completedStep: LoginMigrationStep;
|
|
||||||
elapsedTime: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TDEMigration interfaces BEGIN -----------------------------------------------------------------------
|
|
||||||
export interface TdeMigrationRequest {
|
|
||||||
encryptedDatabases: string[];
|
|
||||||
sourceSqlConnectionString: string;
|
|
||||||
targetSubscriptionId: string;
|
|
||||||
targetResourceGroupName: string;
|
|
||||||
targetManagedInstanceName: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TdeMigrationEntryResult {
|
|
||||||
dbName: string;
|
|
||||||
success: boolean;
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TdeMigrationResult {
|
|
||||||
migrationStatuses: TdeMigrationEntryResult[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ITdeMigrationService {
|
|
||||||
migrateCertificate(
|
|
||||||
encryptedDatabases: string[],
|
|
||||||
sourceSqlConnectionString: string,
|
|
||||||
targetSubscriptionId: string,
|
|
||||||
targetResourceGroupName: string,
|
|
||||||
targetManagedInstanceName: string,
|
|
||||||
networkSharePath: string,
|
|
||||||
accessToken: string,
|
|
||||||
reportUpdate: (dbName: string, succeeded: boolean, message: string) => void): Promise<TdeMigrationResult>;
|
|
||||||
}
|
|
||||||
// TDEMigration interfaces END -----------------------------------------------------------------------
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { AppContext } from './appContext';
|
import { AppContext } from './appContext';
|
||||||
import { IExtension, ICmsService, IDacFxService, ISqlProjectsService, ISchemaCompareService, ILanguageExtensionService, ISqlAssessmentService, ISqlMigrationService, IAzureBlobService, ITdeMigrationService } from 'mssql';
|
import { IExtension, ICmsService, IDacFxService, ISqlProjectsService, ISchemaCompareService, ILanguageExtensionService, ISqlAssessmentService, IAzureBlobService } from 'mssql';
|
||||||
import * as constants from './constants';
|
import * as constants from './constants';
|
||||||
import { SqlToolsServer } from './sqlToolsServer';
|
import { SqlToolsServer } from './sqlToolsServer';
|
||||||
|
|
||||||
@@ -31,14 +31,8 @@ export function createMssqlApi(context: AppContext, sqlToolsServer: SqlToolsServ
|
|||||||
get sqlAssessment() {
|
get sqlAssessment() {
|
||||||
return context.getService<ISqlAssessmentService>(constants.SqlAssessmentService);
|
return context.getService<ISqlAssessmentService>(constants.SqlAssessmentService);
|
||||||
},
|
},
|
||||||
get sqlMigration() {
|
|
||||||
return context.getService<ISqlMigrationService>(constants.SqlMigrationService);
|
|
||||||
},
|
|
||||||
get azureBlob() {
|
get azureBlob() {
|
||||||
return context.getService<IAzureBlobService>(constants.AzureBlobService);
|
return context.getService<IAzureBlobService>(constants.AzureBlobService);
|
||||||
},
|
|
||||||
get tdeMigration() {
|
|
||||||
return context.getService<ITdeMigrationService>(constants.TdeMigrationService);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,240 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
import * as mssql from 'mssql';
|
|
||||||
import { AppContext } from '../appContext';
|
|
||||||
import { SqlOpsDataClient, ISqlOpsFeature } from 'dataprotocol-client';
|
|
||||||
import { ClientCapabilities } from 'vscode-languageclient';
|
|
||||||
import * as constants from '../constants';
|
|
||||||
import * as contracts from '../contracts';
|
|
||||||
|
|
||||||
export class SqlMigrationService implements mssql.ISqlMigrationService {
|
|
||||||
public static asFeature(context: AppContext): ISqlOpsFeature {
|
|
||||||
return class extends SqlMigrationService {
|
|
||||||
constructor(client: SqlOpsDataClient) {
|
|
||||||
super(context, client);
|
|
||||||
}
|
|
||||||
|
|
||||||
fillClientCapabilities(capabilities: ClientCapabilities): void {
|
|
||||||
}
|
|
||||||
|
|
||||||
initialize(): void {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private constructor(context: AppContext, protected readonly client: SqlOpsDataClient) {
|
|
||||||
context.registerService(constants.SqlMigrationService, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
async getAssessments(ownerUri: string, databases: string[], xEventsFilesFolderPath: string): Promise<mssql.AssessmentResult | undefined> {
|
|
||||||
let params: contracts.SqlMigrationAssessmentParams = { ownerUri: ownerUri, databases: databases, xEventsFilesFolderPath: xEventsFilesFolderPath };
|
|
||||||
try {
|
|
||||||
return this.client.sendRequest(contracts.GetSqlMigrationAssessmentItemsRequest.type, params);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.GetSqlMigrationAssessmentItemsRequest.type, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getSkuRecommendations(
|
|
||||||
dataFolder: string,
|
|
||||||
perfQueryIntervalInSec: number,
|
|
||||||
targetPlatforms: string[],
|
|
||||||
targetSqlInstance: string,
|
|
||||||
targetPercentile: number,
|
|
||||||
scalingFactor: number,
|
|
||||||
startTime: string,
|
|
||||||
endTime: string,
|
|
||||||
includePreviewSkus: boolean,
|
|
||||||
databaseAllowList: string[]): Promise<mssql.SkuRecommendationResult | undefined> {
|
|
||||||
let params: contracts.SqlMigrationSkuRecommendationsParams = {
|
|
||||||
dataFolder,
|
|
||||||
perfQueryIntervalInSec,
|
|
||||||
targetPlatforms,
|
|
||||||
targetSqlInstance,
|
|
||||||
targetPercentile,
|
|
||||||
scalingFactor,
|
|
||||||
startTime,
|
|
||||||
endTime,
|
|
||||||
includePreviewSkus,
|
|
||||||
databaseAllowList
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
return this.client.sendRequest(contracts.GetSqlMigrationSkuRecommendationsRequest.type, params);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.GetSqlMigrationSkuRecommendationsRequest.type, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
async startPerfDataCollection(
|
|
||||||
ownerUri: string,
|
|
||||||
dataFolder: string,
|
|
||||||
perfQueryIntervalInSec: number,
|
|
||||||
staticQueryIntervalInSec: number,
|
|
||||||
numberOfIterations: number): Promise<mssql.StartPerfDataCollectionResult | undefined> {
|
|
||||||
let params: contracts.SqlMigrationStartPerfDataCollectionParams = {
|
|
||||||
ownerUri,
|
|
||||||
dataFolder,
|
|
||||||
perfQueryIntervalInSec,
|
|
||||||
staticQueryIntervalInSec,
|
|
||||||
numberOfIterations
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
return this.client.sendRequest(contracts.SqlMigrationStartPerfDataCollectionRequest.type, params);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.SqlMigrationStartPerfDataCollectionRequest.type, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
async stopPerfDataCollection(): Promise<mssql.StopPerfDataCollectionResult | undefined> {
|
|
||||||
let params: contracts.SqlMigrationStopPerfDataCollectionParams = {};
|
|
||||||
|
|
||||||
try {
|
|
||||||
return this.client.sendRequest(contracts.SqlMigrationStopPerfDataCollectionRequest.type, params);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.SqlMigrationStopPerfDataCollectionRequest.type, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
async refreshPerfDataCollection(lastRefreshedTime: Date): Promise<mssql.RefreshPerfDataCollectionResult | undefined> {
|
|
||||||
let params: contracts.SqlMigrationStopPerfDataCollectionParams = {
|
|
||||||
lastRefreshedTime
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
return this.client.sendRequest(contracts.SqlMigrationRefreshPerfDataCollectionRequest.type, params);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.SqlMigrationRefreshPerfDataCollectionRequest.type, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
async startLoginMigration(
|
|
||||||
sourceConnectionString: string,
|
|
||||||
targetConnectionString: string,
|
|
||||||
loginList: string[],
|
|
||||||
aadDomainName: string): Promise<mssql.StartLoginMigrationResult | undefined> {
|
|
||||||
let params: contracts.StartLoginMigrationsParams = {
|
|
||||||
sourceConnectionString,
|
|
||||||
targetConnectionString,
|
|
||||||
loginList,
|
|
||||||
aadDomainName
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
return this.client.sendRequest(contracts.StartLoginMigrationRequest.type, params);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.StartLoginMigrationRequest.type, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
async validateLoginMigration(
|
|
||||||
sourceConnectionString: string,
|
|
||||||
targetConnectionString: string,
|
|
||||||
loginList: string[],
|
|
||||||
aadDomainName: string): Promise<mssql.StartLoginMigrationResult | undefined> {
|
|
||||||
let params: contracts.StartLoginMigrationsParams = {
|
|
||||||
sourceConnectionString,
|
|
||||||
targetConnectionString,
|
|
||||||
loginList,
|
|
||||||
aadDomainName
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
return this.client.sendRequest(contracts.ValidateLoginMigrationRequest.type, params);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.ValidateLoginMigrationRequest.type, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
async migrateLogins(
|
|
||||||
sourceConnectionString: string,
|
|
||||||
targetConnectionString: string,
|
|
||||||
loginList: string[],
|
|
||||||
aadDomainName: string): Promise<mssql.StartLoginMigrationResult | undefined> {
|
|
||||||
let params: contracts.StartLoginMigrationsParams = {
|
|
||||||
sourceConnectionString,
|
|
||||||
targetConnectionString,
|
|
||||||
loginList,
|
|
||||||
aadDomainName
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
return this.client.sendRequest(contracts.MigrateLoginsRequest.type, params);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.MigrateLoginsRequest.type, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
async establishUserMapping(
|
|
||||||
sourceConnectionString: string,
|
|
||||||
targetConnectionString: string,
|
|
||||||
loginList: string[],
|
|
||||||
aadDomainName: string): Promise<mssql.StartLoginMigrationResult | undefined> {
|
|
||||||
let params: contracts.StartLoginMigrationsParams = {
|
|
||||||
sourceConnectionString,
|
|
||||||
targetConnectionString,
|
|
||||||
loginList,
|
|
||||||
aadDomainName
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
return this.client.sendRequest(contracts.EstablishUserMappingRequest.type, params);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.EstablishUserMappingRequest.type, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
async migrateServerRolesAndSetPermissions(
|
|
||||||
sourceConnectionString: string,
|
|
||||||
targetConnectionString: string,
|
|
||||||
loginList: string[],
|
|
||||||
aadDomainName: string): Promise<mssql.StartLoginMigrationResult | undefined> {
|
|
||||||
let params: contracts.StartLoginMigrationsParams = {
|
|
||||||
sourceConnectionString,
|
|
||||||
targetConnectionString,
|
|
||||||
loginList,
|
|
||||||
aadDomainName
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
return this.client.sendRequest(contracts.MigrateServerRolesAndSetPermissionsRequest.type, params);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.MigrateServerRolesAndSetPermissionsRequest.type, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -25,11 +25,9 @@ import * as nls from 'vscode-nls';
|
|||||||
import { LanguageExtensionService } from './languageExtension/languageExtensionService';
|
import { LanguageExtensionService } from './languageExtension/languageExtensionService';
|
||||||
import { SqlAssessmentService } from './sqlAssessment/sqlAssessmentService';
|
import { SqlAssessmentService } from './sqlAssessment/sqlAssessmentService';
|
||||||
import { NotebookConvertService } from './notebookConvert/notebookConvertService';
|
import { NotebookConvertService } from './notebookConvert/notebookConvertService';
|
||||||
import { SqlMigrationService } from './sqlMigration/sqlMigrationService';
|
|
||||||
import { SqlCredentialService } from './credentialstore/sqlCredentialService';
|
import { SqlCredentialService } from './credentialstore/sqlCredentialService';
|
||||||
import { AzureBlobService } from './azureBlob/azureBlobService';
|
import { AzureBlobService } from './azureBlob/azureBlobService';
|
||||||
import { ErrorDiagnosticsProvider } from './errorDiagnostics/errorDiagnosticsProvider';
|
import { ErrorDiagnosticsProvider } from './errorDiagnostics/errorDiagnosticsProvider';
|
||||||
import { TdeMigrationService } from './tdeMigration/tdeMigrationService';
|
|
||||||
import { SqlProjectsService } from './sqlProjects/sqlProjectsService';
|
import { SqlProjectsService } from './sqlProjects/sqlProjectsService';
|
||||||
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
@@ -194,12 +192,10 @@ function getClientOptions(context: AppContext): ClientOptions {
|
|||||||
SqlAssessmentService.asFeature(context),
|
SqlAssessmentService.asFeature(context),
|
||||||
NotebookConvertService.asFeature(context),
|
NotebookConvertService.asFeature(context),
|
||||||
ProfilerFeature,
|
ProfilerFeature,
|
||||||
SqlMigrationService.asFeature(context),
|
|
||||||
SqlCredentialService.asFeature(context),
|
SqlCredentialService.asFeature(context),
|
||||||
TableDesignerFeature,
|
TableDesignerFeature,
|
||||||
ExecutionPlanServiceFeature,
|
ExecutionPlanServiceFeature,
|
||||||
ErrorDiagnosticsProvider.asFeature(context),
|
ErrorDiagnosticsProvider.asFeature(context)
|
||||||
TdeMigrationService.asFeature(context)
|
|
||||||
],
|
],
|
||||||
outputChannel: outputChannel,
|
outputChannel: outputChannel,
|
||||||
// Automatically reveal the output channel only in dev mode, so that the users are not impacted and issues can still be caught during development.
|
// Automatically reveal the output channel only in dev mode, so that the users are not impacted and issues can still be caught during development.
|
||||||
|
|||||||
@@ -1,78 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
import * as mssql from 'mssql';
|
|
||||||
import { AppContext } from '../appContext';
|
|
||||||
import { SqlOpsDataClient, ISqlOpsFeature } from 'dataprotocol-client';
|
|
||||||
import { ClientCapabilities } from 'vscode-languageclient';
|
|
||||||
import * as constants from '../constants';
|
|
||||||
import * as contracts from '../contracts';
|
|
||||||
|
|
||||||
export class TdeMigrationService implements mssql.ITdeMigrationService {
|
|
||||||
private _reportUpdate: (dbName: string, succeeded: boolean, error: string) => void = undefined;
|
|
||||||
|
|
||||||
public static asFeature(context: AppContext): ISqlOpsFeature {
|
|
||||||
return class extends TdeMigrationService {
|
|
||||||
constructor(client: SqlOpsDataClient) {
|
|
||||||
super(context, client);
|
|
||||||
}
|
|
||||||
|
|
||||||
fillClientCapabilities(capabilities: ClientCapabilities): void {
|
|
||||||
}
|
|
||||||
|
|
||||||
initialize(): void {
|
|
||||||
this.client.onNotification(contracts.TdeMigrateProgressEvent.type, e => {
|
|
||||||
if (this._reportUpdate === undefined) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._reportUpdate(e.name, e.success, e.message);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private constructor(context: AppContext, protected readonly client: SqlOpsDataClient) {
|
|
||||||
context.registerService(constants.TdeMigrationService, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
async migrateCertificate(
|
|
||||||
tdeEnabledDatabases: string[],
|
|
||||||
sourceSqlConnectionString: string,
|
|
||||||
targetSubscriptionId: string,
|
|
||||||
targetResourceGroupName: string,
|
|
||||||
targetManagedInstanceName: string,
|
|
||||||
networkSharePath: string,
|
|
||||||
accessToken: string,
|
|
||||||
reportUpdate: (dbName: string, succeeded: boolean, message: string) => void): Promise<mssql.TdeMigrationResult> {
|
|
||||||
|
|
||||||
this._reportUpdate = reportUpdate;
|
|
||||||
let params: contracts.TdeMigrationParams = {
|
|
||||||
encryptedDatabases: tdeEnabledDatabases,
|
|
||||||
sourceSqlConnectionString: sourceSqlConnectionString,
|
|
||||||
targetSubscriptionId: targetSubscriptionId,
|
|
||||||
targetResourceGroupName: targetResourceGroupName,
|
|
||||||
targetManagedInstanceName: targetManagedInstanceName,
|
|
||||||
networkSharePath: networkSharePath,
|
|
||||||
networkShareDomain: 'a', // Will remove this on the next STS version
|
|
||||||
networkShareUserName: 'b',
|
|
||||||
networkSharePassword: 'c',
|
|
||||||
accessToken: accessToken
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
// This call needs to be awaited so, the updates are sent during the execution of the task.
|
|
||||||
// If the task is not await, the finally block will execute and no update will be sent.
|
|
||||||
const result = await this.client.sendRequest(contracts.TdeMigrateRequest.type, params);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this.client.logFailedRequest(contracts.TdeMigrateRequest.type, e);
|
|
||||||
} finally {
|
|
||||||
this._reportUpdate = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,12 +7,12 @@ import * as azdata from 'azdata';
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { MigrationStateModel, MigrationTargetType } from '../../models/stateMachine';
|
import { MigrationStateModel, MigrationTargetType } from '../../models/stateMachine';
|
||||||
import { SqlDatabaseTree } from './sqlDatabasesTree';
|
import { SqlDatabaseTree } from './sqlDatabasesTree';
|
||||||
import { SqlMigrationImpactedObjectInfo } from 'mssql';
|
|
||||||
import { SKURecommendationPage } from '../../wizard/skuRecommendationPage';
|
import { SKURecommendationPage } from '../../wizard/skuRecommendationPage';
|
||||||
import * as constants from '../../constants/strings';
|
import * as constants from '../../constants/strings';
|
||||||
import * as utils from '../../api/utils';
|
import * as utils from '../../api/utils';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
|
import { SqlMigrationImpactedObjectInfo } from '../../service/contracts';
|
||||||
|
|
||||||
export type Issues = {
|
export type Issues = {
|
||||||
description: string,
|
description: string,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { SqlMigrationAssessmentResultItem, SqlMigrationImpactedObjectInfo } from 'mssql';
|
|
||||||
import { MigrationStateModel, MigrationTargetType } from '../../models/stateMachine';
|
import { MigrationStateModel, MigrationTargetType } from '../../models/stateMachine';
|
||||||
import * as constants from '../../constants/strings';
|
import * as constants from '../../constants/strings';
|
||||||
import { debounce } from '../../api/utils';
|
import { debounce } from '../../api/utils';
|
||||||
@@ -13,6 +12,7 @@ import * as styles from '../../constants/styles';
|
|||||||
import { EOL } from 'os';
|
import { EOL } from 'os';
|
||||||
import { selectDatabasesFromList } from '../../constants/helper';
|
import { selectDatabasesFromList } from '../../constants/helper';
|
||||||
import { getSourceConnectionProfile } from '../../api/sqlUtils';
|
import { getSourceConnectionProfile } from '../../api/sqlUtils';
|
||||||
|
import { SqlMigrationAssessmentResultItem, SqlMigrationImpactedObjectInfo } from '../../service/contracts';
|
||||||
|
|
||||||
const styleLeft: azdata.CssStyles = {
|
const styleLeft: azdata.CssStyles = {
|
||||||
'border': 'none',
|
'border': 'none',
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as mssql from 'mssql';
|
|
||||||
import { MultiStepResult, MultiStepState } from '../dialog/generic/multiStepStatusDialog';
|
import { MultiStepResult, MultiStepState } from '../dialog/generic/multiStepStatusDialog';
|
||||||
import * as constants from '../constants/strings';
|
import * as constants from '../constants/strings';
|
||||||
import { getSourceConnectionString, getTargetConnectionString, LoginTableInfo } from '../api/sqlUtils';
|
import { getSourceConnectionString, getTargetConnectionString, LoginTableInfo } from '../api/sqlUtils';
|
||||||
@@ -57,7 +56,7 @@ export interface Login {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class LoginMigrationModel {
|
export class LoginMigrationModel {
|
||||||
public resultsPerStep: Map<mssql.LoginMigrationStep, mssql.StartLoginMigrationResult>;
|
public resultsPerStep: Map<contracts.LoginMigrationStep, contracts.StartLoginMigrationResult>;
|
||||||
public collectedSourceLogins: boolean = false;
|
public collectedSourceLogins: boolean = false;
|
||||||
public collectedTargetLogins: boolean = false;;
|
public collectedTargetLogins: boolean = false;;
|
||||||
public loginsOnSource: LoginTableInfo[] = [];
|
public loginsOnSource: LoginTableInfo[] = [];
|
||||||
@@ -70,7 +69,7 @@ export class LoginMigrationModel {
|
|||||||
private _loginMigrationSteps: LoginMigrationStep[] = [];
|
private _loginMigrationSteps: LoginMigrationStep[] = [];
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.resultsPerStep = new Map<mssql.LoginMigrationStep, mssql.StartLoginMigrationResult>();
|
this.resultsPerStep = new Map<contracts.LoginMigrationStep, contracts.StartLoginMigrationResult>();
|
||||||
this._logins = new Map<string, Login>();
|
this._logins = new Map<string, Login>();
|
||||||
this.setLoginMigrationSteps();
|
this.setLoginMigrationSteps();
|
||||||
}
|
}
|
||||||
@@ -146,7 +145,7 @@ export class LoginMigrationModel {
|
|||||||
logins.forEach(login => this.addNewLogin(login));
|
logins.forEach(login => this.addNewLogin(login));
|
||||||
}
|
}
|
||||||
|
|
||||||
public addLoginMigrationResults(step: LoginMigrationStep, newResult: mssql.StartLoginMigrationResult): void {
|
public addLoginMigrationResults(step: LoginMigrationStep, newResult: contracts.StartLoginMigrationResult): void {
|
||||||
const exceptionMap = this.getExceptionMapWithNormalizedKeys(newResult.exceptionMap);
|
const exceptionMap = this.getExceptionMapWithNormalizedKeys(newResult.exceptionMap);
|
||||||
this._currentStepIdx = this._loginMigrationSteps.findIndex(s => s === step) + 1;
|
this._currentStepIdx = this._loginMigrationSteps.findIndex(s => s === step) + 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user