- Lab
- A Cloud Guru
Work with the Azure Functions CLI
In this lab you'll learn how to use the Azure Functions Command line tools, by calling them from within a cloud shell in the Azure portal. - First, you'll create a new Azure Functions project with the `func init` command. - Then you'' use the `func new` command to add a function - You can then use the `code` command to take a look at the files - And you can see how the `func host start` command can be used to build and run a function app, although it won't be functional if you're using the cloud shell, as this command is intended for local development scenarios and requires the Azurite storage emulator
Path Info
Table of Contents
-
Challenge
Create a new functions app
- Create an empty folder e.g. called azurefuncs
- Navigate into that folder
- Run the
func init
command in that folder - Create a dotnet isolated function app (or choose another runtime if you prefer)
-
Challenge
Add a function to your function app
- In the same folder, run the
func new
command in the Azure cloud shell - Select to create a HTTP triggered function
- You can chose whatever name you prefer
- In the same folder, run the
-
Challenge
Explore the generated code
- Use the
code
command in the Azure Cloud Shell to explore the code generated by the previous two commands
- Use the
-
Challenge
Start the function app runtime
- In the Azure Cloud shell, run the
func host start
command to build the code and start the functions host - Note: because this tooling is intended for local development it will fail to run the function app. If you prefer, you can install the Azure Functions Core tools and Azurite emulator locally on your own machine to see this step fully running
- In the Azure Cloud shell, run the
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.