Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Azure icon
Labs

Create a Scheduled Function with the Azure Functions CLI

In this lab you'll learn how to use the Azure Functions Command line tools to create a timer triggered function to run on a schedule controlled by a CRON expression. - First, you'll create a new Azure Functions project with the `func init` command. - Then you'll use the `func new` command to add a function. - You can then use the `code` command to take a look at the files. - You'll update the cron expression to run every minute. - You'll, optionally, also update the `local.settings.json` file to point at the cloud shell's storage account connection string. - And you can see how the `func host start` command can run your scheduled function (assuming you configured it with a real storage account connnection string).

Azure icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 15m
Published
Clock icon May 02, 2024

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create a Function App

    Use the Azure Functions Core Tools to create a new function app.

  2. Challenge

    Create a timer triggered function

    Use the Azure Functions Core tools to add a timer-triggered function to your Azure Functions app.

  3. Challenge

    Update the CRON expression

    Update the CRON expression of your timer-triggered function so that it runs every 1 minute instead of the default of every 5 minutes.

  4. Challenge

    Set the storage account connection string

    Use the Azure CLI to fetch the connection string of the cloud shell's storage account, and set it in the local.settings.json file.

    Note: This optional step is needed in order to successfully run your Function App in the cloud shell.

  5. Challenge

    Check the .NET version

    Check that the version of the .NET runtime installed in the cloud shell matches the version in your function app csproj file. Adjust the csproj file to match if it does not.

    Note: This is an optional step to allow your function app to run successfully in the cloud shell.

  6. Challenge

    Launch the Azure Functions runtime

    Use the func host start command from the Azure Functions Core Tools to launch the Azure Functions runtime and see your scheduled function run (assuming you performed the optional steps to add a storage account connection string and checked the .NET version).

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

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.

Start learning by doing today

View Plans