Web App Bot cant insert records in the Azure Table Storage
Version
Microsoft Bot Framework SDK 4.0
Describe the bug
I implemented a new feature to write user messages to the Azure Table Storage. When I test the bot locally, everything works as planned. If I upload the code to an Azure Web App Bot and test it in Azure, the bot does not write anything to the storage. But why?
To Reproduce
- Build a web app bot inside Azure (I used this: https://docs.microsoft.com/de-de/azure/bot-service/bot-builder-tutorial-dispatch?view=azure-bot-service-4.0&tabs=cs)
- Create a storage account with a table
- Publish the code to the web app bot and write things like "dtezezetdf" or "252632375" (For the table storage code i used this tutorial: https://www.programmingwithwolfgang.com/implement-azure-storage-tables-queues-and-azure-cosmos-db-table-api/)
- check if the bot writes things in the table storage
Expected behavior
The Web App Bot should write messages that the bot cant handle in the table storage storage.
Screenshots
Here i save my credentials for the storage account
There is the placeholder for the user message
This is the method i execute when the bot cant handle the message from the user

These are the outputs from my App Insights. As i said earlier everything works, when i try to execute and test the code locally with VS and the bot framework emulator. This error only appears online inside the web app bot.
If i need to add more informations feel free to ask for that.
Tracking Status
Dotnet SDK TODO
- [ ] PR
- [ ] Merged
Javascript SDK TODO
- [ ] PR
- [ ] Merged
Python SDK TODO
- [ ] PR
- [ ] Merged
Java SDK TODO
- [ ] PR
- [ ] Merged
Samples TODO
- [ ] PR
- [ ] Merged
Docs TODO
- [ ] PR
- [ ] Merged
Tools TODO
- [ ] PR
- [ ] Merged
Hi @stevkan, any update?
Hi @danieldangler, can you verify that you are including the table storage credentials in your app service configuration?
Hey @stevkan , the credentials are at the moment hardcoded in my GetTableReference() method, (first screenshot, i have changed the credentials with the placeholders "CONNECTION STRING" and "TABLE NAME"). Do i need them also in the App Service configuration?
Thanks for your time!
@danieldangler, hard-coding the creds should be fine, though I'd argue placing them in the app service configuration is a better option (but that is another topic).
How are you publishing your bot? Are you doing so thru Visual Studio? If so, there is an option you can select that tells the service to remove/delete all files before deploying the new files. I'm not confident that this is the issue, but it is worth trying while I suss this out a bit more.
@stevkan i used two methods to publish the code:
- I have tried to publish the code via azure pipelines
- I have tried to publish the code via Visual Studio
i just tried if the publishing process in visual studio works if you delete all files in the app service but unfortunately without success
@danieldangler, thank you for your patience. I'm going to ask that you post this on Stack Overflow as this really is a "how-to" question in which you are trying to roll your own storage solution for logging user activity. The official Bot Framework Github repo is the preferred platform for information on submitting bug fixes and feature requests.
That being said, if you post the question on Stack Overflow I can continue to offer guidance in that forum. Be sure to apply the botframework tag to your question as we try to monitor Stack Overflow for submitted questions. As long as you do that, it will be visible to my team. You also have the added benefit of a wider community available to offer help.
Please consider updating your question when you re-post with responses to the following as they will help in understanding the overall issue.
- Where in the bot lifecycle are you implementing/calling your methods?
- Have you tried assigning your table storage credentials as singletons in
startup.cs? - In the second attached image, you call
TableOperation.insert()...where is that coming from? - It looks like
NoMatchFound()is part of a dialog waterfall. Is this correct? What is happening before/after this step. What leads to it? - You say this works locally. What happens if you run local but trying tunneling to your ABS bot registration using ngrok (replacing the messaging endpoint with the ngrok url +
/api/messages) and then run using Test in Web Chat?