Yes you can.
Regarding the Azure Function, I don't have aready to go sample now, but from an Azure Function you can create a local file and then download it to the client.
To create a local file from an Azure Function, this is a quick sample:
using System;
using System.IO;
public static void Run(TimerInfo myTimer, TraceWriter log)
{
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
var filePath = Path.Combine(Environment.ExpandEnvironmentVariables("%HOME%"), @"site\wwwroot", "testfile.txt");
File.WriteAllText(filePath, $"Writing to file at {DateTime.Now}.");
var read = File.ReadAllText(filePath);
log.Info($"Read from file: {read}");
}
Note that the file is created on Azure local function storage. It mst then be pushed to the client.