Have you heard about the Seasons of Serverless challenge? Join the  festive virtual potluck by creating solutions to challenges leveraging Azure serverless computing. Throughout the next seven weeks we’ll be sharing a solution to the week’s challenge that integrates  Azure SQL Database serverless with Azure serverless compute.

Challenge 1: The Perfect Holiday Turkey  🦃

The first week features the North America tradition of cooking a turkey. The challenge calls for converting a brine recipe based on the input weight of a turkey and recommends leveraging an Azure Function to generate the recipe. Below is a high level view of the solution we created, utilizing an Azure Function and Azure SQL Database serverless. The completed example can be found on  GitHub.

Creating an Azure Function in VS Code

Using the VS Code Azure Functions extension and the “Azure Functions: Create New Project” command, we’re creating a new Azure Function locally in VS Code in Python with the HTTP trigger template. This function will receive HTTP GET requests with a turkey size in pounds (lbs) through a query string parameter. The body of the function is defined in the main(req: func.HttpRequest) function in the file init.py. Dependencies for our function that need to be installed to run the function are detailed in the file requirements.txt, where we want to begin by adding a line for pyodbc.  pyodbc is an open-source module for Python that enables connecting to ODBC databases, including Azure SQL and Microsoft SQL Server.

#azure sql #python #serverless

Seasons of Serverless Challenge 1: Azure Functions and Azure SQL Database serverless
1.40 GEEK