Blob Storage Trigger Function App is not working for 1 user but works for the other one.
Hi Azure community
I have an Azure function App that is Blob Triggered. Each time I upload an Excel file it triggers the function app. Whenever my colleague tries to do the same it doesnt work. Both have the exact same set of roles and accesses. The app is something that gets triggered every couple of weeks. Whenever the colleague has uploaded the file or does it on call with me, it ends up working. Otherwise it stays uninvoked for days.
Steps I take while/before on call:
- Go to function app and check if the function app is running.
- Check if there is any invocation in the logs.
- Check blob container and see if the file is uploaded there.
Sometimes, as soon as I open the blob container it automatically triggers the function app for the file the colleague has uploaded. I understand this issue seems weird but has been troubling us/halting work since past few months.
Thanks.
Azure Functions
Azure Blob Storage
-
Loknathsatyasaivarma Mahali • 430 Reputation points • Microsoft Vendor
2025-02-05T01:34:13.8733333+00:00 Hello @Harsh Atha,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
I'm sorry to hear that your colleague is having trouble with your Azure Function App. It sounds like you are experiencing some inconsistencies with the Blob Trigger.
- First, it's great that you are checking if the function app is running and if there are any invocations in the logs. That's a good place to start.
When you say that your colleague's uploads don't work, do you mean that the function app is not triggered at all? Or is it triggered but not processing the file correctly?
- If the function app is not triggered at all, it's possible that there is an issue with the Blob Trigger binding. One thing you can check is if your colleague's uploads are being saved to the same blob container and with the same file name format as your uploads. If the file name format is different, the Blob Trigger may not be able to detect the new file.
- Another thing to check is if your colleague has the necessary permissions to upload files to the blob container. You mentioned that you both have the same set of roles and accesses, but it's possible that there is a permission that your colleague is missing.
- If the function app is triggered but not processing the file correctly, it's possible that there is an issue with the code in your function app. You may want to review the code to see if there are any differences between how your uploads are processed and how your colleague's uploads are processed.
- Lastly, you mentioned that sometimes opening the blob container triggers the function app for your colleague's uploads. This could be a timing issue where the Blob Trigger is not detecting the new file immediately. You may want to try increasing the value of the "path" parameter in the Blob Trigger binding to see if that helps.
Also, please refer the below document which help in better understanding Create an Azure Blob storage triggered function and Trigger on a blob container
I hope the above provided information will helps you in understand the process and helps you resolve the issue, if you have any further concerns, please feel free to reach out to us.
-
Harsh Atha • 0 Reputation points
2025-02-05T16:01:01.7133333+00:00 Thank you so much for the response. Based on all the points you mentioned above, I have tried all of those.
It triggers the function immediately when I upload the file. When the colleague does it, it does not get triggered. When I go to the container and try to see if the file is uploaded in the correct format, it gets triggered.
- They have access to upload the file and it shows up in the blob.
- The function does get invoked when I go and recheck the blob storage for them. I am just going and checking the file. Not uploading myself.
- And once I do that, the app runs correctly.
-
Loknathsatyasaivarma Mahali • 430 Reputation points • Microsoft Vendor
2025-02-06T12:24:43.1933333+00:00 Hello @Harsh Atha,
Based on your description, it seems the issue may be related to the timing of the function app's trigger. When you check the blob container, it’s possible that the act of accessing it is triggering the function app to run. This might be because the function app is set up to trigger on changes to the container, and accessing it could be counted as a change.
To test this, you could have your colleague upload a file and wait a few minutes before you access the container. If the function app triggers after you check the container, it suggests the issue is related to the timing of the trigger.
If that’s the case, consider adjusting the trigger settings to ensure it checks for changes more frequently or more consistently. Alternatively, you could set up a separate process to periodically check the container and trigger the function manually when needed.
-
Harsh Atha • 0 Reputation points
2025-02-06T15:42:04.5766667+00:00 @Loknathsatyasaivarma Mahali Thank you.
I believe it is primarily the timing of the trigger. Can you guide me a bit on how to change that?As for the other alternative you mentioned, this is something I am keeping as a last min alternative
-
Loknathsatyasaivarma Mahali • 430 Reputation points • Microsoft Vendor
2025-02-07T02:13:16.5866667+00:00 Hello @Harsh Atha,
Sure, to address the issue of your function app not triggering consistently when your colleague uploads a file, it's likely related to the polling frequency of the Blob Trigger. While the Azure portal UI doesn’t allow direct adjustments to the polling interval, you can modify the host.json configuration file to control how often the function checks for new blobs.
Steps to Adjust the Polling Frequency:
- Go to the Azure Portal and navigate to your Function App.
- In the left-hand menu, under Settings, select Configuration > Application Settings.
- Look for the host.json file (or create it if it doesn’t exist).
- Edit the host.json file to adjust the Blob Trigger polling frequency. Here’s an example of how to modify it:
{ "version": "2.0", "extensions": { "blobs": { "maxPollingInterval": "00:01:00", // Sets polling to check every 1 minute "maxOutstandingMessages": 10 } } }
maxPollingInterval: This setting controls how often the function checks the blob container. In the example above, it’s set to check every 1 minute. You can customize this to a frequency that fits your needs (e.g., every 5 minutes, 10 minutes, etc.).
maxOutstandingMessages: This setting controls the number of messages the function can process at once. You can keep the default unless you're processing large volumes of blobs.
- Save your changes and restart the Function App to apply the new settings.
- After making the changes, upload a file to the blob container and verify that the function triggers as expected.
This should help resolve the issue of delayed triggers, ensuring your function app runs more consistently when files are uploaded.
-
Harsh Atha • 0 Reputation points
2025-02-07T15:45:57.3233333+00:00 @Loknathsatyasaivarma Mahali I forgot to update that I am using Python 3.9 for this.
I was unable to find the above 2 parameters in the documentation. I believe it is present in JavaScript but not Python.
Javascript vs Python
-
Loknathsatyasaivarma Mahali • 430 Reputation points • Microsoft Vendor
2025-02-10T14:11:10.4466667+00:00 Hello @Harsh Atha,
Thanks for sharing the additional information.
To improve the performance and responsiveness of your Azure Functions, consider the following steps:
First, increase the function timeout by adding the following to your host.json file to allow up to 10 minutes for processing:
{ "version": "2.0", "functionTimeout": "00:10:00" }
Next, if you're using a Premium or Dedicated Plan, enable the Always On setting in your Function App's General Settings to prevent idle behavior. Finally, if you're on the Consumption Plan, switch to a Premium or App Service Plan for better scalability and reduced cold start times. These adjustments will help ensure your functions are more responsive and capable of handling longer processing times effectively.
-
Loknathsatyasaivarma Mahali • 430 Reputation points • Microsoft Vendor
2025-02-11T14:25:12.91+00:00 Hello @Harsh Atha,
This is a friendly follow-up to check if the information provided above helped you understand the issue better and addressed your concerns. If you have any further questions or concerns, please feel free to reach out to us.
-
RithwikBojja • 75 Reputation points • Microsoft Vendor
2025-02-12T05:17:09.91+00:00 Hi @Harsh Atha , Could you please confirm which plan you're currently using? Additionally, I want to make sure I understand correctly: Is there only one function app and one container where you or your colleague upload/modify the blobs.
Thank you!
Sign in to comment