Git Product home page Git Product logo

seasons-of-serverless's Introduction

banner

Welcome to the Seasons of Serverless!

Mes chers amis,

Every year, we all look forward to our annual holiday potluck. From jollof rice all across West Africa to Indian ladoos to celebrate Diwali, sharing our favorite foods and traditions is our favorite part of the season!

Of course, we know that's not possible this year, so we've come up with an alternative: a virtual code challenge potluck! Each week, someone in our community is going to post a unique code challenge exploring a recipe and a food for all of our friends to solve. It may not be the same as breaking bread in-person or smelling and tasting your flavorful creations, but hopefully these delectable brain-teasers can still give us a taste of each other's traditions.

Grosses bises, Dominique et Simone

Challenge 7: The Recipe Connector

Featured Region: Africa

Your Chefs: Bethany Jepchumba, Adefemi Afuwape and Felix Omuok, Microsoft Student Ambassadors

In Africa, city cooks want to reconnect with their country roots. In Kenya, there are many traditional dishes, but no one in Nairobi remembers how to make them! In Lagos, Nigeria, cooks are eager to recreate their grandmother's famous jollof rice, but they can't quite remember the proportions of ingredients. Let's set up a City/Country hotline! Learn more about this challenge.

Contents

Main Goal

Each year at this time, we prepare something special to help you learn Serverless once and for all with a series of challenges. This year, we decided to feature seven unique challenges, one per week. Come join us!

Rules

  1. Solve each coding challenge in the week it gets published.

  2. Tweet your progress during the challenge period using the hashtag #SeasonsOfServerless.

  3. Submit the code of your solution as an Issue to this repository.

  4. You may get picked for a mention on social media. If you submit an Issue you agree that we mention your name and/or nicknames (GitHub, Twitter) publicly in the context of Seasons of Serverless.

Suggested Resources

Azure For Students Account

If you are a student at a College or University, you can create your Azure for Students account. This account will give you the benefit of having a $ 100 credit to use the Azure Services for free, without having a credit card and free developer tools as well. To activate this account, just access the link HERE.

Submit your solution as a tagged ISSUE to our repository

🚨 Submission Process: 🚨

Be among the first contributors and solve the challenge within 7 days of publishing. To have your contribution acknowledged, follow our CONTRIBUTING.md guidelines. The short version:

  1. Create a Github repo with your solution for that challenge
  2. Fill in the details for the Challenge Solution Submission issue and submit.

Have questions or comments? Submit a regular ISSUE here with details.

Discord Channel

Discussion Channels are available on the Azure Functions Discord Server: Permanent Link to Server
We ask everyone to be fair and helpful and to not spoil the challenges by publishing solutions prominently. The Microsoft Open Source Code of Conduct applies to all discussion channels.

Solutions

Here are all the sample solutions.

Solutions by Week

Date Description Region Chefs Solution
Nov 23 The Perfect Turkey North America Jen Looper, Eric Yu, Darren Butler Solution
Nov 30 Lovely Ladoos India Jasmine Greenaway, Soumya Narapaju, Aditya Raman Solution
Dec 7 The Longest Kebab Turkey Cecil Phillip, Baris Ceviz Solution
Dec 14 A Big BBQ! Brazil/LATAM Lucas Santos, Rogerio Rodrigues, Sydney Cirqueira Solution
Dec 21 The Best Soup Korea Justin Yoo, You Jin Kim, Hong Min Kim and Aaron Roh Solution
Dec 28 The Magic Chocolate Box France Christopher Maneu, Abdelmoumene Boumadane and Christopher Chichmanian Solution
Jan 4 The Recipe Connector Africa Bethany Jepchumba, Adefemi Afuwape and Felix Omuok Solution

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit our contributions doc.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

seasons-of-serverless's People

Contributors

jansche avatar jlooper avatar lazerwalker avatar marcduiker avatar shmool avatar yorek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seasons-of-serverless's Issues

[CHALLENGE SUBMISSION] - JavaScript

Please provide the following information for your submission:

What is your name? (First, Last)

Locksley Kolakowski

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/LocksleyLK/seasons-of-serverless/tree/master/longestKebab

What Challenge is this for? (Challenge number between 1 and 7)

2

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I used JavaScript for my solution.

[CHALLENGE SUBMISSION] JavaScript

What is your name? (First, Last)

Locksley Kolakowski

Where is your GitHub Repo? (Link to your challenge solution)

GitHub repo

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I used JavaScript for my solution!

[CHALLENGE SUBMISSION] Pass! The Cranberry Sauce!

Please provide the following information for your submission:

What is your name?

Philip Metz

Where is your GitHub Repo ?

https://github.com/MetzinAround/PerfectTurkey

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I'm a self taught C# coder looking for an opportunity for his first job. I made this in ASP.NET core using a C# class to hold the recipe logic. I have no idea what I'm doing and hope this works.

Note: not formatted for mobile.

Challenge 1 Solution - Python

What is your name? (First, Last)
Matt Manuel

Where is your GitHub Repo ?(Link to your challenge solution)
https://github.com/matt-manuel/seasons-of-serverless

What Challenge is this for? (Challenge number between 1 and 7)
1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Done in Python. Located near Vancouver, BC.
Ran into a challenge setting up a free tier function using Python. "x64 not supported error" Changed to Basic tier and it worked.

Note: No input sanitizing yet. Will crash on non-numeric input, for example. :-|

Sample call:
https://sos-mamanuel.azurewebsites.net/api/PerfectTurkey?weight=10.1

[CHALLENGE SUBMISSION] Challenge 1 - JavaScript

What is your name? (First, Last)

Christophe Chichmanian

Where is your GitHub Repo ? (Link to your challenge solution)

https://github.com/Christophe-Ch/SeasonsOfServerless2020/tree/main/the-perfect-turkey

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

For this challenge I decided to use JavaScript as I find it more efficient in terms of quantity of code for small challenges like this. When triggering the Azure Function, there are two possible outputs :

  • 202 status with an object in which ingredients and times are split
  • 400 status with an error message when the weight isn't specified or is invalid

[CHALLENGE SUBMISSION] Challenge 2 - TypeScript

Please provide the following information for your submission:

What is your name? (First, Last)

Christian Lechner

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/lechnerc77/SeasonOfServerlessWeek2

What Challenge is this for? (Challenge number between 1 and 7)

2

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

The language used is TypeScript. The classification works for ladoo, doughnuts and cake (when I say cake, I mean Apple pie :-))

I deviated a bit from the original task to provision the image via file upload, but this makes the call in Azure a bit cumbersome, which is the reason why this solution focuses on the URL-based provisioning of pictures. However, the code contains the relevant calls to read a file form the files system and the call of the Custom Vision API.

You cannot run the function locally, as the keys for the Custom Vision API are not pushed to this repository. They are stored in local.settings.json and the App Settings. The API is provisioned on Azure at the endpoint https://seasonofserverlessweek2.azurewebsites.net/api/LovelyLadoosClassifier (No authentication needed - imho better tradeoff than publishing the keys and internal information of the custom vision API).

[CHALLENGE SUBMISSION] - Challenge One (C#, Azure Functions, Blazor, Static Web App)

Please provide the following information for your submission:

What is your name? (First, Last)

Stuart Leaver

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/stuartleaver/seasons-of-serverless/tree/main/01-the-perfect-turkey

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

C#, an Azure Function, Blazor and a Static Web App. Try it out at http://www.theperfectturkey.cloud

[CHALLENGE SUBMISSION] Week 3 Azure Function in TypeScript

Please provide the following information for your submission:

What is your name? (First, Last)

Christian Lechner

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/lechnerc77/SeasonOfServerlessWeek3

What Challenge is this for? (Challenge number between 1 and 7)

3

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

  • The calculation of the serving is based on the recipe provided in the challenge description. The base unit is 453 grams of ground lamb which delivers 4 servings
  • The length of the kebab is calculated based on the following assumptions:
    • The average density of ground lamb is 0.96 g/ml (comparable to beef). With this information we can calculate the volume of the lamb (we neglect the volume added by the other ingredients)
    • We assume the basic geometric form of kebab is a cylinder so the volume is V = rΒ² * h * πœ‹. Consequently we can calculate the length as a variable of the radius.
    • We calculate the length of the kebab in cm for 3 possible diameters (3, 6 and 9 cm)
  • The evaluation of the recipe is also based on the values given here

You can run the functions locally via npm run start. Several HTTP calls are available in the file requests.http (required: REST Client extension in VSCode)

[CHALLENGE SUBMISSION] Challenge 2 - Python, Custom Vision and Static Website Storage Account

Please provide the following information for your submission:

What is your name? (First, Last)

Rebecca Trapani

Where is your GitHub Repo ?(Link to your challenge solution)

Detailed instructions: https://github.com/errbufferoverfl/violet-lobster
Python Solution: https://github.com/errbufferoverfl/violet-lobster/tree/main/week-02
Static Website: https://stglovelyladoostest.z8.web.core.windows.net/
Azure Function Endpoint: https://lovely-ladoos.azurewebsites.net/api/classify?img=https://upload.wikimedia.org/wikipedia/commons/0/04/New_York_Empire_Apples.jpg

What Challenge is this for? (Challenge number between 1 and 7)

2

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

This solution used Food based Custom Vision with the training model based on:

  • Ladoo
  • Doughnut Holes
  • Gulab Jamen
  • Truffles

The model still struggles a lot with Apples, in particular Apples that are piled in a similar way to Ladoo images, so more training is needed.

The website is hosted on a Static Website using a storage account, and the function just returns a JSON response so you can also navigate directly to the Azure Function.

I used this article from Microsoft to get started with Python and Tensorflow.

I didn't really document much of my process, but some of my training results were tweeted about.

This was a really fun and challenging problem but lots of fun to work on!

[CHALLENGE SUBMISSION] - Challenge Three (Typescript & Angular)

Please provide the following information for your submission:

What is your name? (First, Last)

Stuart Leaver

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/stuartleaver/seasons-of-serverless/tree/main/03-the-longest-kebab

What Challenge is this for? (Challenge number between 1 and 7)

3

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Typescript. No C# is sight.

Why not take the opportunity to use a different language from normal. So for this challenge, I went for writing the Azure Function in Typescript. There is then the UI in Angular, and as before, hosted using a Static Web Site.

Try it out at - https://www.thelongestkebab.cloud

I think I've committed to buying domain names now 🀣

The length calculation came from reading Turkish Ground Lamb Kebabs (Adana Kebabs). Taking into account the amount of meat in that recipe, the number it servers, and the length of the skewers suggested, it came to about 156g equalled 25.4cm. It may only be an estimation, but these challenges are all about having fun.

[CHALLENGE SUBMISSION] Challenge 3 - JavaScript

Please provide the following information for your submission:

What is your name? (First, Last)

Christophe Chichmanian

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/Christophe-Ch/SeasonsOfServerless2020/tree/main/TheLongestKebab

What Challenge is this for? (Challenge number between 1 and 7)

3

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

URL to try the solution : https://seasonsofserverless.azurewebsites.net/api/TheLongestKebab?weight=1
with the "weight" parameter in kilos

[CHALLENGE SUBMISSION] Challenge 1 - The Perfect Turkey

Please provide the following information for your submission:

What is your name? (First, Last)

Brett Miller

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/brettmillerb/seasons-of-serverless/tree/challenge1

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Azure Functions & PowerShell

[CHALLENGE SUBMISSION] Challenge 2 - JavaScript

Please provide the following information for your submission:

What is your name? (First, Last)

Christophe Chichmanian

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/Christophe-Ch/SeasonsOfServerless2020/tree/main/LovelyLadoos

What Challenge is this for? (Challenge number between 1 and 7)

2

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

The model has been trained to detect only ladoos and doughnut holes.

I couldn't implement direct image upload. You'll have to provide an image url instead. If you don't have a trained model already set-up, you can use the Function I deployed (based directly on the code of my repo through ci/cd): https://seasonsofserverless.azurewebsites.net/api/LovelyLadoos

You can make HTTP calls to the function either by using online tools such as https://reqbin.com/, by using softwtare such as Postman or even via your web browser.

URL format: https://seasonsofserverless.azurewebsites.net/api/LovelyLadoos?url=your-url
With "your-url" being replaced by the url of your image. Example:
https://seasonsofserverless.azurewebsites.net/api/LovelyLadoos?url=https://images-gmi-pmc.edge-generalmills.com/fb2cc1ad-ed1b-4c03-b11f-3bc7690893fd.jpg

Only GET requests are accepted

[CHALLENGE SUBMISSION]

Please provide the following information for your submission:

What is your name? (First, Last)

Chris Petit

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/ChrisPetit/ThePerfectTurkey/tree/main/ThePerfectTurkey

What Challenge is this for? (Challenge number between 1 and 7)

Challenge 1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I solved this using C# and the Jetbrains Rider IDE...

You can run this using either Visual Studio, Visual Studio Code or your C# IDE of choice...

Clone the repo, open the *.sln file and choose build. Then you can run it...(F5 in Visual Studio). If you want, you can also publish it to an Azure Function App, wich I did, => https://theperfectturkey.azurewebsites.net/api/CookThePerfectTurkey/?weight=8

[CHALLENGE SUBMISSION] Week 1

Please provide the following information for your submission:

What is your name? (First, Last)

Jonathan Silvestri

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/silvestrijonathan/azure-practice/tree/main/PerfectTurkey

What Challenge is this for? (Challenge number between 1 and 7)

Challenge 1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

You can navigate here to see the code in action: https://perfect-turkey.azurewebsites.net/api/PerfectTurkey. Append a query string turkeySize with your turkey's size in numerical form. e.g. ?turkeySize=24

[CHALLENGE SUBMISSION] Week 3 - C#

Please provide the following information for your submission:

What is your name? (First, Last)

Jose R. Cadena

Where is your GitHub Repo?

https://github.com/josercadena/seasons-of-serverless-week-3

What Challenge is this for?

3

(Optional) Anything else we should know?

Solved using C# - I assumed a serving with a length of 10 cm (including all ingredients) and consistent distribution of ingredients :) More details in my repo

You can play with it here. I will delete the Azure Functions after the end of the week 🌚

[CHALLENGE SUBMISSION] Challenge 01 - PowerShell

Please provide the following information for your submission:

What is your name? (First, Last)

Barbara Forbes

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/Ba4bes/SeasonsOfServerless/tree/main/C01-The_Perfect_Turkey

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

PowerShell, a Function App and Ascii art! All other info is in the readme ;)

Can the Challenge(s) posting schedule be made available ahead of time ?

Hi,

Thanks for the seasons of serverless. Love the azure functions and hence excited to participate in this.

Suggestion: Is it possible for you to put the dates on which the challenges will be posted ahead of time - May be a bulleted list in the readme. That suffices. That lets me put a reminder for myself to look into this repo on that particular date to check the new challenge?

Thoughts ?

Thanks.

Week 4 challenge description and unclear excel file

Hi team!

I've looked at the challenge for week 4 and although the description in markdown is ok, the excel file that is linked is a bit unclear. I can imagine we'll lose some engagement due to this unclarity. Perhaps the text in the markdown can be changed to describe that the linked excel file is just an example how people deal with planning for a big BBQ and not use it as the basis for their solution. I'll submit a PR with an alternative text, OK?

[CHALLENGE SUBMISSION] Challenge 2 Custom Vision & .NET

Please provide the following information for your submission:

What is your name? (First, Last)

Marc Duiker

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/marcduiker/Seasons-of-Serverless/tree/main/src/challenge-2

What Challenge is this for? (Challenge number between 1 and 7)

2

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I've described my process in this Tweet thread: https://twitter.com/marcduiker/status/1333375872678637568

There is a Dutch snack (bitterballen) which look very similar. I added that as a second class. Added golfballs as a third class πŸ˜‚. Testing with (dark) brown ladoos is problematic due to the similarity.

Public endpoint for testing:
https://seasonsofserverless-fa.azurewebsites.net/api/getprediction?img=https://livinglargetinylot.files.wordpress.com/2012/11/raagi-ladoos.jpg

[CHALLENGE SUBMISSION] Week 3 - Python 3.8

Please provide the following information for your submission:

What is your name? (First, Last)

Rebecca Trapani

Where is your GitHub Repo ?(Link to your challenge solution)

Detailed instructions: https://github.com/errbufferoverfl/violet-lobster
Python Solution: https://github.com/errbufferoverfl/violet-lobster/tree/main/week-03
Azure Function Endpoint:

What Challenge is this for? (Challenge number between 1 and 7)

3

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I went back to basics this week so I could focus on adding in multiple options :) works using kilograms and bases it's measurement on a 12cm x 4 kebabs based on the image. The vegan recipe was based on the same ratio.

[CHALLENGE SUBMISSION] - JavaScript

Please provide the following information for your submission:

What is your name? (First, Last)

Locksley Kolakowski

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/LocksleyLK/seasons-of-serverless/tree/master/bestBBQ

What Challenge is this for? (Challenge number between 1 and 7)

4

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

[CHALLENGE SUBMISSION]

Please provide the following information for your submission:

What is your name? (First, Last)

Francesco La Torre

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/Francescolatorre/serverless-challenge-turkey

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I created it as a Azure Function using Javascript created following a TDD approach, providing a jest test with the solution.
It was quite easy and fun πŸ’―.
I din't provide any user interface or such, the recipe is provided as json.

[CHALLENGE SUBMISSION] - Challenge 1, Powershell

Please provide the following information for your submission:

What is your name? (First, Last)

BjΓΆrn Sundling

Where is your GitHub Repo ?(Link to your challenge solution)

challenge 1

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Solved in pwsh.

As I have been doing some work in Azure functions before I decided to take the chance to brush up on other skills at the same time, so included is also scripts for deploying the Azure function environment using PowerShell and ARM templates.

As a European I also added a query flag 'realmeasurements' for outputting proper measurements (decilitres and litres) instead of cups and gallons.

If no query input is given it defaults to 10Lbs.

Example 1

https://<website>.azurewebsites.net/api/TurkeyTrigger?weight=12&realmeasurements=true

output:

5.44 Kilos of bird
1.4 DL Salt 
30.0 Litres Water
3.7 DL Brown sugar 
3 Shallots
5 Cloves of garlic
1.6 tablespoons of Whole peppercorns
1.6 tablespoons of Dried juniper berries
1.6 tablespoons of Fresh rosemary
0.7 tablespoons of Thyme
Brine for 29 hours and 0 minutes.  
Roast for 3 hours and 0 minutes.

Example 2

https://<website>.azurewebsites.net/api/TurkeyTrigger?weight=16

output:

16 Lbs of bird
0.8 Cups Salt 
10.6 Gallons Water
2.1 Cups Brown sugar 
4 Shallots
7 Cloves of garlic
2.1 tablespoons of Whole peppercorns
2.1 tablespoons of Dried juniper berries
2.1 tablespoons of Fresh rosemary
1.0 tablespoons of Thyme
Brine for 38 hours and 0 minutes.  
Roast for 4 hours and 0 minutes.

[CHALLENGE SUBMISSION] Week1 (Turkey) - Horgix - Python+SLS

Please provide the following information for your submission:

What is your name? (First, Last)

Alexis Horgix Chotard

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/Horgix/seasons-of-serverless/tree/master/w1-turkey-recipe

What Challenge is this for? (Challenge number between 1 and 7)

1

Demo

Live at https://sls-neur-dev-horgix-turkey-recipe.azurewebsites.net/api/recipe?turkeyWeight=10

curl https://sls-neur-dev-horgix-turkey-recipe.azurewebsites.net/api/recipe?turkeyWeight=10 

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

This submission is done using Python 3.8. It is deployed as an Azure Function using the Serverless Framework. This is a dead simple solution, done in a rush (no tests, CI, etc). The recipe returned is in JSON.

Challenges faced: no documentation on Serverless Framework Azure provider regarding using already-existing Azure resource group. Found it in the code. I also could not find a way to remove the sls-neur-dev- prefix added by Serverless Framework (but didn't take that much time to find a solution to be honest)

Cool stuff: appreciate the mimetype in the azure-functions SDK' HttpResponse! Usually I have to define the Content-Type header manually when working with other FaaS providers.

[CHALLENGE SUBMISSION]

Please provide the following information for your submission:

What is your name? (First, Last)

Lohith GN

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/lohithgn/Seasons-of-Serverless/blob/main/challenge-1/README.md

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

The readme has all the information: https://github.com/lohithgn/Seasons-of-Serverless/blob/main/challenge-1/README.md

[CHALLENGE SUBMISSION]

Please provide the following information for your submission:

What is your name? (First, Last)

Chris Petit

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/ChrisPetit/LovelyLadoos

What Challenge is this for? (Challenge number between 1 and 7)

2

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

First I've uploaded a bunch of Ladoos images, pie images, bitterbal images and Donut images to https://www.customvision.ai/ and a Lovely Ladoos project I've created there using this guide. There is always the option to create and use your own models, but since this is serverless the most easy option is the best I Think.

Then I've Published a ASP.NET core MVC webapp to Azure...I'm sure there was an easier way, but I've challenged myself to solve al challenges using C#.

So basicly the logic for uploading a File or sending an Url to the API of CustomVision is in the FileUploadController.cs I know the name could be improved upon.

Through the index page we get variables, files and url, we check for nuls, create a httpRequestMessage, perform the request using a HttpClient and display the response through a razor page...

I've tried to keep the naming of the methods in the file pretty clear to make it understandable.

To build this WebApp open the Solution *.sln in Visual Studio 2019. Keep in mind you will need to set secrets ass follows:

right click on the LovelyLadoos.WebApp and choose: Manage User Secrets.
use the following JSON:

{
  "Api": {
    "UrlUrl": <Your Prediction API Image URL>,
    "ImageUrl":<Your Prediction API Image File>,
    "PredictionKey": <Your PredictionKey>
  } 
}

All in all this was a nice little project.

The Result of my WebApp is published in Azure WebApps and running serverless there:
https://lovelyladooswebapp20201203194115.azurewebsites.net/

[CHALLENGE SUBMISSION] Week 4 Azure Function in JavaScript

Please provide the following information for your submission:

What is your name? (First, Last)

Christian Lechner

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/lechnerc77/SeasonOfServerlessWeek4

What Challenge is this for? (Challenge number between 1 and 7)

4

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I am not quite sure if I understood what the Excel should have told me :-)
In addition it is quite some time ago that I worked on mathematical optimization problems (a loonnngggg time ago)
So I tried to tackle the optimization problem by a linear optimization approach that made some modelling as well as some assumptions necessary to apply that method. For the details I refer to the the description in my repository.

You can execute the function locally via func start. Some sample calls are available in the file requests.http.

[CHALLENGE SUBMISSION] - Week 1 Solution in TypeScript

Please provide the following information for your submission:

What is your name? (First, Last)

Christian Lechner

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/lechnerc77/SeasonOfServerlessWeek1

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

The function is implemented in TypeScript. It provides a GET endpoint. Based on the input handed over via the request body the recipe is determined and returned to the caller. The units need not be lb, they will be converted in the API.
In addition metadata endpoints are provided for the valid values of the recipe type (currently only "turkey") and the available units.
Internally the main mechanics for determining the recipe are handled via a class factory allow to hook in other recipes afterwards

[CHALLENGE SUBMISSION] Week 3 .NET based Azure Function

Please provide the following information for your submission:

What is your name? (First, Last)

Marc Duiker

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/marcduiker/Seasons-of-Serverless/tree/main/src/challenge-3

What Challenge is this for? (Challenge number between 1 and 7)

3

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I based the calculation on the recipe linked in the challenge. I'm estimating that with the original recipe you can make 4 kebabs of +/- 12cm each, so 48 cm (0.48m) in total.

The function can be tested here: https://seasonsofserverless-fa.azurewebsites.net/api/recipe/kebab/0.45?code=O2wmYhSCd4NaTtMTrMbw3oHUSS/WPxLyoce74n7VmWexvEjI6rxt1w==

The response:

{
    "recipeSource":"https://www.thespruceeats.com/adana-kebab-4164647",
    "nrOfServings":"Number of servings: 4.",
    "length":"Total length of the kebab: 0.48 meter.",
    "lamb":"Lamb meat: 0.45 kg.",
    "onion":"Onions: 1 pieces.",
    "garlic":"Garlic cloves: 4 pieces.",
    "cumin":"Cumin: 1.5 teaspoons.",
    "sumac":"Sumac: 1.5 teaspoons.",
    "salt":"Salt: 0.5 teaspoons.",
    "blackPepper":"Black pepper: 0.25 teaspoons.",
    "pepperFlakes":"Red pepper flakes: 0.25 teaspoons.",
    "water":"Ice cold water: 2 tablespoons."
}

[CHALLENGE SUBMISSION] Week 1 - Java

Please provide the following information for your submission:

What is your name? (First, Last)

Alexandre Mourany

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/amourany/seasons-of-serverless/tree/master/w1-perfect-turkey

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

My solution is done using Java 11 and the function is deployed with GitHub actions.

Demo

Function can be found here : https://perfect-turkey-amou.azurewebsites.net/api/turkey-recipe?weight=5

[CHALLENGE SUBMISSION]

Please provide the following information for your submission:

What is your name? (First, Last)

Chris Petit

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/ChrisPetit/LongestKebab

What Challenge is this for? (Challenge number between 1 and 7)

3

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

This is a .NET Core function App.

Try it yourself

In Powershell:

Invoke-RestMethod https://longestkebab.azurewebsites.net/api/CalculateLongestKebab/?kilosGroundLamb=200

or open the link in your browser...https://longestkebab.azurewebsites.net/api/CalculateLongestKebab/?kilosGroundLamb=200

How to run this

You can run this using either Visual Studio, Visual Studio Code or your C# IDE of choice...

Clone the repo, open the *.sln file and choose build. Then you can run it...(F5 in Visual Studio). If you want, you can also publish it to an Azure Function App, wich I did, check the link above.

I reckoned that you can make 8 thin kebabs of 20 cm each using 1 kilo of ground lamb. That should provide 8 poeple with a portion.

PowerShell Solution Manbearpiet

What is your name? (First, Last)

Christian Piet

Where is your GitHub Repo ?(Link to your challenge solution)
https://github.com/Manbearpiet/seasonofserverless
https://deliciousturkeyrecipeshoppinglist.azurewebsites.net/api/DeliciousTurkeyRecipe?

What Challenge is this for? (Challenge number between 1 and 7)

Challenge 1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Hi, I hope everyone had a nice Thanksgiving πŸ¦ƒ.

My solution in PowerShell is published at:
https://github.com/Manbearpiet/seasonofserverless

I've published it as a function at:
https://deliciousturkeyrecipeshoppinglist.azurewebsites.net/api/DeliciousTurkeyRecipe?

The function uses a HTTP query string with the keyword Weight (in pounds):
https://deliciousturkeyrecipeshoppinglist.azurewebsites.net/api/DeliciousTurkeyRecipe?Weight=5

It also works with PowerShell:

$param = @{
URI = 'https://deliciousturkeyrecipeshoppinglist.azurewebsites.net/api/DeliciousTurkeyRecipe'
Body = (@{Weight=5}| ConvertTo-Json)
Method = 'Post'
ContentType = 'application/json'
}
Invoke-Restmethod @param

I wanted to create something with more flair, as a nice output (better timeduration output), ASCII art and prettier output.
But I got sucked in, in coding the same solution in C# (my first C# lines ever :-)). I couldn't finish that nor make this a bit more shiney. But still i'm happy with my first function ever yeey!

The function parses the parameterstring or query string to an integer and multiplies the parsed integer in a hashtable with the ingredients as a weight factor and outputs a JSON body with the multiplied values.

[CHALLENGE SUBMISSION]

Please provide the following information for your submission:

What is your name? (First, Last)

Daniel Paulus

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/PaulusTM/Seasons-of-Serverless/tree/main/src/challenge-1

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Typescript

[CHALLENGE SUBMISSION] Challenge03 - PowerShell

Please provide the following information for your submission:

What is your name? (First, Last)

Barbara Forbes

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/Ba4bes/SeasonsOfServerless/tree/main/C03-The_Longest_Kebab

What Challenge is this for? (Challenge number between 1 and 7)

3

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

The challenge was mostly finding all information and then making the solution as flexible as possible!
It can calculate from the meat weight, the amount of people that needs to be fed or the total length needed.

And my Ascii art extually expands if the kebab gets longer! :-D

image

More info in the readme

[CHALLENGE SUBMISSION] Challenge 4 PowerShell

Please provide the following information for your submission:

What is your name? (First, Last)

Ewerton JordΓ£o

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/EwertonJordao/bbqbrazil_seasonserverless4

What Challenge is this for? (Challenge number between 1 and 7)

4

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I try to use some resources uncommon in PowerShell, class definitions and methods for create that solution. Use PowerShell always 😎🀘

[CHALLENGE SUBMISSION]

Please provide the following information for your submission:

What is your name? (First, Last)

Robert Steele

Where is your GitHub Repo ?(Link to your challenge solution)

challenge one

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

[CHALLENGE SUBMISSION] Challenge 1 solution

Please provide the following information for your submission:

What is your name? (First, Last)

Marc Duiker

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/marcduiker/Seasons-of-Serverless/tree/challenge-1/src/challenge-1

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I've used C#, added a Recipe class where I do the calculations and formatting. I'm using a specific function route that contains the weight of the turkey. It also checks if the weight is positive. If not, it returns a BadRequest message (HTTP 400).

[CHALLENGE SUBMISSION] Challenge 1 - Node.js

Please provide the following information for your submission:

What is your name? (First, Last)

Mats Andreassen

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/MatsAnd/seasons-of-serverless/tree/main/01

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Great challenge, can't wait to get the next one! πŸ™ŒπŸΌ

Example call: https://ma-func-sos-01.azurewebsites.net/api/turkey/8

[CHALLENGE SUBMISSION] Challenge 1 Solution - Python and Azure SQL serverless

What is your name?

Drew Skwiers-Koballa

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/dzsquared/seasons-of-serverless-week1

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Blog post: https://devblogs.microsoft.com/azure-sql/seasons-of-serverless-challenge-1-azure-functions-and-azure-sql-database-serverless/
A little late, but this solution utilizes an Azure Function written in Python to pull the recipe from an Azure SQL database (serverless tier). I loved 25 days of serverless last year, but it was brutal and am very glad this is week by week. πŸŽ‰
Planning to post solutions on the Azure SQL dev blog each week by the end of the week.

[CHALLENGE SUBMISSION] - Challenge 1 via Power App

Please provide the following information for your submission:

What is your name? (First, Last)

Brandon H

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/brandonh-msft/2020-seasons-of-serverless/tree/main/challenge-1

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Solved via a Power App:

[CHALLENGE SUBMISSION] The Perfect Turkey: python with Azure Functions Core Tools

Please provide the following information for your submission:

What is your name? (First, Last)

Aditya Raman

Where is your GitHub Repo? (Link to your challenge solution)

https://github.com/ramanaditya/Seasons-of-Serverless-2020-Solutions/tree/main/The-Perfect-Turkey

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

  • language used: python3.8
  • location: Bangalore, India

I used Azure Functions Core Tools to create the "Http Trigger" template and then edit the template to modify the logics to get Turkey brine. And also used Azure CLI to deploy the Function App.

[CHALLENGE SUBMISSION] Challenge 1 - Python

Please provide the following information for your submission:

What is your name? (First, Last)

Rebecca Trapani

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/errbufferoverfl/violet-lobster

What Challenge is this for? (Challenge number between 1 and 7)

1

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Python 3.8, Australia.

Demo link: https://turkey-maker.azurewebsites.net/api/turkey-maker?weight=12

Has basic error handling in that it prints "Pass the weight of your turkey in pounds in the query string or in the request body for your brine equation." if you specify a parameter that is not weight or if you specify a weight that is not a number.

Main Challenges Faced:

  • Not knowing if it's okay to just round up ingredient weights because I've never cooked a turkey before. Please, no one make a turkey from this.
  • Using Azure Functions with PyCharm, I ended up downloading VSCode to follow the quickstart guide

[CHALLENGE SUBMISSION] Challenge 02 - PowerShell

Please provide the following information for your submission:

What is your name? (First, Last)

Barbara Forbes

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/Ba4bes/SeasonsOfServerless/tree/main/C02-Lovely_Ladoos

What Challenge is this for? (Challenge number between 1 and 7)

Challenge 2

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I made the ascii art myself this time. It probably shows πŸ˜….

The complete story of how it happened an how the function can be called is in the readme πŸ˜€

[CHALLENGE SUBMISSION] - Challenge Two

Please provide the following information for your submission:

What is your name? (First, Last)

Stuart Leaver

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/stuartleaver/seasons-of-serverless/tree/main/02-lovely-ladoos

What Challenge is this for? (Challenge number between 1 and 7)

2

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

C#, an Azure Function, Custom Vision, Vue.js and a Static Web App. Types of images used were ladoos, doughnuts and strawberries.

Try it out at - https://www.lovelyladoos.cloud

[CHALLENGE SUBMISSION] Week 04 - Python!

Please provide the following information for your submission:

What is your name? (First, Last)

Rebecca Trapani

Where is your GitHub Repo ?(Link to your challenge solution)

Detailed instructions: https://github.com/errbufferoverfl/violet-lobster
Python Solution: https://github.com/errbufferoverfl/violet-lobster/tree/main/week-04
Azure Function Endpoint: https://big-bbq.azurewebsites.net/api/calcbudget?budget=99999

What Challenge is this for? (Challenge number between 1 and 7)

4

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

I originally tried to use linear programming to try and find the optimal amount of each food but I didn't have enough constraints so the program was just really keen about buying halloumi.

In the end I ended up defining an estimated amount people would eat, in this case 700g and then a percentage of what people would eat, for example 25% fillet, 5% potato, 5% mushroom etc. based on this I could determine how much each person would want to eat and the cost per person. From there I could then divide my budget by that cost per person and work out how much I would spend!

I spent a fair bit of time working on the linear programming so when that didn't work I ended up just focusing on providing the answer we originally wanted i.e how many people can we serve based on our budget but also added in the cost per person, and amount of change left.

It also provides you with a helpful shopping list so you buy the πŸŽ‡ perfect πŸŽ‡ amount! I might use this to work out what I need to buy for Christmas day πŸ€”

[CHALLENGE SUBMISSION] - Challenge Four (C# and Angular)

Please provide the following information for your submission:

What is your name? (First, Last)

Stuart Leaver

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/stuartleaver/seasons-of-serverless/tree/main/04-a-big-barbecue

What Challenge is this for? (Challenge number between 1 and 7)

4

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

C# (Azure Function) and Angular.

The solution contains an Angular frontend to allow users to input the details of their barbecue, and an Azure Function as the backend to calculate the costs and how the spend compares to the budget.

The BBQ organiser can input the following details:

  • Their name
  • Number of guests
  • Budget
  • The items for their barbeque, cost per kg/pcs and the quantity

Some example prices have been pre-filled.

Using the spreadsheet as a guide and a bit of artistic license, the Azure Function will then calculate the following:

  • Total cost of the items
  • Cost per guest
  • Over or under budget

These details are then displayed back to the user, along with the list of items they need.

If the cost of a barbecue item is Β£0 or above and the quality is greater than 0, then the item will be included in the costs.

[CHALLENGE SUBMISSION]

Please provide the following information for your submission:

What is your name? (First, Last)

Daniel Paulus

Where is your GitHub Repo ?(Link to your challenge solution)

https://github.com/PaulusTM/Seasons-of-Serverless/tree/main/src/challenge-2

What Challenge is this for? (Challenge number between 1 and 7)

2

(Optional) Anything else we should know? e.g., language used, location, blog post, tell us how you solved this solution, including any challenges you faced solving it.

Build in Typescript. You need to send the url of an image to check with your request. See the examples in the test.http file for more details.

The AI is trained to recognize Ladoo, Dutch Bitterballen, chewing gum, tennis balls.

Application is deployed to an Azure Function App at: https://ladoo-paulustm.azurewebsites.net/api/ladoovalidator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.