Select "Custom Log Search" - insert "search query" (see value below) and condition threshold (5)
Select "Add Action Group" - select the action group (usersUserID)
Fill in Alert name and description
Set Severity to '3'
Click on "Create rule"
Search Query:
requests | where resultCode == 400 and timestamp > ago(5m) and cloud_RoleName == "nsc-func-dev-usw2-tuesday" and operation_Name == "HttpTriggerUserId" and success == false and appName == "/subscriptions/9f4dcf43-aa06-457b-b975-f0216baef20d/resourcegroups/nsc-rg-dev-usw2-tuesday/providers/microsoft.insights/components/nsc-func-dev-usw2-tuesday"
Confirm:
Task: Create alerts for error 400 generated by the /users/{user_id} API - more than 5 errors 400 within 5 min
Steps to accomplish this:
Search Query:
requests | where resultCode == 400 and timestamp > ago(5m) and cloud_RoleName == "nsc-func-dev-usw2-tuesday" and operation_Name == "HttpTriggerUserId" and success == false and appName == "/subscriptions/9f4dcf43-aa06-457b-b975-f0216baef20d/resourcegroups/nsc-rg-dev-usw2-tuesday/providers/microsoft.insights/components/nsc-func-dev-usw2-tuesday"
Confirm: