Skip to content

Instantly share code, notes, and snippets.

Created May 9, 2020 01:11
What would you like to do?
[return: ServiceBus("newnames-queue", Connection = "ServiceBusConnection")]
public static async Task<string> RunTrigger(
[TimerTrigger("*/3 * * * * *")]TimerInfo myTimer,
[EventHub("names", Connection = "EventHubSendConnection")] IAsyncCollector<string> outputEvents,
ILogger log
var names = await GetNames();
foreach (var nameRecord in names)
await outputEvents.AddAsync(nameRecord.ToString());
return (new JObject(
new JProperty("id", Guid.NewGuid().ToString()),
new JProperty("data", names.Select(name => new JObject(
new JProperty("name", name)
[return: Blob("raw-names/{id}.txt", FileAccess.Write, Connection = "AzureWebJobsStorage")]
public static string Run(
[ServiceBusTrigger("newnames-queue", Connection = "ServiceBusConnection")]NamesGenerationRecord msg,
ILogger log)
return msg.ToString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment