Azure Function App
  • 19 Nov 2024
  • 7 Minutes to read
  • Dark
    Light
  • PDF

Azure Function App

  • Dark
    Light
  • PDF

Article summary

Azure Function

Operations

Users can enable and disable an Azure Function by clicking the respective options.

Enable-disable.png

Test Function

Azure Functions can be made to test run to view the status code and response using Turbo360.

  1. Select the Request method
  2. Provide a message body
  3. Custom headers and Query parameters can also be included
  4. Click Run

The input fields vary according to the trigger type.

For example, to test an HTTP triggered Function, the user can select the request method, say GET or POST and add Headers, Query parameters, and Message body. After providing the details, a test run can be made, and the response and its status code will be displayed.

Test function.png

Manage Keys

Keys provide default security mechanisms, and keys can be created at the Function level in Azure Functions.

If a key is created for a Function, then the Function expects the key as a header to authorize any HTTP request. If no key is created, no key is required for the HTTP requests to get authorized.

Turbo360 provides the capability to manage keys at the Function level. These keys are scoped to the function and can be used to access the function.

Perform the following steps to add a new key:

  1. Click the New function key
  2. Provide a key name and its value
  3. Click Create

The existing keys can be modified and deleted by using the respective icons.

Manage Keys.png

Invoke Triggers

Azure Function supports triggers like HTTP, Service Bus Queue, Timer, etc. There may be scenarios where an invocation of the Function fails, and the user needs to reinvoke it.

There is no possibility to do it apart from posting the message of the failed invocation to the Trigger of the Function (this is not feasible in Timer triggered Function).

Turbo360 can invoke the Function by sending a message to the Trigger. Users can achieve this by providing the Trigger details in Invoke Function screen and by sending the message.

For example, if the Function is a Service Bus Queue triggered, the user can provide the Queue connection details and post the message. The Triggers supported in Turbo360 are Service Bus Queue, Service Bus Topic, Event Grid, and HTTP.

Invoke trigger.png

Invocation Logs

  • Access to the invocation logs of Azure Functions is a significant capability provided by Turbo360 in terms of Azure Function App management.

  • The logs can be filtered by selecting one of the following states: Succeeded, Failed.

  • The invocation detail contains the following information: Invocation date, Message, and Log level.

Invocation logs.png

Resource Dashboard

  • The application insight resource created when deploying the Azure Function resource in the Azure portal must be associated with the same Business Application to use the resource dashboard for Azure Function resources.

Resource dashboard.png

  • A set of default queries is available to create dashboard widgets using the associated application insight.

  • The count chart type is not supported for the Azure Function resource dashboard.

Azure Function resource dashboard widgets can only be created using the application insight resource deployed alongside the Azure function deployment. The creation of dashboard widgets will restrict access to additional application insight resources.

Monitoring

Monitoring.png

State Monitoring

  1. Navigate to Azure Function -> Monitoring
  2. Configure threshold value for the state of the function to determine the health state
  3. Click Save

The monitoring rule will be saved for Azure Function, and the monitoring state will be reflected after every monitoring cycle.

Failure Monitoring

  1. Navigate to Azure Function -> Monitoring
  2. Select Failed invocations under Failures and configure the threshold values
  3. Click Save

Failure monitoring will be initiated once the rule is saved, and the monitoring state will be reflected after every monitoring cycle.

Query Monitoring

  1. Switch to the Queries tab to configure rules for query monitoring
  2. Click Add
  3. Enter a name to the query rule
  4. Choose any application insight resource to fetch query data
  5. You can enter the desired query by choosing Enter query (or) select one from the list of saved queries by choosing Open from saved queries
  6. Select the preferred time range
  7. Click Execute to run the query
  8. Select the required query columns and configure the threshold values
  9. Click Save

Query monitoring.png

Query monitoring will be initiated once the rules are saved, and the query monitoring state will be reflected after every monitoring cycle.

Azure Function App

Azure Function Apps can be set to Start, Stop or Restart by clicking the respective options.

Operations.png

Resource Dashboard

Users have access to a default Azure Function App Dashboard, which allows them to stay updated with real-time data through enhanced data visualization.

Resource dashboard.png

Users are provided the following pre-defined Dashboard widgets, which can be customized to meet their needs.

1. Function Execution Count
2. Requests Count
3. HTTP Errors
4. Data In vs Data Out
5. Average Memory Working Set
6. IO Read vs. IO Write

Monitoring

Monitoring.png

Availability status monitoring

The resource health status of Azure Function Apps can be monitored by using the Availability status monitoring rule.

  1. Navigate to Azure Function App -> Monitoring
  2. Configure Availability status rule with the desired threshold
  3. Click Save

Availability status.png

State Monitoring

  1. Navigate to Azure Function App -> Monitoring
  2. Configure threshold value for State rule under Status category to determine the health state
  3. Click Save

State monitoring.png

The monitoring rule will be saved for Azure Function App, and the monitoring state will be reflected after every monitoring cycle.

Instance Monitoring

  1. Navigate to Azure Function App -> Monitoring
  2. Configure threshold value for the Instance of the function to determine the health state
  3. Click Save

Instance monitoring.png

The Instance monitoring rule will be saved for Azure Function App, and the monitoring state will be reflected after every monitoring cycle.

Quotas Monitoring

  1. Navigate to Azure Function App -> Monitoring
  2. Configure threshold value for the quotas of the function to determine the health state
  3. Click Save

Quotas monitoring.png

The Quotas monitoring rule will be saved for Azure Function App, and the monitoring state will be reflected after every monitoring cycle.

Metrics Monitoring

  1. Navigate to Azure Function App -> Monitoring
  2. Configure threshold value for the metrics of the function to determine the health state
  3. Click Save

Monitoring.png

The threshold values can also be provided with any metric name, defining the monitoring rule to be violated when the metric value configured at the threshold field is met.

Monitoring rules will be saved for Azure Function App, and the monitoring state for the metrics will be reflected after every monitoring cycle.

Monitoring Recommendations

This section will outline some recommendations for monitoring your function app. For an Azure Function App you can monitor things at the app and the individual function level.

Function App

The settings that can be configured for monitoring the function app itself are covered here. Note that these settings are common to all functions within the function app.

State Monitoring

Below you can see where I can configure the monitoring to check for the state. If the function app is not in the running state then it will raise an error.
In the case below I have also configured an auto-correct rule so that it will change it back to running.

State monitoring.png

Instance Count

You may have a scenario where you want to make assertions about the number of nodes your function app should be running. In the below case my function plan is configured to scale out automatically under load but I have configured Turbo360 to raise an alert if the instance goes beyond 1.

Instance monitoring.png

You may also use this feature to alert if your app scales in below a specific number of nodes.

Metrics

The function app provides several metrics that you may want to monitor.

Metric monitoring.png

The most common metrics you are likely to want to monitor are below:

MetricWarning ThresholdError threshold
ConnectionsVariesVaries
Http 4xxVariesVaries
Http Server ErrorsVariesVaries
RequestsVariesVaries
Response TimeVariesVaries
Private BytesVariesVaries

The values for these metrics will vary based on the app service plan you run the function app on and the usage of your app. Its important to check the values to ensure they make sense for your application.

Individual Functions

You can also monitor individual functions within Turbo360. By adding individual functions within the Function App to your Business Appliction you can do the monitoring discussed below.

State Monitoring

The state monitoring allows you to test the status of the function is not disabled.

State monitoring.png

Invocation Monitoring

Invocation monitoring will check the run history for individual functions and will allow you to raise an error if you get beyond a specific number of errors.

Failure monitoring.png

Log Monitoring

If you add the app insights instance associated with the Function App to your Turbo360 Business Application then you can also add query monitoring. In the below query I am looking at the specific response time for the individual function and raising an alert if it is beyond expectation.

Query monitoring.png

More Info

There is more info on the various metrics related to function apps on the below link:

https://learn.microsoft.com/en-us/azure/azure-functions/monitor-functions-reference


Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence