Bot Framework Emulator and Cortana userinfo - botframework

I'm trying to create a location aware Cortana skill and for that I need a bot that works with this.
However when trying to develop this bot with the bot framework emulator I'm having issues debugging the location aware part as I'm not getting the userinfo entity that Cortana should provide. Is this possible at all with the emulator as it does not seem possible to have Cortana connect to my Visual Studio debug session.

Currently the emulator does not provide any options to pass along entities and channelData with request such as user profile and contextual information as explained here.
You should be able to debug your Cortana Skill by using ngrok to create a tunneling to your localhost bot. After that, you should update the url of your bot in the BotFramework Dev portal.
Also, have in mind that for the skill to sync with Cortana, the test device must be logged in with the same Microsoft account used to create the skill (see Set up your Cortana skills development environment

As Ezequiel wrote, you have to debug your skill in Cortana and/or from your phone.
List of step are:
create your bot
configure it and obtain app id/password
config the permissions and user info you want to access
then enable the Cortana channel from the skill dashboard
provided all the relevant required info
you're good to go (if I didn't forget anything)
You log in with Cortana using the same email address you used to register your bot, at this point you're able to invoke your bot/skill using the invocation name. From your phone (I tried only on Android) you can do it just typing in Cortana (no need for voice).
Please, bear in mind when creating your bot that if you use a WORK account you will not be able to add Cortana as a channel to your bot; therefore, no Cortana Skill. Microsoft doesn't support it yet.

Related

Teams communication to custom https endoint

I would like to know how does Team communicate with a custom https endpoint.
I am developping a bot using Teams Toolkit and I am trying to understand what commands does teamsfx in order to successfuly side load app on Teams.
When trying to run the default command of "dev:teamsfx" and building the package using the correct ngrok enpoint and then uploading that package on Teams, the bot does not receive any messages through the "api/messages" endpoint.
However, when i run the deugging tool in VS Code, everything works fine and we pin pointed that the part that we are missing to add is found inside of these commands :
Teams Toolkit executed commands
So i have 2 questions :
Where can i find documentation regarding the tasks that Teams Toolkit is running so that we can manually execute those commands?
Why does Teams not reach our "api/messages" endpoint when we ONLY run "dev:teamsfx" ? (The appPackage is correct with the right manifest)
To answer your two questions:
The documentation about using Teams Toolkit to debug you app is here. You can read the documentation to know the details about what Teams Toolkit does for you after you press F5. For bot, Teams Toolkit will register and configure the bot, see here for more details.
When you run dev:teamsfx, the bot service will start. However, you have not configured the bot messaging endpoint, this is why Teams does not reach api/messages. When you press F5, Teams Toolkit will automatically start ngrok to forward the local bot traffic to a public url, then use this url to configure the bot messaging endpoint, e.g. https://0556-2404-f801-9000-1a-6fea-00-690.ngrok.io/api/messages. If you want to use your own tunnelling tool instead of the default ngrok, you can follow this doc. By the way, you can manage the bot (that Teams Toolkit has created for you) in Bot Framework developer portal, https://dev.botframework.com/bots.

Teams channel in Azure Bot Service not working

I created an Azure Bot Service. When I test the service using "Test in Web Chat" it works as expected. When I add the Web Chat channel and use the Web Chat URL, it works as expected.
However, when I add the Microsoft Teams channel, it does not work as I expected. The Health Status shows "Healthy" (in "Channels (Preview)") and "Running" (in "Channels"). When I select "Open in Teams", I am redirected to Teams, but I do not see the bot as a user/bot I can chat with. I watched a video showing just that behavior as I was expecting, but the link only opens my Teams. I only have one other user in Teams and that user shows up. No sign of the bot. What am I missing?
I tried using the "Get bot embed codes". I put in the URL for the Mstreams href and instead of sending me to the bot user as I expected, I am redirected to the other user on the account (not the bot). What am I missing?
I've tried this using the "Channels" and the "Channels (Preview)" sections with the same results.
If relevant, I am still in the trial period with Azure and have not upgraded, but nothing says this should be an issue.
From all I can tell, I'm logging into the Azure portal and the Bot Framework portal with the same account as my Teams account. I'm using latest updated version of Chrome.
I don't think free account has anything to do with this. But the fact that the " bot embed codes" lead you to a different user, may be a configuration issue. Read Create a bot and Test and debug your Microsoft Teams bot in the Microsoft Teams documents for more information.
If you have successfully deployed to teams channel (teams channel registration), as per docs Copy the https part of the code that is shown in the Get bot embed code dialog.
For example, https://teams.microsoft.com/l/chat/0/0?users=28:b8a22302e-9303-4e54-b348-343232
In the browser, paste this address and then choose the Microsoft Teams app (client or web) that you use to add the bot to Teams. You should be able to see the bot listed as a contact that you can send messages to and receives messages from in Microsoft Teams.
Alternately, In-order to test them in teams you need to take the app id from the Configuration page of the bot.
Once you search with the app ID in teams you would be able to see this bot as a contact in Microsoft Teams.
Refer:
Create a Teams app package and upload your app to the Teams client for testing. Learn how
Publish your bot as a Line of Business app in your organization's Teams Tenant App Catalog. Learn how
Publish your bot as an app in the Teams App store. Learn how
I think I have found the answer, though I'm still trying to retrace my steps to make sure this is accurate. I will update here if I find anything more of value.
Despite little/no documentation to this effect, bots apparently do not work in the free version of Teams. You have to at least:
create a developer version of Microsoft O365 (E5 license) (and go through all the rigamarole to get it setup properly)
add at least one more user to the organization
then open Teams
Then, I used the embed URL to get the bot to show up. (Again, the same process did not work with my free Teams account even with another user added to it).
For the record, I didn't need to change any admin settings once the three items above were completed.

Cortana Channel Integration to Bot takes to browser after invocation

I created basic Web app bot (LUIS template, SDK v3) using Azure Bot service. I added some intents and entities and have tested that bot works in web chat control.
After that I added Cortana Channel to it. Gave Invocation name as "my desk" and deployed to Cortana.
I made sure my i am logged into Cortana using same MS account as i used to register into bot framework and language and region settings are En-US on my PC as well as Cortana.
I invoke by asking "Hey Cortana, ask my desk get green book". After this, it opens a browser with some search results.
I am unable to understand whats the problem here? How to debug this issue , in which direction? This is a very simple basic bot that Cortana i think is not able to invoke.
Any help greatly appreciated!!
Thanks!
There may be an issue with cookies; even when changing the user. Please confirm that you have changed between MSAs, or specifically, an MSA and AAD account during your development process. If you do change between accounts on the Cortana notebook, you can try clearing Edge (used by Cortana to render) cookies or Cortana data here. https://privacy.microsoft.com/en-us/windows-10-microsoft-edge-and-privacy
Please let me know.

Cortana skills bot invocation name not being discovered after publishing

I added a new Bot i am developing in .net via the Bot Channels Registration option in Azure. I then added a Cortana channel to the bot via the Knowledge Store. Although I can test my Bot using Test in Web Chat, I cannot get Cortana to talk to my Bot. When Cortana does understand my accent she just opens up a web page and my break point in my code is never reached. Looking at the Channels Tab in Azure and clicking on edit for the Cortana channel, I see my invocation name as being My_XYZ and the option to edit this is disabled. However in the knowledge store I can edit the invocation name which I have changed to My ABC (with space).
The bot is currently published to Self for testing and I can see that its ID points to the name of my bot in Azure i.e. some_team.my_xyz
I am using a secure ngrok tunnel on my localhost and this works ok as stated with the chat bot.
Does anyone know if there is a step missing from the docs? (some links in the docs give 404 errors) and why i cannot change the invocation name of my bot in Azure. Also do I need to have the same invocation names in the Bot and the Cortana channel or does Cortana handle this mapping for you.
I see my invocation name as being My_XYZ and the option to edit this is disabled.
I find that if I’m an administrator on the subscription, the Invocation name option is editable.
But if I’m use another account with Owner role, the Invocation name option will be disabled. I’m not sure if it is portal issue, if possible, you can try to report it on Azure portal.
do I need to have the same invocation names in the Bot and the Cortana channel or does Cortana handle this mapping for you.
Based on my experience, we need not to specify same invocation name on Azure Bot portal and Knowledge Store portal.
In my test, I set invocation name with “helloworld” (not same as invocation name on Azure Bot portal “helloworldchat”), I can invoke helloworld as expected.
My problem was solved here on Github https://github.com/Microsoft/BotBuilder/issues/3991
To sum it up, Cortana Skills is currently only available to the US and since I live in the UK I will have to wait until MS decide to release it to the rest of the world. To overcome this you can change the region of your PC to the US. This allows you to test your app. However, note that Cortana does not fully support adaptive cards.
I only hope that Bot development does not go the same way as apps for Windows 10 did and that MS update the desktop and Azure emulators to support the latest development versions of adaptive cards etc quicker than they are and to release Cortana Skills to developers outside the US. I was hoping that the bot framework would use the same model of development and release that .netcore did.

Does a Bot Framework bot need to be registered every time it changes, or only once?

I have created Bot 'MyFirstBOT' where my backend is QnA maker application data. I have given a name to this bot called 'TestJPBOT' and I have enabled the Teams channel for this bot so that we can use this bot on Teams applications. Right now in our organization we are working to register this bot with Microsoft so that we can start using it. I would like to know going forward if I want to make any changes in the bot, like changing its name, profile picture, or something similar, do I need to reregister it every time with Microsoft? Or is there no need?
Per my simple testing using Azure Bot Service env, we don't need register again after change our bots.
Actually, register your bot is populate your bot on Microsoft, equivalent to create a index for your bot I think. You change your bot's profile or code, should not effect the index.

Resources