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

Deploy and Run Your First Azure Function

Azure Functions is at the core of Azure’s serverless services and is great at building simple APIs, microservices, backend asynchronous jobs, and contributing to integration workflows. In this lab, we will be walking through a simple, but non-trivial example of an Azure function that solves a common healthcare data integration scenario. In order to make this lab accessible to the broadest audience, all of the work will be done through the Azure portal, and code will be supplied by copy-paste. Previous coding experience in any language and familiarity with HTML are both helpful but not required.

Azure icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 30m
Published
Clock icon Dec 18, 2020

Contact sales

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

Table of Contents

  1. Challenge

    Provision an Azure Function App Using the Azure Portal

    If you have any trouble accessing the Azure portal, review the housekeeping video.

    Using the Azure portal, create an Azure Function App that will host .NET (technically, C# script) functions on Windows infrastructure. When prompted for a .NET version, use version 6 (LTS) In-process (This is the only version that will support the C# script we will use to develop a function in the portal).The Function App should be provisioned under the Consumption (Serverless) plan, with a backing storage account. All other defaults can be left as-is.

    Notes:

    • In the setup wizard for the Azure Function App, the option to enable Application Insights may be disabled in your lab environment. As a result, when working with the function code, you may not see the same output in the logging window as what you see in the lab videos. This will not impact your ability to complete the lab.
    • There have been some relatively minor UI changes since this lab was first published. A full refresh of the lab is actively underway. In the meantime, consult the lab guide if you get stuck at any point where the UI does not precisely match the video.
  2. Challenge

    Deploy a C# .NET Core Function in the App Based on the HTTP Trigger Template

    1. Within the Function App created in the previous objective, create an Azure Function using the HTTP trigger template. Name the function anything you want or keep the default name.
    2. The function code does not need to be modified, but update the parameter passed to return a simple greeting using the student’s name.
    3. The app tests successfully by returning a simple greeting when run.

    Note: In the setup wizard for the Azure Function App, the option to enable Application Insights may be disabled in your lab environment. As a result, when working with the function code, you may not see the same output in the logging window as what you see in the lab videos. This will not impact your ability to complete the lab.

  3. Challenge

    Extend the Project by Adding a NuGet Package Configuration

    1. Navigate to the GitHub project referenced in the Additional Resources section of the lab.
    2. Follow the instructions in the Readme.text file to use the Console feature in the Function App UI to create an empty function.proj file.
    3. Navigate back to the function coding window to check the existence of the function.proj file. (Hint: Check the drop-down where the run.csx file is located.)
    4. Back in the GitHub project, follow the instructions in the helper_function.proj file to populate the empty function.proj file with the proper XML NuGet package that references an HTML parser library.
    5. Save your work.
  4. Challenge

    Extend the Function Code to Scrape a Website and Return a URL

    1. Back in the GitHub project, follow the instructions in the helper_run.csx file to modify the sample code in the function you created near the beginning of the lab.
    2. Save your work.
    3. Scan the code to find and copy the URL assigned to var html, and open it in a browser window. This is the website you need to scrape. View the page and the underlying HTML code to identify the filename that should be scraped (returned) by the function, assuming the code is running properly.
    4. You do not need to modify the code.
    5. Run the code and ensure that it returns the correct filename that was intended to be scraped from the web page.

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