Let's create a JavaScript function in Microsoft Azure using Azure Portal:
- Log in to the Azure portal and navigate to the function app, which we created in the previous chapter.
- Click on the + sign to add a new Azure Function. Set the language as Javascript and the template as Generic Webhook, as shown in the following screenshot:
- Now provide a name for the function and click on Create:
- A default template will be created, as shown in the following screenshot:
- Get the function URL and copy it. We will use it later in the chapter. Save it in a notepad:
- Now, we will create a Webhook endpoint in an activity log alert in Azure Monitor. Click on Monitor, as shown in the following screenshot:
- Now we need to create an alert. Click on Alerts and then on Add activity log alert:
- Provide the following details: