loading...
Cover image for So You Forgot to Feed Your Sourdough Starter Baby? πŸžπŸ‘Ά

So You Forgot to Feed Your Sourdough Starter Baby? πŸžπŸ‘Ά

sophia_wyl profile image Sophia Li Updated on ・6 min read

As a self-taught developer, I've built a bunch of projects, but the best are the ones that solve real problems. A real problem that I and many others have faced, is forgetting to feed our babies. Don't worry, not actual babies, but sourdough starter babies! With shelter in place and physical distancing measures to lower the curve, we have a lot less toilet paper and staples like bread in the stores, and a lot more time at home. Consequently, this has resulted in a rise of sourdough baking, and the key to making sourdough bread is starter.

Check out this fun Tweet by Danielle that proofs the rise of sourdough home bakers:

Starter is live wild yeast used to make sourdough bread. You can make it in your own home with a few ingredients and some time! Making starter is a week-long process that involves a chemical reaction between the combination of flour, water, and air. On the first day, you mix flour and water in a jar and let it sit out with the lid slightly ajar. After 24 hours, on day two, you discard about 95% of your original starter, and replace it with a mix of equal parts water and flour. You repeat this process for an entire week, and at the end of the week, you'll have a bubbly and active starter ready to make you some bread. Here's a video on how to make your own starter.

Here's what starter looks like at a production scale:
Alt Text

To keep your starter alive and healthy, you need to feed it every 24 hours. If you forget to feed it long enough, then, well... it dies 😡. So it's important that we remember to feed it! Let's set up a text message reminder to feed your starter baby so you can keep it bubbly and active to make sourdough bread.

πŸ›  To get started, let's set up a few tools.

  1. Azure account: We'll set up a free Azure account so we can run our code without having to worry about application infrastructure. You can read more about Azure Functions here.
  2. Twilio account: Twilio is a platform that enables communication between devices and apps through their cloud communications API. We'll sign up for their free trial to get a number that we can use to text ourselves.
  3. Visual Studio (VS) Code: We'll be using VS Code for our text editor because we need to use the Azure Extension. You can download it for free from the VS Code Marketplace.

πŸ‘©β€πŸ’» Now that we have our tools, let’s get coding.

1. Create a Function App in your Azure portal.

red box highlighting Function App
To get started, we'll create a function in our Azure portal by selecting Create a new Resource and then creating a new Function App. You'll need to fill out some basic information to set up your Function. These are some of the options I chose in my setup:

  • Resource Group: sourdough-timer
  • Function App name: sourdough-timer
  • Runtime: Node.js
  • Version: 12
  • Region: West US 2 (I'm in California, choose your location)
  • Operating System: Linux

2. Create a Timer trigger function in VS Code.

red box to highlight lightning bolt with green plus sign
Before we start coding, make sure you're signed into your Azure account in VS Code. Once you're logged in, navigate to your Azure Extension and create a new function (lightning bolt with green plus sign). We'll select the Timer trigger template for our Function. For my setup, I chose JavaScript as my language. I also set the CRON expression to 0 0 15 * * *, which translates to 8:00AM Pacific Time for me. This is when our text message will get sent.

Once our project is created, we'll use this Timer trigger code template.

3. Save our Twilio credentials and numbers to Azure Functions

Next, we'll need to save the following information:

  • TWILIO_SID - You can find your account SID on your Twilio home page.
  • TWILIO_TOKEN - Your can find your token on your Twilio home page.
  • SENDER_NUMBER - Your Twilio number.
  • RECIPIENT_NUMBER - Your cell phone number.

To keep our information secure, let's save it under Azure's configuration settings so we can access it in our environment. It'll look like this:
screenshot of Azure environment with our four variables: TWILIO_SID, TWILIO_TOKEN, SENDER_NUMBER, and RECIPIENT_NUMBER

We'll access our Twilio credentials and numbers in our code by calling our variables with process.env, which gives us access to all existing environment variables:

4. Install the Twilio module

Now that we have our Twilio credentials saved and ready to go, we need to install the Twilio module so our scripts can use it.

Open up your terminal and run: npm install twilio

If you don't already have npm installed, here are some instructions.

5. Add our text message and phone numbers

Next, we're going to add the message and our phone numbers.

For to and from, we'll put our RECIPIENT_NUMBER and SENDER_NUMBER variables, respectively. As a reminder, we saved our numbers in our Azure configurations so we could access our numbers in the environment with process.env. This keeps our information secure because we don't have to type our numbers directly in our code which may end up in a public repository.

Now we can add a message to remind ourselves to feed our baby starter in body. I put "Don't forget to feed me!".

Here's the template code for adding our text message:

6. Deploy it!

red box to highlight the blue arrow deploy button
Now you have everything you knead, deploy your code by selecting the deploy button in VS Code (blue arrow button). You might have to wait a minute or two for your first deploy.

red box to highlight run button in Azure portal
Once it's finished deploying, let's switch over to our Azure portal and click run to test out our Timer trigger.

Here's a screenshot of what it looks like:
screenshot of text message from Martha saying "Don't forget to feed me!"

Congratulations, your Timer trigger function worked! πŸŽ‰ Now you'll start getting text message reminders to feed your starter at your scheduled time.

If you need to put your sourdough baking on pause, you can put your starter in the fridge. This slows down the fermentation rate, so you won't need to feed your starter everyday. To turn off the text message reminders, you can stop your Azure function. When you're ready to make sourdough again, take your starter out of the fridge and feed it to activate it again. Doughn't forget to turn on your Timer function again!

To see the full code, check out my GitHub repo here.

Here's a quick video of me shaping sourdough bread when I was a baker apprentice at one of the best bakeries in San Francisco. With the help of your text message reminders, your starter will be ready in a week and you'll be ready to make sourdough bread!

If you have any sourdough tips or photos of your sourdough, leave a comment.

Happy coding and happy baking! πŸ‘©β€πŸ’»πŸž

This post was co-created with Chloe Condon, Senior Cloud Advocate at Microsoft, organizer of Bootcamp Office Hours and host of the BCC: All podcast πŸŽ€. Check out her post here.

Posted on by:

Discussion

pic
Editor guide
 

So cool, I am myself a self-taught home baker since I'm French and couldn't find any good (and cheap) bread in Canada. Really liked your idea.

"Now you have everything you knead" πŸ˜‚

GJ! πŸ‘

 

I loved the pun as well!

 

Thanks! Was just trying to a rise out of people πŸ˜‚

 

Nice, this is such a creative idea!

 

I approve of this bread content!

🍞

 

Thanks! 🀩🍞

 

Thanks for sharing that tweet, good to know my wife and I are stereotypes πŸ˜‚

Also studying for an Azure cert right now, so thanks for the quick intro to Functions!

 

Good luck on the Azure cert! I've only gotten started with the basics of Azure, but I'm already impressed by how much it can do!

 

@sophia_wyl this is amazing! You make Azure functions look so simple, I will definitely need to check them out. Love the tie into a hobby and the current state of the world.

 

Thanks! When I started baking sourdough, there were many times I forgot to feed my starter, so I figured this might be helpful to people now.

 

I love it. I've started to bake bread with my own sourdough during lockdown. I'll try your reminder!

 

Good luck with the sourdough baking, let me know if you have any sourdough or project questions!