0

I have a simple blob listener which connects to a blob container. The listener(on Azure) shows it's running but the function is not being invoked.

Here's the log from the console.

Azure Functions Core Tools (3.0.2630 Commit hash: ......)
Function Runtime Version: 3.0.13901.0
[7/6/2020 5:24:04 PM] Building host: startup suppressed: 'False', configuration suppressed: 
'False', startup operation id: '.........'
[7/6/2020 5:24:04 PM] Reading host configuration file '.....\host.json'
[7/6/2020 5:24:04 PM] Host configuration file read:
[7/6/2020 5:24:04 PM] {
[7/6/2020 5:24:04 PM]   "version": "2.0",
[7/6/2020 5:24:04 PM]   "logging": {
[7/6/2020 5:24:04 PM]     "applicationInsights": {
[7/6/2020 5:24:04 PM]       "samplingExcludedTypes": "Request",
[7/6/2020 5:24:04 PM]       "samplingSettings": {
[7/6/2020 5:24:04 PM]         "isEnabled": true
[7/6/2020 5:24:04 PM]       }
[7/6/2020 5:24:04 PM]     }
[7/6/2020 5:24:04 PM]   }
[7/6/2020 5:24:04 PM] }
[7/6/2020 5:24:04 PM] Loading functions metadata
[7/6/2020 5:24:04 PM] Reading functions metadata
[7/6/2020 5:24:04 PM] 1 functions found
[7/6/2020 5:24:04 PM] 1 functions loaded
[7/6/2020 5:24:04 PM] Loading extensions from .....\netcoreapp3.1\bin. BundleConfigured: False, 
PrecompiledFunctionApp: False, LegacyBundle: False
[7/6/2020 5:24:04 PM] Loading startup extension 'AzureStorage'
[7/6/2020 5:24:04 PM] Loaded extension 'AzureStorage' (3.0.10.0)
[7/6/2020 5:24:05 PM] Initializing Warmup Extension.
[7/6/2020 5:24:05 PM] Initializing Host. OperationId: '......'.
[7/6/2020 5:24:05 PM] Host initialization: ConsecutiveErrors=0, StartupCount=1, 
OperationId=..........
[7/6/2020 5:24:05 PM] LoggerFilterOptions
[7/6/2020 5:24:05 PM] {
[7/6/2020 5:24:05 PM]   "MinLevel": "None",
[7/6/2020 5:24:05 PM]   "Rules": [
[7/6/2020 5:24:05 PM]     {
[7/6/2020 5:24:05 PM]       "ProviderName": null,
[7/6/2020 5:24:05 PM]       "CategoryName": null,
[7/6/2020 5:24:05 PM]       "LogLevel": null,
[7/6/2020 5:24:05 PM]       "Filter": "<AddFilter>b__0"
[7/6/2020 5:24:05 PM]     },
[7/6/2020 5:24:05 PM]     {
[7/6/2020 5:24:05 PM]       "ProviderName": 
"Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[7/6/2020 5:24:05 PM]       "CategoryName": null,
[7/6/2020 5:24:05 PM]       "LogLevel": "None",
[7/6/2020 5:24:05 PM]       "Filter": null
[7/6/2020 5:24:05 PM]     },
[7/6/2020 5:24:05 PM]     {
[7/6/2020 5:24:05 PM]       "ProviderName": 
"Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[7/6/2020 5:24:05 PM]       "CategoryName": null,
[7/6/2020 5:24:05 PM]       "LogLevel": null,
[7/6/2020 5:24:05 PM]       "Filter": "<AddFilter>b__0"
[7/6/2020 5:24:05 PM]     }
[7/6/2020 5:24:05 PM]   ]
[7/6/2020 5:24:05 PM] }
[7/6/2020 5:24:05 PM] FunctionResultAggregatorOptions
[7/6/2020 5:24:05 PM] {
[7/6/2020 5:24:05 PM]   "BatchSize": 1000,
[7/6/2020 5:24:05 PM]   "FlushTimeout": "00:00:30",
[7/6/2020 5:24:05 PM]   "IsEnabled": true
[7/6/2020 5:24:05 PM] }
[7/6/2020 5:24:05 PM] SingletonOptions
[7/6/2020 5:24:05 PM] {
[7/6/2020 5:24:05 PM]   "LockPeriod": "00:00:15",
[7/6/2020 5:24:05 PM]   "ListenerLockPeriod": "00:00:15",
[7/6/2020 5:24:05 PM]   "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
[7/6/2020 5:24:05 PM]   "LockAcquisitionPollingInterval": "00:00:05",
[7/6/2020 5:24:05 PM]   "ListenerLockRecoveryPollingInterval": "00:01:00"
[7/6/2020 5:24:05 PM] }
[7/6/2020 5:24:05 PM] QueuesOptions
[7/6/2020 5:24:05 PM] {
[7/6/2020 5:24:05 PM]   "BatchSize": 16,
[7/6/2020 5:24:05 PM]   "NewBatchThreshold": 8,
[7/6/2020 5:24:05 PM]   "MaxPollingInterval": "00:00:02",
[7/6/2020 5:24:05 PM]   "MaxDequeueCount": 5,
[7/6/2020 5:24:05 PM]   "VisibilityTimeout": "00:00:00"
[7/6/2020 5:24:05 PM] }
[7/6/2020 5:24:05 PM] BlobsOptions
[7/6/2020 5:24:05 PM] {
[7/6/2020 5:24:05 PM]   "CentralizedPoisonQueue": false
[7/6/2020 5:24:05 PM] }
[7/6/2020 5:24:05 PM] HttpOptions
[7/6/2020 5:24:05 PM] {
[7/6/2020 5:24:05 PM]   "DynamicThrottlesEnabled": false,
[7/6/2020 5:24:05 PM]   "MaxConcurrentRequests": -1,
[7/6/2020 5:24:05 PM]   "MaxOutstandingRequests": -1,
[7/6/2020 5:24:05 PM]   "RoutePrefix": "api"
[7/6/2020 5:24:05 PM] }
[7/6/2020 5:24:05 PM] Starting JobHost
[7/6/2020 5:24:05 PM] Starting Host (HostId=........., InstanceId=........., Version=3.0.13901.0, 
ProcessId=14720, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, 
FunctionsExtensionVersion=(null))
[7/6/2020 5:24:05 PM] Loading functions metadata
[7/6/2020 5:24:05 PM] 1 functions loaded
[7/6/2020 5:24:06 PM] Generating 1 job function(s)
[7/6/2020 5:24:06 PM] Found the following functions:
[7/6/2020 5:24:06 PM] BlobStorageListener.BlobListener.Run
[7/6/2020 5:24:06 PM]
[7/6/2020 5:24:06 PM] Initializing function HTTP routes
[7/6/2020 5:24:06 PM] No HTTP routes mapped
[7/6/2020 5:24:06 PM]
[7/6/2020 5:24:06 PM] Host initialized (602ms)
[7/6/2020 5:24:06 PM] Host started (890ms)
[7/6/2020 5:24:06 PM] Job host started
Hosting environment: Production
 Content root path: ........\bin\Debug\netcoreapp3.1
 Now listening on: http://0.0.0.0:7071
 Application started. Press Ctrl+C to shut down.
 [7/6/2020 5:24:11 PM] Host lock lease acquired by instance ID '..........'.

Even when I log in to azure, to view the published app and refesh, it tell me it's running but the function app still does not get called.

Please can someone guide me on what is wrong?

Jamie
  • 87
  • 1
  • 5

2 Answers2

0

First, you'd better provide a sample code to us.

Assuming you're using blob trigger azure function, please check the following possible reasons:

  1. From the output, it seems that no errors in the function itself. You should check if there are other functions which are also consuming the same blob path. A quick way to check is that, in this azure function, change the blob path to another one. And then run the azure function again.

  2. Make sure you are uploading files to the blob path which is used by this azure function.

  3. For log level in host.json, make sure it's set correctly.

Please let me know if you still have issues after trying the above steps.

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
0

First try out invoking a Http Trigger Function as test. If by this way it does invoke, but by Blob Trigger doesn't, your problem is probably related to a Cold Start.

Blob triggers tend to be slower to invoke and even more if you're using Consumption Plan. They removed this from the docs, but it's said that a delay up to 10-15 minutes can occur. I never found another explanation. Anyway, please read this.

But you can think alternative ways, like described here:

Another approach to processing blobs is to write queue messages that correspond to blobs being created or modified and then use a Queue storage trigger to begin processing.

And a bigger work-around which would still works is if you send a message to a Queue whenever you upload a file, containing the name of the blob that reached on the storage, and then use a Time Trigger function to periodically check from the queue these blob names, download them from the storage and process them.

Not the best way, but a way.

Ramon Dias
  • 835
  • 2
  • 12
  • 23