question

timbola avatar image
timbola asked

Azure Function queue trigger

I'm using Azure Functions with a scheduled task. That schedules task runs through a segment and call an Azure Function for each player in that segment. First I've used a HTTP trigger, but since it's triggered from a scheduled task, the execution time limit is 1 second. And I've got every call the "CloudScriptAzureFunctionsExecutionTimeLimitExceeded" error.
The function did run and it worked (was sending a push notifications and doing some other player stuff), but it keeps giving me that error. I have enabled cold start prevention on Azure, but still the error.

I've read that using a Queue trigger instead of a HTTP can help, but setting up the Queue trigger is really complex and not well documented.

I've come this far, the scheduled task is running and I can see that in the queue (screenshot attached). But the function itself doesn't run, well at least there is no error, or push notification send or play stream event generated..

So I see that the queue has the message, but when does it actually run the function? And how to debug / log the output?

This is an warning / error I see in the console :

2021-01-06T17:05:43.087 [Error] The 'SendPatientWaitingQueue' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'SendPatientWaitingQueue'. Microsoft.Azure.WebJobs.Extensions.Storage: Storage account connection string 'AzureWebJobsStorage' does not exist. Make sure that it is a defined App Setting.

Any clue?

CloudScriptscheduled tasks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Rick Chen avatar image
Rick Chen answered

You can use the streaming logs to debug your Azure Function. For example, if you are using Visual Studio Code, you could follow this document to open streaming logs.

You mentioned that you get the error: ['AzureWebJobsStorage' does not exist. Make sure that it is a defined App Setting.] It seems that your Azure Function is not properly setup. Could you please describe how you set up the Azure Function?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

timbola avatar image timbola commented ·

Hi, I think that is the problem. Where should I define that app settings? And what should I define to get the queue working?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.