- Lab
- A Cloud Guru
Create an Azure Function to Run on a Timer
In this hands-on lab, we use the Azure Portal to create and run a timer-triggered Azure function.
Path Info
Table of Contents
-
Challenge
Log In to the Azure Portal
Log in to the Azure Portal using the username and password supplied by the lab.
- Open a browser.
- Nevigate to the provided Azure Portal URL.
- Use the supplied username and password to authenticate.
-
Challenge
Go to the Overview of the Provided Function Application Service
Starting in the Azure dashboard, perform the following tasks:
- Open the navigation menu in the upper-left of the Portal.
- Click on All resources.
Wait for all the resources to appear.
In the list, click on the app service that has a name starting with fa-. This will open the overview page of the function app service.
-
Challenge
Create and Run the Timer-Triggered Function
On the function app overview page, click Functions in the function apps navigation tree on the left of the page.
Now click the + New function link that appears a top of the empty list of functions.
In the list of triggers that appears, click Timer trigger.
In the panel that opens, name the function "MyTimerTrigger" without the quotes.
Leave the schedule as 0 */5 * * * *.
Click the Create button.
Wait for the function code to open in the browser.
Open the Logs panel to verify the function has already run.
If you want, wait five minutes to see it run again. Afterwards, continue to the next task.
-
Challenge
Change the Trigger Execution to Every Five Seconds
Click View files on the right side of the browser window.
In the panel that opens, click the
function.json
file.When the JSON for that file opens in the editor, change the following line:
"schedule": "0 */5 * * * *",
To:
"schedule": "0/5 * * * * *",
Press the Save button above the code, and then the Run button.
Go back to the Logs panel. After a few moments, the function should run every five seconds.
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.