Getting error stating Bot should use its own storage - botframework

While I test my latest Bot skills developed in Azure, I get below error. I didn't get this error for my other bots.
{
"error": {
"code": "ServiceError",
"message": "Bot should use its own storage"
}
}
How do I prevent my code from using Bot storage.
Regards,
Pradeep

As per the documentation of Azure Bot Service 3.0, it is mandatory to manage state data. You cannot "prevent" your code from using storage.

Related

Teams Toolkit HelloWorld chat bot - Failed to send

I’ve just downloaded Teams Toolkit onto VSCode and used the plugin to create a Command Bot project. Completed all the prerequisites and configurations on my tenant (I’m the admin for our 365 business account)
Everything installs great.
I hit f5 to launch the debugger.
All prerequisite checks pass.
Chrome opens
I can [Add] my local debug bot into the web app version of teams
I go to send any message OR the helloWorld command that comes with the template app and it gives me “Failed to send message” error.
When I hit F12 to bring up the Chrome dev tools and go into the network tab to see the call that is being sent, I see and Error as the response payload: errorCode 201 errorSubCode 1 with the message “One or more of the user ids provided are not valid."
Payload:
{
"members": [
{
"id": "8:orgid:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"role": "Admin"
},
{
"id": "28:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"role": "Admin"
}
],
"properties": {
"threadType": "chat",
"chatFilesIndexId": "2",
"uniquerosterthread": "true",
"fixedRoster": "true"
}
}
Response
{
"errorCode": 201,
"message": "One or more of the user ids provided are not valid.",
"standardizedError": {
"errorCode": 201,
"errorSubCode": 1,
"errorDescription": "One or more of the user ids provided are not valid."
}
}
I haven’t written any custom code or made any changes. Just trying to launch the bot straight from Toolkit creation.
I've also tested the ngrok session that is connected to make sure that communication back to me is working fine. I see logging when I try to hit the ngrok url so I feel this is a failure at the point of Teams trying to send to their API.
I’ve followed all the steps in the documentation regarding setup. I would appreciate any help anyone would have on this.
Thank you
This is probably caused by incorrectly bot identity used in Teams channel registration in Bot Framework. Not quite sure what happen when calling the bot framework service to do the bot registration herre.
You can check if your App ID and password is correctly in Bot Framework registration:
The bot credentials in .fx configs:
The app password can be decrypted from local.userdata
To resolve this, could you please try one of the following solutions:
Create a new Command Bot and run F5 again.
Or, you can delete the local.userdata and state.local.json files in your current project. And then re-run F5, the toolkit should create a new AAD app for your bot registration in this case.

Azure bot framework Slack channel "Slack API error" because of token_expired

I have a self-hosted Azure bot with a Slack channel. The bot is able to send proactive messages and respond to user mentions after I authorized it with Slack. However, this stops working after some period of inactivity. The request via botbuilder sdk results in "Slack API error" and the underlying error appears to be token_expired.
await turnContext.sendActivity({ text: 'Some message...', textFormat: 'markdown' });
I assumed that token refresh should be fully handled within the framework. Has anyone encountered this issue? Is there some specific configuration that is required?

Post message to MS Teams channel using Graph API

I'm trying to send a message to MS Teams using Graph API. I'm passing access token (AAD token) with it but still, it's giving me below error. I have given all the required permissions in Azure API permissions.
error:
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "53a5aaff-3d39-42ce-bdc6-74d02a756be2",
"date": "2019-12-23T06:42:27"
}
}
}
API: https://graph.microsoft.com/beta/teams/{group-id-for-Teams}/channels/{channel-id}/messages/{message-id}/replies
Oh, if this is from a bot (not clear from the original question, but clarified in your later comment) then you don't need to use the Graph API at all - there's another way to send the message using the Bot Framework tools instead. You can do this either from within your bot, or from a different application altogether. I've got a few bots where the user schedules something, like when they want a message sent, where the bot saves it to a database and I have another application (mostly I use Azure Functions right now) to send the item on that schedule.
There are some important pieces of information you need to store though, which you can get any time the users sends your bot a message - it's the information you need to store so that you know how to connect directly to that user and that conversation. It's called Pro-active Messaging, and to see how to do this, see the answer I posted at Programmtically sending a message to a bot in Microsoft Teams
If you DON'T have any conversation history with the user ever (as in they have never spoken with your bot before, and you're trying to send the first message) then it gets more complicated... Let me know if that's the case though.
Sending message to a channel using graph api is a protected api and it needs access permission from Microsoft.
Access can be requested from Microsoft access reuqest form.
Once access is given from Microsoft add graph api in api permissions of your web app, and bingo you can get the response.

"Bot is not valid. Errors: MsaAppId: MsaAppId is already in use

I am getting this error now when I tried to deploy a new skill to my virtual Assistant bot
Deployment failed. Correlation ID:
484cfdba-38bb-4d45-8358-9245aef97167. { "error": { "code":
"InvalidBotData", "message": "Bot is not valid. Errors: MsaAppId:
MsaAppId is already in use.. " } }
As per comments posted here, one app id can only be related to one bot.
So does that mean for each of the skill that I want to add to my Virtual Assistant bot, I need to create new MSA App ID ?
Yes, you need to have a separate MSA app (ID would be unique, password could be the same if you wish).
Each skill (along with the Virtual Assistant itself) is a bot framework bot. Each bot is at the simplest, a bot channels registration. Each registration maps to an app and needs to be unique.

Does Teams support bot send attachments into conversations such as apk, pdf by REST?

I am trying to build a Bot that supports posting apk files into Teams using the BotFramework REST APIs.
I have tried https://smba.trafficmanager.net/amer-client-ss.msg/v3/conversations/${conversationId}/activities but got the response:
{
"error": {
"code": "BadArgument",
"message": "Unknown attachment type "
}
}
I also tried https://smba.trafficmanager.net/amer-client-ss.msg/v3/conversations/${conversationId}/attachments and got the response statuscode:404.
Does Teams not support this?
UPDATE: Teams now supports bots sending and receiving files. As far as I can tell, there isn't a restriction on file types.

Resources