private bool Create_WebApp_PaaS_Model()

in src/Assessment/Processor/ProcessDatasets.cs [1188:1246]


        private bool Create_WebApp_PaaS_Model(List<WebApp_PaaS> WebApp_PaaS_List, HashSet<string> AzureWebApp_Opportunity)
        {
            if (AzureWebAppData == null)
            {
                UserInputObj.LoggerObj.LogWarning("Not creating excel model for WebApp_PaaS as Azure WebApp dataset is null");
                return false;
            }
            if (AzureWebAppData.Count <= 0)
            {
                UserInputObj.LoggerObj.LogWarning($"Not creating excel model for WebApp_PaaS as Azure WebApp dataset is empty");
                return false;
            }

            UserInputObj.LoggerObj.LogInformation("Creating excel model for WebApp_PaaS");

            if (WebApp_PaaS_List == null)
                WebApp_PaaS_List = new List<WebApp_PaaS>();
            if (AzureWebApp_IaaS == null)
                AzureWebApp_IaaS = new HashSet<string>();
            if (AzureWebApp_Opportunity == null)
                AzureWebApp_Opportunity = new HashSet<string>();
            

            foreach (var webApp in AzureWebAppData)
            {
                if (webApp.Value.Suitability != Suitabilities.Suitable && webApp.Value.Suitability != Suitabilities.ConditionallySuitable)
                {
                    if (!AzureWebApp_Opportunity.Contains(webApp.Key))
                        AzureWebApp_Opportunity.Add(webApp.Key);
                    if (!AzureWebApp_IaaS.Contains(webApp.Value.DiscoveredMachineId))
                        AzureWebApp_IaaS.Add(webApp.Value.DiscoveredMachineId);
                    
                    continue;
                }

                WebApp_PaaS obj = new WebApp_PaaS();

                obj.MachineName = webApp.Value.MachineName;
                obj.WebAppName = webApp.Value.WebAppName;
                obj.Environment = webApp.Value.Environment;
                obj.AzureAppServiceReadiness = new EnumDescriptionHelper().GetEnumDescription(webApp.Value.Suitability);
                obj.AzureAppServiceReadiness_Warnings = UtilityFunctions.GetMigrationIssueWarnings(webApp.Value.MigrationIssues);
                obj.AppServicePlanName = webApp.Value.AppServicePlanName;
                obj.RecommendedSKU = webApp.Value.WebAppSkuName;
                obj.MonthlyComputeCostEstimate = webApp.Value.EstimatedComputeCost;
                obj.MonthlyComputeCostEstimate_RI3year = webApp.Value.EstimatedComputeCost_RI3year;
                obj.MonthlyComputeCostEstimate_ASP3year = webApp.Value.EstimatedComputeCost_ASP3year;
                obj.MonthlySecurityCostEstimate = webApp.Value.MonthlySecurityCost;
                obj.AzureRecommendedTarget = webApp.Value.AzureRecommendedTarget;
                obj.GroupName = webApp.Value.GroupName;
                obj.MachineId = webApp.Value.DiscoveredMachineId;

                WebApp_PaaS_List.Add(obj);
            }

            UpdateIndividualWebAppPaaSCosts(WebApp_PaaS_List);
            UserInputObj.LoggerObj.LogInformation($"Updated WebApp_PaaS excel model with data of {WebApp_PaaS_List.Count} web applications");
            return true;
        }