Perform the following steps:
- Create a new function by choosing Monitoring in the Scenario drop-down and select the Application Insights scheduled digest—C# template, as shown in the following screenshot:

- Soon after, you will be prompted to provide the name of the function, the scheduled frequency, and the SendGrid API Key for the SendGrid output binding, as shown in the following screenshot:

- Next, click on the Create button shown in the previous step to create the new Azure Function. The template creates all the code that's required to query the data from Application Insights and sends an email to the person mentioned in the To address of the preceding screenshot.
Make sure that you follow the steps in the Configuring access keys section of the Pushing custom telemetry details to analytics of Application Insights recipe to configure these access keys: Application Insights Instrumentation Key, the application ID, and the API access key.
- Navigate to the run.csx function and change the app name to your application name, as shown in the following screenshot:

- If you've configured all the settings properly, you will start receiving emails based on the timer settings.
- Let's do a quick test run by clicking on the Run button above the code editor, as shown in the following screenshot:

- This is a screenshot of the email that I received after clicking on the Run button in the preceding screenshot:
