This article is part of #25DaysOfServerless. New challenges will be published every day from Microsoft Cloud Advocates throughout the month of December. Find out more about how Microsoft Azure enables your Serverless functions.
Have an idea or a solution? Share your thoughts on Twitter!
So, an evil grinch has stolen all the servers in the world, and we have to visit many countries to set things right! Now you're in Stockholm, Sweden, where the children are planning for the beautiful candlelit tradition happening on December 13th, when young girls wear crowns of candles and deliver breakfast to their family. Good thing you have a little time to fix this mess; everyone has fallen back to relying on sticky notes to help them remember to do things at certain times. Let's review today's challenge:
Every December 13th, Lucy is tasked with wearing a crown with six lit candles and delivering coffee and Lussekatter (sweet rolls) to all of her family members — her mother, father, sister, and brother. Each candle only lasts ten minutes before burning out, and she needs to be careful to keep the candles lit while she delivers the coffee and rolls!
You can do this in Azure by means of a Logic App which includes a scheduling utility, paired with Twilio, to send yourself SMS reminders.
Tip
It helps to sketch out Lucy's planned itinerary:
8:00 AM - start the coffee, set out 4 cups
8:25 AM - pour two cups
8:30 AM - light the candles
8:35 AM - deliver the coffee to Mom and Dad
8:39 AM - return to kitchen, fill two more cups
8:40 AM - relight the candles
8:45 AM - deliver the coffee to Sister and Brother
8:49 AM - return to kitchen, take a break!
A Solution
In the Azure Portal, create an Azure Logic App by clicking the '+' at the top right and clicking 'create' and choosing your subscription and resource group. In the resource you created, choose "Create Blank Logic App" to open the Logic App Designer.
Now you can search for connectors and triggers. I created a logic app to remind Lucy to light the candles by connecting the Schedule Trigger to the Twilio Action, making sure to run the scheduler for candles at 8:30 and 8:40 on Dec 13th at the proper time zone (Stockholm is UTC+1).
Learn more about how to set up recurrent tasks here.
Then, I created a test account on Twilio (it comes with $15.50 in credits), connected it to my phone number, and tested it using a sample Twilio number. So now, I'm all set to be reminded to light the candles at a given time.
Now you can focus on creating the task flow in the Azure Portal via the GUI tool. You could have a series of tasks for starting the process, for delivering the coffee, and for returning to the kitchen. Lucy will be all set! Here is a community solution:
In this solution by Marcus Turewicz you can see how the logic app is created as a sequence of scheduled tasks and delays. This works really well!
Want to submit your solution to this challenge? Build a solution locally and then submit an issue. If your solution doesn't involve code you can record a short video and submit it as a link in the issue desccription. Make sure to tell us which challenge the solution is for. We're excited to see what you build! Do you have comments or questions? Add them to the comments area below.
Watch for surprises all during December as we celebrate 25 Days of Serverless. Stay tuned here on dev.to as we feature challenges and solutions! Sign up for a free account on Azure to get ready for the challenges!
Top comments (0)