Find Idle Azure Functions App (Last 30 Days)

Fábio Santos 65 Reputation points
2023-10-25T11:37:50.87+00:00

Hi,

I'm trying find azure functions apps that didn't have execution in last 30 Days.

I'm looking Function Execution Count Metric with 0 value.

But i find an Azure function app (with one http function) that have 0 in Function Execution Count Metric in last 30 Days, but i can see the function has been executed a lot.

User's image

User's image

What really means the Function Execution Count? Which metric should i look to find Azure function apps without executions in last 30 Days?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,496 questions
0 comments No comments
{count} votes

Accepted answer
  1. navba-MSFT 18,735 Reputation points Microsoft Employee
    2023-10-26T06:32:27.3666667+00:00

    @Fábio Santos Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    I understand that your query is to identify idle Azure Functions apps that didn't have execution in last 30 Days.

    FunctionExecutionCount: Function execution count indicates the number of times your function app has executed. This value correlates to the number of times a function runs in your app. This metric isn't currently supported for Premium and Dedicated (App Service) plans running on Linux.

    More Info here.

    The Function Execution Count metric counts the number of times a function is executed. It's a useful metric to track the usage of your functions and identify any performance issues. However, it doesn't provide information about when the function was last executed.

    Other Alternatives available:

    Approach 1:

    To monitor function executions, Azure Functions offers built-in integration with Azure Application Insights.

    Once this is enabled, you can view telemetry data in the Monitor tab.

    1. In the function app page, select a function that has run at least once after Application Insights was configured. Then, select Monitor from the left pane. Select Refresh periodically, until the list of function invocations appears.
      User's image
    2. Choose Run in Application Insights to view the source of the query that retrieves the Azure Monitor log data in Azure Log. If this is your first time using Azure Log Analytics in your subscription, you're asked to enable it.

    3.After you enable Log Analytics, the following query is displayed. You can see that the query results are limited to the last 30 days (where timestamp > ago(30d)), and the results show no more than 20 rows (take 20). In contrast, the invocation details list for your function is for the last 30 days with no limit.

    User's image

    More Info here.

    Approach 2:

    You can enable the Diagnostic Logs and send the FunctionLogs to the Log Analytics as shown here.
    You can query the Logs and check if there are any executions for last 30 days. Then create an alert in the LogAnalytics to trigger if there are any execution entries for that function app.

    Hope this helps.

    **

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful