I have a working Teams bot, using the nodejs botbuilder-teams SDK v3, and registered at dev.botframework.com and apps.dev.microsoft.com. I have created a Teams app that contains it (using the App Studio app in Teams), and installed it in an Office 365 developer tenant of which I am the admin, and the bot can send and receive messages with no problem.
When the bot is added to a team, I get the "conversationUpdate"/"teamMemberAdded" message, and use the fetchMembers() call from the teams bot connector to retrieve basic info for each member, including "givenName", "surname", "email", etc. However, I don't get the "jobTitle" attribute. Is there any way to retrieve jobTitle through the Teams bot SDK?
Alternatively, could I make MSGraph API calls (say, /v1.0/groups/{group-id-for-teams}/members)? Is there a good example of a nodejs serverside app like a bot calling the MSGraph API? The authentication part seems somewhat murky to me.
jobTitle is not part of roster details. You need to call Graph APIs to fetch additional details.
Here is Node.js sample for bot authentication. If you are using Azure for bot registration then please take a look at Azure Bot Service for Authentication in Teams documentation.
Related
I am building a Teams App with Bot functionality for proactive messaging targeting single tenants, however I would like to have the bot published in the public marketplace so that users can install it from the marketplace instead of sideloading to their teams. The bot resources and code will be dynamically created on the tenant's azure.
Is there a way for me to have the bot id on the marketplace be dynamic depending on who installed it?
By default the bot is multitenant application. You can use the same bot Id across different tenants.
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.
I'm trying to understand the difference between a bot service registration & application registration in Azure.
I'd assumed that a bot registration was all that was required (to get the app id & secret) to test out a bot, but then came across the following guide for setting up a teams app that used a bot which instructs you to also create an application registration that's linked to the bot registration.
What is the application registration for?
If you're developing a consumer / skill bot setup do you need an application registration for all the bots or just the skill consumer?
Thanks in advance.
So technically you require both, but you're correct that doing a normal bot registration in the Azure portal (I say normal because there are other ways than the portal, for instance, like ARM templates, etc.) will create an App Registration as well. You need to go to the app registration to get your app password (also called app secret).
You can choose to go another route, like creating an app registration first, and then using that when you create your bot, and there are reasons why you might like to do that, but if you don't have a specific reason, just go the normal route.
Incidentally, be aware of the difference when creating your bot between a "Bot Channels" registration and a "Web App Bot" - both will give you a bot registered with the Bot serviced, but the "Web App" bot also includes an Azure "Web app" that you can use to host your bot (whereas Bot Channels gives you more freedom in how you want to host your bot, for instance as an Azure Function or even outside of Azure altogether).
Bot service registration refers to registering a bot with the Azure Bot Service (as your bot does not have to be hosted on Azure).
App registration refers your bot security configuration. You set this up when you click on to the "App ID and password" field during setup.
There is some other Azure Bot Service documentation which goes into this in more detail:
Bot channels registration
Troubleshooting Bot Framework authentication
Create a bot with Azure Bot Service
My web app bot is installed in Teams as an app. (Only in my company(AD) ) Now, I want to fetch users' information such as email, name etc... I don't want to send oauth card again and again to users.
Is there any solution which provides fetching users' (team members') information? Can you please share all setups in Azure AD and Bot framework?
Thanks!
We have deployed LUIS V4 in our Azure Platform, and made it available to our employee through SharePoint. It is currently open and does not need log in to be used.
We would like to capture information about who the person interacting with the bot is; is there any way that information related to the user can be retrieved? (employees to use the bot must be authenticated to Azure as it is within a SharePoint, but the bot doesn't require authentication as mentioned)
Thank you!
If you are just using LUIS, then no, it does not do any user specific tasks. It only translates an utterance (phrase) into specific actions (intents and entities), also does not store any state.
So all authorisations and user customisations need to be done outside of LUIS, with plain code. If you are using Azure/Microsoft Bot, you can hook up a channel to LUIS and use the id to identify user (skype id, phone number, microsoft teams id...)
A bit of info for connecting Azure Bot with SharePoint.