Created
April 30, 2020 01:57
-
-
Save xximjasonxx/eb940e482be2f9c24ec3bf73b1703957 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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