1
votes

I have two azure functions that exist in the same azure function app and they are both connected to the same instance of application insights:

  • TimerFunction uses a TimerTrigger and executes every 60 seconds and logs each log type for testing purposes.
  • BlobFunction uses a BlobTrigger and its functionality is irrelevant for this question.

It appears that when BlobFunction is enabled (it isn't being triggered by the way), it clogs up the application insights with polling, as I don't receive some of the log messages written in TimerFunction. If I disable BlobFunction, then the logs I see in the development tools monitor for TimerFunction are all there.

This is shown in the screenshot below. TimerFunction and BlobFunction were both running until I disabled BlobFunction at 20:24, where you can clearly see the logs working "normally", then at 20:26 I re-enabled BlobFunction and the logs written by TimerFunction are again intermittent, and missing my own logged info.

enter image description here

Here is the sample telemetry from the live metrics tab:

enter image description here

Am I missing something glaringly obvious here? What is going on?

FYI: My host.json file does not set any log levels, I took them all out in the process of testing this and it is currently a near-skeleton. I also changed the BlobFunction to use a HttpTrigger instead, and the issue disappeared, so I'm 99% certain it's because of the BlobTrigger.

EDIT:

I tried to add an Event Grid trigger instead as Peter Bons suggested, but my resource group shows no storage account for some reason. The way the linked article shows, and the way this video shows (https://www.youtube.com/watch?v=0sEzimJYhME&list=WL) just don't work for me. The options are just different, as shown below:

enter image description here

1
Can you please make sure your targetted storage account meets the demands of being a GPv2 storage account? See this for upgrade processPeter Bons
Yeah I had just read that in the docs and checked, and it is v1. I'll upgrade to v2 and give it a whirl.Murphybro2

1 Answers

1
votes

It is normal behavior that the polling is cluttering your logs. You can of course set a log level in host.json to filter out those message, though you might loose some valueable other logging as well.

As for possible missing telemetry: it could very well be that some logs are dropped due to sampling that is enabled by default. I would also not be suprised if some logging is not shown on the portal. I've personally experienced logging being delayed up to 10 minutes or not available at all in the azure function log page on the portal. Try a direct query in App Insights as well.

Or you can go directly to the App Insights resource and create some queries yourself that filter out those messages using Search or Logs.

The other option is to not rely on polling using the blobtrigger but instead use an event grid trigger that invocates the function once a blob is added. Here is an example of calling a function when an image is uploaded to an azure storage blob container. Because there is no polling involved this is a much more efficient way of reacting to storage events.