private void DownloadLogieAppsToModel(ErrorReportArgs errorReportArgs, LogicAppManager logicAppManager, Model model) { //Get all logic apps into model Console.WriteLine("Downloading logic app list"); foreach (var resourceGroup in errorReportArgs.ResourceGroups) { var resourceGroupModel = new ResourceGroupModel(); resourceGroupModel.Name = resourceGroup; model.ResourceGroups.Add(resourceGroupModel); var logicApps = logicAppManager.GetLogicAppList(resourceGroup); foreach (var logicApp in logicApps) { var logicAppModel = new LogicAppModel(); logicAppModel.Id = logicApp.Id; logicAppModel.LogicAppManagementObject = logicApp; logicAppModel.Name = logicApp.Name; logicAppModel.ResourceGroupName = resourceGroupModel.Name; resourceGroupModel.LogicApps.Add(logicAppModel); } Console.WriteLine($"Completed downloading logic app list for resource group: {resourceGroup}"); } }
private async Task<int> OnExecuteAsync(CommandLineApplication app, CancellationToken cancellationToken = default) { Console.WriteLine("Welcome to tools from the Integration Playbook"); Console.WriteLine("Check out https://www.integration-playbook.io/docs for more integration content for the Microsoft Platform"); Console.WriteLine("----------------------------------------------------------------------------------------------------------"); Console.WriteLine("Running the Logic App Error Report"); Console.WriteLine($"Start Date: {StartDate}"); Console.WriteLine($"End Date: {EndDate}"); var errorReportArgs = new ErrorReportArgs() { OutputExcelPath = ExcelOutputPath, Secret = ClientSecret, SubscriptionId = SubscriptionId, TenantId = TenantId, WebApiApplicationId = ClientId, StartDate = StartDate, EndDate = EndDate }; errorReportArgs.ResourceGroups.AddRange(ResourceGroups); var reportManager = new ErrorReportManager(); reportManager.ErrorReportArgs = errorReportArgs; reportManager.Execute(); Console.WriteLine("Report generation complete"); Console.ReadLine(); return 0; }