Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created April 30, 2020 01:57
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/eb940e482be2f9c24ec3bf73b1703957 to your computer and use it in GitHub Desktop.
Save xximjasonxx/eb940e482be2f9c24ec3bf73b1703957 to your computer and use it in GitHub Desktop.
[FunctionName("GenerateNamesTimerFunction")]
[return: ServiceBus("newnames-queue", Connection = "ServiceBusConnection")]
public static async Task<string> RunTrigger(
[TimerTrigger("*/3 * * * * *")]TimerInfo myTimer,
ILogger log
)
{
var names = await GetNames();
var output = (new JObject(
new JProperty("id", Guid.NewGuid().ToString()),
new JProperty("data", names.Select(name => new JObject(
new JProperty("name", name)
)))
)).ToString();
return output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment