public async Task Transcript( [BlobTrigger("calls/{fileName}", Connection = "AzureWebJobsStorage")] Stream blob, string fileName, IBinder binder, [TwilioSms(From = "%fromPhoneNumber%", AccountSidSetting = "accountSid", AuthTokenSetting = "authToken")] IAsyncCollector <CreateMessageOptions> asyncCollector, ILogger log ) { try { var text = await _speechService.ToText(blob); if (string.IsNullOrWhiteSpace(text)) { return; } var blobName = $"transcripts/{fileName.Replace("wav", "txt")}"; var attribute = new BlobAttribute(blobName, FileAccess.Write) { Connection = "AzureWebJobsStorage" }; await using var stream = new MemoryStream(Encoding.UTF8.GetBytes(text)); await using var blobTranscription = await binder.BindAsync <Stream>(attribute); await stream.CopyToAsync(blobTranscription); await asyncCollector.AddAsync( new CreateMessageOptions( new PhoneNumber( Environment.GetEnvironmentVariable("toPhoneNumber", EnvironmentVariableTarget.Process))) { Body = "Your message has been saved and transcribed" }); log.LogInformation("Done"); } catch (Exception e) { log.LogCritical(e, e.Message); throw; } }