Deploy and Run Your First Azure Function

30 minutes
  • 4 Learning Objectives

About this Hands-on Lab

Azure Functions are at the core of Azure’s serverless services and are great at building simple APIs, micro-services, back-end 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.

**Resources:** https://github.com/linuxacademy/content-Intro-to-serverless-on-Azure

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Provision an Azure Function App Using the Azure Portal

The app should be provisioned under the Consumption plan, with a backing storage account.

Deploy a C# .NET Core Function in the App Based on the HTTP Trigger Template
  • The function code should be modified to return a simple greeting using the student’s name.
  • The app tests successfully by returning a simple greeting when run.
Extend the Project by Adding a NuGet Package Configuration
  • A function.proj file should be created in the function project.
  • The function.proj file includes the proper NuGet package reference to an HTML parser library.
Extend the Function Code to Scrape a Website and Return a URL
  • The code should be modified to find a specific link on the supplied NPPES web page.
  • The function tests successfully by returning the URL.

Additional Resources

GitHub repository with readme file and code snippets: https://github.com/linuxacademy/content-Intro-to-serverless-on-Azure

Imagine you need to regularly download and process a public data set of physicians, but the naming convention of the file is not strictly enforced, requiring frequent human intervention to retrieve the most recent file from a link on a website. Further, the posting date of the monthly file is inconsistent, so you need to be able to check for the most current file name so that downstream processes can determine when a refresh is appropriate. The rest of your workflow is already automated; you just need to add a custom application to sort out the file name to fully automate the integration pipeline.

This is one kind of challenge that Azure Functions were designed to address. You will first learn how to provision a Function App, then create and test a canned C# .NET function in that app using an HTTP trigger template. After testing the canned function, we will modify its configuration and C# code to scrape a government website. Our goal will be to retrieve the URL of the latest monthly file containing U.S. physicians and their national identifiers. The URL string will be returned for further processing by a data pipeline.

What are Hands-on Labs

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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?