Challenge 02 - Create a Hello World Function

< Previous Challenge - Home - Next Challenge >

Introduction

Azure Functions are an integral part of a Serverless architecture. Azure Functions allows you to run small pieces of code (called “functions”) without worrying about application infrastructure. With Azure Functions, the cloud infrastructure provides all the up-to-date servers you need to keep your application running at scale.

The goals of this challenge are to get you familiar with the both the developer tools experience for creating a function, and the Azure Portal experience managing how that function is deployed in Azure.

Description

You can develop, test, and debug an Azure Function using developer tools that simulate the Azure hosting environment on your workstation (or GitHub Codespace). Once a function’s code has been developed and tested locally, it can be published to Azure in a compute resource called a “Function App”. A “Function App” in Azure is a hosting environment where your function code will be published to and made available to be invoked by other processes.

NOTE: The TollBooth application that you will work with for the rest of this hack uses C#. You may find it useful to understand how a basic “Hello World” Azure Function works in C# before you explore the TollBooth application’s code. Optionally, you can also try a “Hello World” in JavaScript, which will be useful in Challenge 06.

NOTE: It is easier to create & manage Azure Functions if you have VS Code “Open Folder” to the folder where you want to the code to live. This is because when using VS Code, the Azure Functions extension for VS Code can only work with one language stack at a time. If you have Azure Functions authored in multiple languages and/or folders, you will need to open a separate VS Code window to the individual folder to work with each language.

NOTE: An empty folder “HelloWorld” is provided with the Resources package (and GitHub Codespace), you can use it to create your new Functions project workspace, or create a new empty folder.

When using VS Code in GitHub Codespaces, you can navigate to other folders and open them by:

Success Criteria

Learning Resources