private async Task ExecuteDownloadFromSplunk(FileType fileType) { try { if (fileType != null) { var result = await _splunkService.DownloadCSV(fileType); if (result?.ExtractResponseMessage.StatusCode == System.Net.HttpStatusCode.OK) { var uploadedBlob = await _blobService.AddObjectToBlob(result); if (uploadedBlob != null) { var fileAddedCount = await _importService.AddFile(fileType.FileTypeId, result.FilePath); await _blobService.AddMessageToBlobQueue(fileAddedCount, fileType.FileTypeId, result.FilePath); } } else { _logger?.LogWarning(result?.ExtractResponseMessage.ReasonPhrase, result?.ExtractResponseMessage.StatusCode); } } } catch (Exception exc) { _logger?.LogError(exc, $"An error has occurred while attempting to execute an Azure function"); throw; } }