This hands-on lab provides an Azure administrator with an understanding of how to implement Function Apps to leverage Azure’s serverless capability. These cloud-based resources allow you to “lift and shift” your on-premise application functions to Azure and reduce your operating system and infrastructure overhead. The Function Apps require a Trigger, which will include a form of input, then the Function App will process your data and provide an output. For this lesson, you will create a Function App that creates a queue message when a file is uploaded to your web app.
Understand the scenario
You are a system administrator for a company that is migrating its document processing system from its data center to Microsoft Azure. You need to create a Function App that will start document processing when a file is uploaded to Azure. You will first create a Function App, then create a function that is triggered by Blob (file) storage within the function app. Next, you will define a Storage Queue message as an output of the function. Finally, you will test the Function App by uploading a document. You will use an Azure Resource Group that contains a preconfigured Web App and Storage Account.
Create a Function App:
For this task, you will use the Microsoft Azure Portal to provision a Function App. Once the Function App is provisioned, you will configure a custom function with a Blob Trigger. This means that when a blob is received, it will trigger the Function App (C# code, later defined). There are several triggers and input possibilities. For this lesson, you will explore your options, working with blobs.
Add a Storage Queue output:
The added value of any Function App is its ability to produce an output. For this section, you will integrate your Function App with a Storage Account and create a new Azure Queue Storage output. Then you will learn how to edit your function within the Azure editor and verify that your code compiles correctly by reviewing the Logs.
Test the Function App:
To test the Function App, you will manually upload files to your blobs container. This emulates the behavior expected for your Function App to process the blob and send the output (file name, in this case) to the message queue.
Lab Summary Conclusion:
In this hands-on virtual lab, you will learn how to use Microsoft Azure’s Function App capability. This capability is powerful, as it allows you to use your pre-existing code, and run it in Azure within a container, without having to worry about managing the server infrastructure required for this function in an on-premise solution. You will learn about the components required for a Function App: a Trigger, input, the function code, and the output. These skills are essential for a Developer or Administrator in an Azure Cloud or hybrid environment.
Other Challenges in this series
- GUIDED CHALLENGE: Provision a Logic App
- ADVANCED CHALLENGE: Can you Manage a Serverless Compute Environment?