I've currently got a Bot running in Microsoft Teams, which has been built many years ago using the Microsoft Bot Framework v3 SDK. Now I will show an example of a location where I have saved some data after using the Bot, which I understand is stored in the "IBotDataBag".
So this method is the first method that is called when I enter a message to the Bot in Teams (as a result of the framework). It is injected with an object of type "IDialogContext" and this object contains other objects, one, which is of type "IBotData" and above in the image is "context.UserData". I use this to set some data, for example I had set it to store a value inside the key of "test_data", which I retrieve in the image above.
Now my question is, where in the Bot application is this data actually held? My application is deployed to Azure as an application service. It is installed locally in my Microsoft Teams after installing it from my Org's application catalogue. I want to know whether this data is held somewhere locally on my PC or in the cloud somewhere. Based on a test by uninstalling the Bot I thought if it was held in the cloud then the data set in the "IBotDataBag" would be removed but after installing the Bot after, the information was still present, which leads me to believe the Bot held onto the information locally on my machine. I have tried to find information to support this conclusion online but I have not spotted anything useful so far and I understand Microsoft are now very much pushing SDK v4 so was hoping someone on here can shed some light on the question for me please?
So after reviewing the architecture of the bot in its resource group in the Microsoft Azure portal, I found an entry of type "Storage Account", which is basically Azure Table Storage for the bot. In here there is a section for "Tables" and in here you will find an entry called "botdata". Inside of this table you will find several entries, which are identifiable by their partition key. After running doing some trial and error I found that removing the "msteams:user" entries would result in my bot not having any "UserData" inside of the context object. Based on several tests, I concluded that the data is held in table storage and that the bot framework handles the CRUD operations on this data.