0

If I use Application insight for my azure function I can see that it works. Screen shot here. enter image description here

I have published my azure function to azure and it works perfect. I have switched on Appligation insight but when I look at monitor for my azure function I can see that both success count and error count is always zero. I know that my azure function works because it insert record in my database. I have waited much longer than 5 minutes but nothing happens. My azure function is done in .Net Core 3.1.

I mean that since all monitoring for Azure Functions is done with Application Insights by default it should update success count and error count

user3840170
  • 26,597
  • 4
  • 30
  • 62
tony
  • 37
  • 5

1 Answers1

0

I have referred this MSDOC to configure Application Insights after deployment, telemetry and stack reference.

Code :

try
{

var  length  =  name.Length;
}
catch  (Exception  ex)
{
log.LogError(ex,  "An error occurred: {errorMessage}",  ex.Message);
return  new  StatusCodeResult(StatusCodes.Status500InternalServerError);
}
if  (string.IsNullOrEmpty(name))
{
log.LogWarning("No name provided in the request.");
}
else
{
log.LogInformation($"Name received from the request: {name}");
}

In Local Output:

enter image description here

  • Deployed the application we can find the motor log in motor tab.

enter image description here

enter image description here

enter image description here

  • Make sure to enable application insights from the MSDOC, Steps in Stack reference, and test the application again.

In Application Insights :

Output:

enter image description here

enter image description here

Sampath
  • 810
  • 2
  • 2
  • 13