Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created May 1, 2020 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xximjasonxx/41c5b925a4b276bf78f2b89d2625583a to your computer and use it in GitHub Desktop.
Save xximjasonxx/41c5b925a4b276bf78f2b89d2625583a to your computer and use it in GitHub Desktop.
[FunctionName("DequeueGeneratedNames")]
[return: Blob("raw-names/{id}.txt", FileAccess.Write, Connection = "AzureWebJobsStorage")]
public static async Task<string> Run(
[ServiceBusTrigger("newnames-queue", Connection = "ServiceBusConnection")]NamesGenerationRecord msg,
[EventHub("names", Connection = "EventHubSendConnection")]IAsyncCollector<string> outputEvents,
ILogger log)
{
foreach (var nameRecord in msg.GeneratedNames)
{
await outputEvents.AddAsync(nameRecord.ToString());
}
return msg.ToString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment