Configure Virtual Agent access in Microsoft Teams using ServiceNow Messaging Apps IntegrationSummaryIn addition to accessing Virtual Agent from service portal on a ServiceNow instance, users can also access it from external messaging applications such as Microsoft Teams, Slack, Facebook Workplace etc. This article explains the steps needed for configuring the Virtual Agent to be available from within the Microsoft Teams environment. ReleaseAny release (including Quebec and Paris) that supports Microsoft Teams messaging apps integrations InstructionsPrerequisite Steps: On Microsoft's Teams side, an Admin Developer account is needed. If you do not have such an account, you can create it as per steps below. Creating Microsoft Admin Developer account Make sure you have an Office 365 account either personal or a corporate one. If you don't, then go ahead and create one from this Microsoft.com link.NOTE: When performing this step to create a new Microsoft.com account, you may need to wait a few hours for your account to be registered before proceeding with below steps.Login to Office 365 accountGo to https://developer.microsoft.com/en-us/microsoft-365/dev-programClick on Join Now and fill out the form as appropriate and hit SubmitNOTE: When creating a new Microsoft accountThis should open Microsoft 365 page similar to belowEnroll for E5 subscription (see example below) and make sure to save the password securely Adding test users to your MS Teams test environment Once enrolled in 365 E5 Developer subscription you now need to add at least 1 user that will be linked to Microsoft Teams Apps integration in ServiceNow instance. Here you can either use Microsoft 365's "Create test users" capability which creates up to 16 different users. If using this mechanism, you will be prompted to set the same password for all these user's. Make sure to save the password securely. Once these users are created (may take around an hour and may not get a confirmation that the process completed), they can be accessed from 365 Admin Center by logging in with your 365 E5 developer account. Here is a screenshot example of what the User Admin page will look like once completedTo add user/s manually to your 365 developer account, just go to 365 Admin Center logging in with your 365 E5 developer account and add the user/s.Note down the UserName and full domain value ex. User1@Domain.onmicrosoft.com of one of these users as we will need to create a user account on the SN instance. Post Pre-requisite Configuration Steps Go to ServiceNow instance where Microsoft Teams needs to be linked and create a new user record on the instance and set the UserID to the UserName (without the domain value) and email to the full username including the full domain as described in Prerequisite:Adding test users to your Microsoft Teams test environment Step 3 above.Give admin role to this user.Impersonate newly created user and go to Messaging Apps Integration module on the ServiceNow instanceClick on Install next to Microsoft Teams and you will be prompted to login to Microsoft account. Login using the user account you are impersonating that was created in prerequisite steps 6 through 8 above. You may need to click on ‘Use another account’ option in the Microsoft login prompt if the user name does not show up.Once successfully logged in, you should see below screen and click on Accept.In case this Microsoft account is already associated to a different SN instance with Microsoft Teams messaging app integration, you will see below prompt to which you can select OverrideYou may see a prompt to re-pick the Microsoft account if Override was selected, in which case pick the same account again. This should result in Success confirmation similar to below.Now the last step is to add the Virtual Agent app in Microsoft Teams and the instance should be ready to roll with Microsoft Teams messaging integration successfully setup. To do so, go to https://www.office.com/?auth=2 as same user we impersonated in step 3 and click on Microsoft TeamsClick on Apps on bottom left and enter ‘Virtual Agent’ and click on Add to add the App to Microsoft TeamsCongratulations! Virtual Agent should now be ready to roll in Microsoft Teams similar to screenshot below Related LinksRefer to links below for additional details on Microsoft Teams and ServiceNow messaging integrations: DOCs: Virtual Agent integrations with messaging appsVirtual Agent Academy: Improve Your Conversations with Microsoft TeamsPrepare your Microsoft 365 tenantMicrosoft 365 Developer programManage Microsoft Teams settings for your organization Additional Troubleshooting Checklist for Microsoft Teams/SN messaging integration issues: Roles Required in ServiceNow to Install VA Teams: (virtual_agent_admin and external_app_install_admin) or admin. Roles Required in Microsoft Teams: Teams Admin. Integration only supports users with MS Office 365 accounts. It does not support Microsoft Teams freemium account. Helpful recovery commands for VA in MSTeams: How to start a new conversation: Type hi. How to end the conversation Type hi. The bot will respond with the options – End conversation, Chat with agent, Cancel.If ‘End conversation’ is clicked, the conversation will be ended. User has to type ‘hi’ again to start a new conversation. If ‘Cancel’ is clicked, the previous question will be displayed again. If ‘Chat with agent’ is clicked, the user will be connected to a live agent. Note that the ‘Chat with agent’ button will be present only if live agent is configured. If ‘hi’ is not working and if you are unable to proceed forward in the conversation, type restart. If hi and restart are not working, it’s possible that user is in a live agent chat. Type ‘bye’. Note: hi, restart will work only in VA chat. These commands will not work in Live agent chat. How to connect to live agent Run the ‘Live Agent Support’ topic.Type agent -> User will be prompted with ‘Chat with agent’ and ‘Cancel’. Clicking on ‘Chat with agent’ will connect to an agent. How to end live agent chat Type bye.Bot will respond with the options: End Chat and Cancel. Clicking on End chat will end the live agent chat Note that in a live agent, no other commands will work except ‘bye’. Notifications are not working: While in Global application scope, go to Messaging apps integration page on ServiceNow instance and make sure that the Enable notifications flag is checked. BOT is not responding in Microsoft Teams for all users: Paris and prior troubleshooting steps: Check if a configuration is present for in sys_cs_adapter_configuration_page_teams with the corresponding tenant id.If a record is not there, try to re-install from messaging apps page. Retry again from teams. Check if a record is present in sys_cs_vendor_client_adapter_configuration, for the corresponding tenant id. If a record is not there, then go to sys_cs_adapter_configuration_page_teams and change the name of your configuration (you can just add a ‘.’ at the end).This will trigger a business rule and will create a record in sys_cs_vendor_client_adapter_configuration.Check If the record is created in sys_cs_vendor_client_adapter_configuration and you can remove the ‘.’ from the name in sys_cs_adapter_configuration_page_teams.Retry again from teams after this. BOT is not responding in Microsoft Teams for particular users: Go to sys_cs_client_adapter table.Filter with: Client type -> “Microsoft Teams’, Group ID -> Tenant Id (you can find it in sys_cs_adapter_configuration_page_teams record), Consumer -> <The impacted user> Sort by created/updated.Open the first record and check the conversationId in the adapter state.Copy the id and filter using sys_id in sys_cs_conversation table.If the conversation record is in faulted state or if the record is missing for some reason, we can delete the sys_cs_client_adapter record and retry again from Microsoft Teams. Auth OIDC configuration issue: If you see this error: Get for non-existent record: oidc_provider_configuration:initializing 2019-09-19 07:35:04 (153) Default-thread-2 SYSTEM txid=54c48368dbc8WARNING *** WARNING *** No record found in oidc_provider_configuration for sysId= Go to application registry (oauth_entity.list) Select ‘ServiceNow Virtual Agent Teams App’Confirm if an entry is present in OAuth OIDC Provider Configuration.If not select ‘Microsoft Teams’ and save.Retry again from teams