diff --git a/src/Microsoft.SqlTools.Migration/MigrationService.cs b/src/Microsoft.SqlTools.Migration/MigrationService.cs index 219f0f76e4..79bd940863 100644 --- a/src/Microsoft.SqlTools.Migration/MigrationService.cs +++ b/src/Microsoft.SqlTools.Migration/MigrationService.cs @@ -606,14 +606,14 @@ internal async Task HandleEstablishUserMapping( /// Handle request generate the ARM template. /// internal async Task HandleGetArmTemplateRequest( - string skuRecommendationReportFileName, + string targetType, RequestContext> requestContext) { try { ProvisioningScriptServiceProvider provider = new ProvisioningScriptServiceProvider(); - string skuRecommendationReportFilePath = Path.Combine(SqlAssessmentConfiguration.ReportsAndLogsRootFolderPath, skuRecommendationReportFileName); - skuRecommendationReportFilePath += ".json"; + string searchPattern = $"*{targetType}-Baseline*.json"; + string skuRecommendationReportFilePath = Directory.GetFiles(SqlAssessmentConfiguration.ReportsAndLogsRootFolderPath, searchPattern).FirstOrDefault(); List recommendations = ExtractSkuRecommendationReportAction.ExtractSkuRecommendationsFromReport(skuRecommendationReportFilePath); List templateList = provider.GenerateProvisioningScript(recommendations); List armTemplates = new List();