SlideShare a Scribd company logo
Microsoft.com/Learn
Join the chat at https://aka.ms/LearnLiveTV
Title
Speaker Name
Create serverless logic with Azure
Functions
Speaker Name
Title
Prerequisites  A Microsoft account
Learning
objectives
 Decide if serverless computing is right for your project
 Create an Azure Function app in the Azure portal
 Execute a function using triggers
 Monitor and test your Azure Function from the Azure portal
Agenda  Introduction
 Decide if serverless computing is right for your business
needs
 Exercise - Create a function app in the Azure portal
 Run your code on-demand with Azure Functions
 Exercise - Add logic to the function app
 Summary & knowledge check
Introduction
Introduction
Imagine you’re working on an IoT project where you want to figure
out how many people sit at each table in your school's cafeteria.
Decide if serverless computing is
right for your project
What is serverless compute?
Serverless compute can be thought of as a function as a service
(FaaS), or a microservice that is hosted on a cloud platform.
What is Azure Functions?
Azure Functions is a serverless application platform.
Benefits of a serverless compute solution
Serverless compute is a great option for hosting business logic code
in the cloud.
Avoids over-allocation of infrastructure
Suppose you've provisioned virtual machine (VM) servers and
configured them with enough resources to handle your peak load
times.
Stateless logic
Stateless functions are great candidates for serverless compute;
function instances are created and destroyed on demand.
Event driven
Functions are event driven.
Functions can be used in traditional compute
environments
Functions are a key component of serverless computing, but they are
also a general compute platform for executing any type of code.
Drawbacks of a serverless compute solution
Serverless compute will not always be the appropriate solution to
hosting your business logic.
Execution time
By default, functions have a timeout of five (5) minutes.
Execution frequency
The second characteristic is execution frequency.
Exercise
Create a function app in the Azure portal
Create a function app in the Azure portal
You are now ready to start implementing the temperature service.
• What is a function app?
• Choose a service plan
• Storage account requirements
• Create a function app
• Verify your Azure function app
Run your code on-demand with
Azure Functions
Run your code on-demand with Azure Functions
Now that we have created a function app, let's look at how to build,
configure, and execute a function.
Service Trigger description
Blob Storage Starts a function when a new or updated blob is detected.
Azure Cosmos DB Start a function when inserts and updates are detected.
Event Grid Starts a function when an event is received from Event
Grid.
HTTP Starts a function with an HTTP request.
Microsoft Graph Events Starts a function in response to an incoming webhook
from the Microsoft Graph. Each instance of this trigger
can react to one Microsoft Graph resource type.
Queue Storage Starts a function when a new item is received on a queue.
The queue message is provided as input to the function.
Service Bus Starts a function in response to messages from a Service
Bus queue.
Timer Starts a function on a schedule.
{
"bindings": [
{
"name": "order",
"type": "queueTrigger",
"direction": "in",
"queueName": "myqueue-items",
"connection": "MY_STORAGE_ACCT_APP_SETTING"
},
{
"name": "$return",
"type": "table",
"direction": "out",
"tableName": "outTable",
"connection": "MY_TABLE_STORAGE_ACCT_APP_SETTING"
}
]
}
JSON
Create a function in the Azure portal
Azure provides several predefined function templates for common
scenarios:
• Quickstart
• Custom functions
Add function templates
When adding your first function, you are presented with the Add
function pane in which you can select the trigger for your function.
Custom function templates
Selecting a template from the Add function pane provides easy
access to the most common templates.
Navigate to your function and files
When you create a function from a template, several files are created.
Test your Azure function
After you've created a function, you'll want to test it.
• Running it manually
• Testing it from within the Azure portal itself
Run function manually
You can start a function by manually triggering the configured trigger.
Test in the Azure portal
The portal also provides a convenient way to test your functions.
Monitoring and Application Insights dashboard
The ability to monitor your functions is critical during development
and in production.
Streaming logs pane
After you've enabled Application Insights in the Azure portal, you're
also able to add logging statements to your function for debugging.
context.log('Enter your logging statement
here');
JavaScript
log.LogInformation("Enter your logging
statement here");
C#
Errors and warnings in the logs pane
You can locate the errors and warnings tab in the same menu as the
log tab.
Exercise
Add logic to the function app
Add logic to the function app
Let's continue with our gear drive example, and add the logic for the
temperature service.
• Function requirements
• Add a function to our function app
• Test the function
• Secure HTTP triggers
• Add business logic to the function
• Test our business logic
Summary
Summary
You've learned how to use Azure Functions to host business logic
services in the cloud.
Knowledge check
Question 1
Which of the following best defines serverless logic?
A. Code you write that doesn't run on servers.
B. Code you write that runs on servers you manage.
C. Code you write that runs on servers a cloud provider manages.
Question 1
Which of the following best defines serverless logic?
A. Code you write that doesn't run on servers.
B. Code you write that runs on servers you manage.
C. Code you write that runs on servers a cloud provider manages.
Question 2
The container that groups functions into a logical unit for easier
management, deployment, and sharing of resources is called?
A. Resource group
B. Function app
C. Function collection
Question 2
The container that groups functions into a logical unit for easier
management, deployment, and sharing of resources is called?
A. Resource group
B. Function app
C. Function collection
Question 3
We secured our function against unknown HTTP callers by requiring a
function-specific API key be passed with each call. Which of the
following fields is the name header in the HTTP requests that needs to
contain this key?
A. x-functions-key
B. x-requested-with
C. x-csrf-token
Question 3
We secured our function against unknown HTTP callers by requiring a
function-specific API key be passed with each call. Which of the
following fields is the name header in the HTTP requests that needs to
contain this key?
A. x-functions-key
B. x-requested-with
C. x-csrf-token
Next Steps
Practice your knowledge by trying
these Learn modules:
Execute an Azure Function with
triggers
Chain Azure Functions together using
input and output bindings
Develop, test, and publish Azure
Functions by using Azure Functions
Core Tools
Please tell us how you liked this
workshop by filling out this
survey:
https://aka.ms/workshopomatic-
feedback
© Copyright Microsoft Corporation. All rights reserved.
Thank you!

More Related Content

PDF
Serverless API with Azure Functions
PPTX
ServerLess by usama Azure fuctions.pptx
PDF
Getting Started with Serverless Architectures using Azure Functions
PPTX
Introduction to Azure Functions
PPTX
Azure Functions.pptx
PPTX
Save Azure Cost
PPTX
Azure Functions - Introduction
PPTX
Building Azure Logic Apps
Serverless API with Azure Functions
ServerLess by usama Azure fuctions.pptx
Getting Started with Serverless Architectures using Azure Functions
Introduction to Azure Functions
Azure Functions.pptx
Save Azure Cost
Azure Functions - Introduction
Building Azure Logic Apps

Similar to slides.pptx (20)

PPTX
Using logic apps for dynamics 365 integration
PPTX
Azure functions: Build apps faster with serverless architecture (March 2018)
PPTX
Presentation Azure Chat Bot Project.pptx
PDF
IT PRO | Connections 2020 : Introduction to Logic Apps and automation solutio...
PPTX
Serverless Application Development with Azure
PPTX
Introduction to Azure logic apps
PDF
Using Azure Machine Learning Models
PPTX
Play with azure functions
PDF
From PowerShell Function to Serverless code with Azure Functions
PPTX
Serverless Solutions for developers
PPTX
Guidelines to understand durable functions with .net core, c# and stateful se...
PPTX
565847651-Az-400t00a-Enu-Powerpoint-05.pptx
PDF
Serverless Computing with Azure
PPTX
Tech UG - Newcastle 09-17 - logic apps
PDF
AZ-400 Exam Dumps Online – Proven by Learners Worldwide
PPTX
Azure Functions in Action #CodePaLOUsa
PPTX
Getting started with development in azure
PPTX
Logic apps and PowerApps - Integrate across your APIs
PPTX
Beer City Code 2024 - Configurable Cloud Native Applications with .NET Aspire
PDF
Download full ebook of Azure Functions With C Marto Torres instant download pdf
Using logic apps for dynamics 365 integration
Azure functions: Build apps faster with serverless architecture (March 2018)
Presentation Azure Chat Bot Project.pptx
IT PRO | Connections 2020 : Introduction to Logic Apps and automation solutio...
Serverless Application Development with Azure
Introduction to Azure logic apps
Using Azure Machine Learning Models
Play with azure functions
From PowerShell Function to Serverless code with Azure Functions
Serverless Solutions for developers
Guidelines to understand durable functions with .net core, c# and stateful se...
565847651-Az-400t00a-Enu-Powerpoint-05.pptx
Serverless Computing with Azure
Tech UG - Newcastle 09-17 - logic apps
AZ-400 Exam Dumps Online – Proven by Learners Worldwide
Azure Functions in Action #CodePaLOUsa
Getting started with development in azure
Logic apps and PowerApps - Integrate across your APIs
Beer City Code 2024 - Configurable Cloud Native Applications with .NET Aspire
Download full ebook of Azure Functions With C Marto Torres instant download pdf
Ad

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
KodekX | Application Modernization Development
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Spectroscopy.pptx food analysis technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Electronic commerce courselecture one. Pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
Review of recent advances in non-invasive hemoglobin estimation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KodekX | Application Modernization Development
The AUB Centre for AI in Media Proposal.docx
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Diabetes mellitus diagnosis method based random forest with bat algorithm
20250228 LYD VKU AI Blended-Learning.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation_ Review paper, used for researhc scholars
Spectroscopy.pptx food analysis technology
Dropbox Q2 2025 Financial Results & Investor Presentation
sap open course for s4hana steps from ECC to s4
Electronic commerce courselecture one. Pdf
Big Data Technologies - Introduction.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Unlocking AI with Model Context Protocol (MCP)
Ad

slides.pptx

  • 2. Join the chat at https://aka.ms/LearnLiveTV Title Speaker Name Create serverless logic with Azure Functions Speaker Name Title
  • 3. Prerequisites  A Microsoft account
  • 4. Learning objectives  Decide if serverless computing is right for your project  Create an Azure Function app in the Azure portal  Execute a function using triggers  Monitor and test your Azure Function from the Azure portal
  • 5. Agenda  Introduction  Decide if serverless computing is right for your business needs  Exercise - Create a function app in the Azure portal  Run your code on-demand with Azure Functions  Exercise - Add logic to the function app  Summary & knowledge check
  • 7. Introduction Imagine you’re working on an IoT project where you want to figure out how many people sit at each table in your school's cafeteria.
  • 8. Decide if serverless computing is right for your project
  • 9. What is serverless compute? Serverless compute can be thought of as a function as a service (FaaS), or a microservice that is hosted on a cloud platform.
  • 10. What is Azure Functions? Azure Functions is a serverless application platform.
  • 11. Benefits of a serverless compute solution Serverless compute is a great option for hosting business logic code in the cloud.
  • 12. Avoids over-allocation of infrastructure Suppose you've provisioned virtual machine (VM) servers and configured them with enough resources to handle your peak load times.
  • 13. Stateless logic Stateless functions are great candidates for serverless compute; function instances are created and destroyed on demand.
  • 14. Event driven Functions are event driven.
  • 15. Functions can be used in traditional compute environments Functions are a key component of serverless computing, but they are also a general compute platform for executing any type of code.
  • 16. Drawbacks of a serverless compute solution Serverless compute will not always be the appropriate solution to hosting your business logic.
  • 17. Execution time By default, functions have a timeout of five (5) minutes.
  • 18. Execution frequency The second characteristic is execution frequency.
  • 19. Exercise Create a function app in the Azure portal
  • 20. Create a function app in the Azure portal You are now ready to start implementing the temperature service. • What is a function app? • Choose a service plan • Storage account requirements • Create a function app • Verify your Azure function app
  • 21. Run your code on-demand with Azure Functions
  • 22. Run your code on-demand with Azure Functions Now that we have created a function app, let's look at how to build, configure, and execute a function. Service Trigger description Blob Storage Starts a function when a new or updated blob is detected. Azure Cosmos DB Start a function when inserts and updates are detected. Event Grid Starts a function when an event is received from Event Grid. HTTP Starts a function with an HTTP request. Microsoft Graph Events Starts a function in response to an incoming webhook from the Microsoft Graph. Each instance of this trigger can react to one Microsoft Graph resource type. Queue Storage Starts a function when a new item is received on a queue. The queue message is provided as input to the function. Service Bus Starts a function in response to messages from a Service Bus queue. Timer Starts a function on a schedule. { "bindings": [ { "name": "order", "type": "queueTrigger", "direction": "in", "queueName": "myqueue-items", "connection": "MY_STORAGE_ACCT_APP_SETTING" }, { "name": "$return", "type": "table", "direction": "out", "tableName": "outTable", "connection": "MY_TABLE_STORAGE_ACCT_APP_SETTING" } ] } JSON
  • 23. Create a function in the Azure portal Azure provides several predefined function templates for common scenarios: • Quickstart • Custom functions
  • 24. Add function templates When adding your first function, you are presented with the Add function pane in which you can select the trigger for your function.
  • 25. Custom function templates Selecting a template from the Add function pane provides easy access to the most common templates.
  • 26. Navigate to your function and files When you create a function from a template, several files are created.
  • 27. Test your Azure function After you've created a function, you'll want to test it. • Running it manually • Testing it from within the Azure portal itself
  • 28. Run function manually You can start a function by manually triggering the configured trigger.
  • 29. Test in the Azure portal The portal also provides a convenient way to test your functions.
  • 30. Monitoring and Application Insights dashboard The ability to monitor your functions is critical during development and in production.
  • 31. Streaming logs pane After you've enabled Application Insights in the Azure portal, you're also able to add logging statements to your function for debugging. context.log('Enter your logging statement here'); JavaScript log.LogInformation("Enter your logging statement here"); C#
  • 32. Errors and warnings in the logs pane You can locate the errors and warnings tab in the same menu as the log tab.
  • 33. Exercise Add logic to the function app
  • 34. Add logic to the function app Let's continue with our gear drive example, and add the logic for the temperature service. • Function requirements • Add a function to our function app • Test the function • Secure HTTP triggers • Add business logic to the function • Test our business logic
  • 36. Summary You've learned how to use Azure Functions to host business logic services in the cloud.
  • 38. Question 1 Which of the following best defines serverless logic? A. Code you write that doesn't run on servers. B. Code you write that runs on servers you manage. C. Code you write that runs on servers a cloud provider manages.
  • 39. Question 1 Which of the following best defines serverless logic? A. Code you write that doesn't run on servers. B. Code you write that runs on servers you manage. C. Code you write that runs on servers a cloud provider manages.
  • 40. Question 2 The container that groups functions into a logical unit for easier management, deployment, and sharing of resources is called? A. Resource group B. Function app C. Function collection
  • 41. Question 2 The container that groups functions into a logical unit for easier management, deployment, and sharing of resources is called? A. Resource group B. Function app C. Function collection
  • 42. Question 3 We secured our function against unknown HTTP callers by requiring a function-specific API key be passed with each call. Which of the following fields is the name header in the HTTP requests that needs to contain this key? A. x-functions-key B. x-requested-with C. x-csrf-token
  • 43. Question 3 We secured our function against unknown HTTP callers by requiring a function-specific API key be passed with each call. Which of the following fields is the name header in the HTTP requests that needs to contain this key? A. x-functions-key B. x-requested-with C. x-csrf-token
  • 44. Next Steps Practice your knowledge by trying these Learn modules: Execute an Azure Function with triggers Chain Azure Functions together using input and output bindings Develop, test, and publish Azure Functions by using Azure Functions Core Tools Please tell us how you liked this workshop by filling out this survey: https://aka.ms/workshopomatic- feedback
  • 45. © Copyright Microsoft Corporation. All rights reserved. Thank you!

Editor's Notes

  • #3: Link to published module on Learn: https://docs.microsoft.com/en-us/learn/modules/learn-pr/azure/create-serverless-logic-with-azure-functions/
  • #4: You’ll need a Microsoft account to activate the Azure sandbox environments inside of Microsoft Learn
  • #8: You want to use infrared sensors at each table that provide you with data from all of the locations, and you want to develop a reusable service that can process the data from all of the different sources. With *serverless computing*, you can use a cloud provider, like Azure, to manage the infrastructure of your project. Azure Functions is a key component of the serverless computing offering from Azure that enables you to run pieces of code, or *functions*, written in the programming language of your choice, in the cloud.
  • #10: Serverless compute can be thought of as a function as a service (FaaS), or a microservice that is hosted on a cloud platform. Your business logic runs as functions and you don't have to manually create or scale infrastructure. The cloud provider manages infrastructure. Your app is automatically scaled out or down depending on load. Azure has several ways to build this sort of architecture. The two most common approaches are Azure Logic Apps and Azure Functions, which we'll focus on in this module.
  • #11: Azure Functions is a serverless application platform. It enables developers to host business logic that can be executed without provisioning infrastructure. Functions provides intrinsic scalability and you are charged only for the resources used. You can write your function code in the language of your choice, including C#, F#, JavaScript, Python, and PowerShell Core. Support for package managers like NuGet and NPM is also included, so you can use popular libraries in your business logic.
  • #12: Serverless compute is a great option for hosting business logic code in the cloud. With serverless offerings such as Azure Functions, you can write your business logic in the language of your choice. You get automatic scaling, you have no servers to manage, and you are charged based on what is used - not on reserved time. Let’s walk through some of the advantages, and the drawbacks.
  • #13: Suppose you've provisioned virtual machine (VM) servers and configured them with enough resources to handle your peak load times. When the load is light, you are potentially paying for infrastructure you're not using. Serverless computing helps solve the allocation problem by scaling up or down automatically, and you're only billed when your function is processing work.
  • #14: Stateless functions are great candidates for serverless compute; function instances are created and destroyed on demand. If state is required, it can be stored in an associated storage service.
  • #15: Functions are event driven. This means they run only in response to an event (called a "trigger"), such as receiving an HTTP request, or a message being added to a queue. You configure a trigger as part of the function definition. This approach simplifies your code by allowing you to declare where the data comes from (trigger/input binding) and where it goes (output binding). You don't need to write code to watch queues, blobs, hubs, and so on. You can focus purely on the business logic.
  • #16: Functions are a key component of serverless computing, but they are also a general compute platform for executing any type of code. Should the needs of your app change, you can take your project and deploy it in a non-serverless environment, which gives you the flexibility to manage scaling, run on virtual networks, and even completely isolate your functions.
  • #17: Serverless compute will not always be the appropriate solution to hosting your business logic. Here are a few characteristics of functions that may affect your decision to host your services in serverless compute.
  • #18: By default, functions have a timeout of five (5) minutes. This timeout is configurable to a maximum of 10 minutes. If your function requires more than 10 minutes to execute, you can host it on a VM. Additionally, if your service is initiated through an HTTP request and you expect that value as an HTTP response, the timeout is further restricted to 2.5 minutes. Finally, there's also an option called Durable Functions that enables you to orchestrate the executions of multiple functions without any timeout.
  • #19: The second characteristic is execution frequency. If you expect your function to be executed continuously by multiple clients, it would be prudent to estimate the usage and calculate the cost of using functions accordingly. It might be cheaper to host your service on a VM. While scaling, only one function app instance can be created every 10 seconds, for up to 200 total instances. Keep in mind, each instance can service multiple concurrent executions, so there is no set limit about how much traffic a single instance can handle. Different types of triggers have different scaling requirements, so research your choice of trigger and investigate its limits.
  • #20: Link to published module on Learn: https://docs.microsoft.com/en-us/learn/modules/learn-pr/azure/create-serverless-logic-with-azure-functions/3-create-an-azure-functions-app-in-the-azure-portal
  • #21: https://docs.microsoft.com/en-us/learn/modules/learn-pr/azure/create-serverless-logic-with-azure-functions/3-create-an-azure-functions-app-in-the-azure-portal For the purposes of this workshop, we will work with an example that checks for safe temperature levels.
  • #23: Now that we have created a function app, let's look at how to build, configure, and execute a function. Functions are event driven, which means they run in response to an event. The type of event that starts a function is called a trigger. Each function must be configured with exactly one trigger. Azure supports triggers for the following services. [Table was here] A binding is a declarative way to connect data and services to your function. Bindings know how to interact with different services, which means you don't have to write code in your function to connect to data sources and manage connections. The platform takes care of that complexity for you as part of the binding code. Each binding has a direction - your code reads data from input bindings, and writes data to output bindings. Each function can have zero or more bindings to manage the input and output data processed by the function. A trigger is a special type of input binding that has the additional capability of initiating execution. Azure provides a large number of bindings to connect to different storage and messaging services. Let's look at an example of configuring a function with an input binding (trigger) and an output binding. Let's say we want to write a new row to Azure Table storage whenever a new message appears in Azure Queue Storage. This scenario can be implemented using an Azure Queue Storage trigger and an Azure Table storage output binding. The following snippet is the function.json file for this scenario. { "bindings": [ { "name": "order", "type": "queueTrigger", "direction": "in", "queueName": "myqueue-items", "connection": "MY_STORAGE_ACCT_APP_SETTING" }, { "name": "$return", "type": "table", "direction": "out", "tableName": "outTable", "connection": "MY_TABLE_STORAGE_ACCT_APP_SETTING" } ] } Our JSON configuration specifies that our function will be triggered when a message is added to a queue named myqueue-items. The return value of our function is then written to outTable in Azure Table storage. For PowerShell functions, output bindings are explicitly written to with the Push-OutputBinding cmdlet. This example is a simple illustration of how we configure bindings for a function. We could change the output to be an email using a SendGrid binding, or put an event onto a Service Bus to notify some other component in our architecture, or even have multiple output bindings to push data to various services. [!TIP] To view and edit the contents of function.json in the Azure portal, from the Home page, select your function app, and in the right pane, select JSON View. The Resource JSON view displays the Resource ID and the editable JSON code. To close the JSON view, select the X in the top right corner of the pane.
  • #24: Azure provides several predefined function templates for common scenarios: Quickstart Custom functions
  • #25: When adding your first function, you are presented with the Add function pane in which you can select the trigger for your function. Based on your selections, Azure will generate the function code and configuration with sample code provided to display the input data received in the log.
  • #26: Selecting a template from the Add function pane provides easy access to the most common templates. Azure provides over 30 additional templates you can start with. These can be selected from the template list when creating subsequent functions.
  • #27: When you create a function from a template, several files are created. For example, if you opted to use the Webhook + API Quickstart using JavaScript, the files generated would be a configuration file, function.json, and a source code file, index.js. The functions you create in a function app appear by selecting Functions under the Functions category in the left menu pane of your function app. When you select a function in your function app, your function pane appears. To display and edit your code for your function, in the left menu pane, under Developer, select Code + Test. In the function's path above the code box, select function.json from the dropdown list, and then select Test/Run from the top menu bar for the Input/Output pane to appear. See the following screenshot. As you can see, the pane on the right has tabs for Input and Output. Selecting the Input tab provides parameters to test the HTTP request for your function.
  • #28: After you've created a function, you'll want to test it. There are two approaches: Running it manually Testing it from within the Azure portal itself
  • #29: You can start a function by manually triggering the configured trigger. For instance, if you are using an HTTP trigger, you can use a tool, such as Postman or cURL, to initiate an HTTP request to your function endpoint URL, which is available from the function definition (Get function URL).
  • #30: The portal also provides a convenient way to test your functions. As previously described, after selecting Test/Run from the top menu bar, on the right side of the code box, a tabbed Test pane appears. Here, you can provide parameters to test the HTTP request. When you select Run in this pane, the results appear in the Output tab, along with a status code in the Logs pane.
  • #31: The ability to monitor your functions is critical during development and in production. The Azure portal provides a monitoring dashboard, which you turn on by enabling Application Insights integration. In the menu of your function app, under Settings, select Application Insights, select Turn on Application Insights, and then select Apply. In the dialog box, select Yes. The Application Insights dashboard provides a quick way to view the history of function operations by displaying the timestamp, result code, duration, and operation ID populated by Application Insights.
  • #32: After you've enabled Application Insights in the Azure portal, you're also able to add logging statements to your function for debugging. The called methods for each language are passed a "logging" object, which may be used to log information to the Logs pane located at the bottom of the code window in the Code + Test pane after running a test. The following JavaScript code snippet shows how to log a message using the context.log method (the context object is passed to the handler). context.log('Enter your logging statement here'); We could do the same thing in C# using the log.LogInformation method. In this case, the log object is passed to the C# method processing the function. log.LogInformation("Enter your logging statement here"); In PowerShell, use Write-Host to write to the log: Write-Host "Enter your logging statement here"
  • #33: You can locate the errors and warnings tab in the same menu as the log tab. This tab shows compilation errors and warnings within your code.
  • #34: Link to published module on Learn: https://docs.microsoft.com/en-us/learn/modules/learn-pr/azure/create-serverless-logic-with-azure-functions/5-add-logic-to-the-function-app
  • #35: https://docs.microsoft.com/en-us/learn/modules/learn-pr/azure/create-serverless-logic-with-azure-functions/5-add-logic-to-the-function-app
  • #37: You've learned how to use Azure Functions to host business logic services in the cloud. It's a great way to add hosted services to your solution that can scale and grow with your business. You focus on the code using the language of your choice, and Azure manages the infrastructure. Functions can integrate with other services, like Event Grid, GitHub, Twilio, Microsoft Graph, and Logic Apps to create complex and robust serverless workflows quickly and easily.
  • #39: Explanation: Serverless doesn't mean there are no servers - it just means the developer doesn't have to worry about servers. Instead, a cloud provider such as Azure, manages servers.
  • #40: Explanation: Serverless doesn't mean there are no servers - it just means the developer doesn't have to worry about servers. Instead, a cloud provider such as Azure, manages servers.
  • #41: Explanation: A function app is a way to organize and collectively manage your functions. A function app is comprised of one or more individual functions that are managed together by Azure App Service. All the functions in a function app share the same pricing plan, continuous deployment, and runtime version.
  • #42: Explanation: A function app is a way to organize and collectively manage your functions. A function app is comprised of one or more individual functions that are managed together by Azure App Service. All the functions in a function app share the same pricing plan, continuous deployment, and runtime version.
  • #43: Explanation: The API can be included in a query string variable named "code", or it can be included in an x-functions-key HTTP header.
  • #44: Explanation: The API can be included in a query string variable named "code", or it can be included in an x-functions-key HTTP header.