public byte[] GetFileBytes(string fileName, ShareDirectoryClient sourceDirectory) { try { var fileClient = sourceDirectory.GetFileClient(fileName); var fileByteArray = Download(fileClient.Download()); if (fileByteArray is null) { Log.Error($"{nameof(GetFileBytes)}: Downloading of file failed, returning."); return null; } return fileByteArray; } catch (Exception ex) { Log.Error($"Something went wrong in {nameof(GetFileBytes)}: {ex.Message}."); return null; } }