dhavalbhens
ServiceNow Employee

This guide covers the setup for connecting a ServiceNow instance to Microsoft Teams with your own app, the self-configured path, so the Notify connector can make calls. (Related ServiceNow Docs). In several places the current Microsoft and ServiceNow screens differ from what the docs describe, and those places are marked UI differs from docs.

 

Before you begin

  • Roles:
    • Microsoft Teams admin and Microsoft Azure admin for Parts A and B.
    • oauth_admin and admin on the ServiceNow instance for Part C.
  • Plugins: Install and activate below on the ServiceNow instance.
    • Incident Communications Management (com.snc.iam) 
    • Incident Management – Major Incident Management (com.snc.incident.mim) 
    • Notify (com.snc.notify) 
    • Microsoft Teams Communications spoke (sn_msteams_com_spk)
    • Azure Active Directory User Mapping (sn_now_azure)
    • Notify Connector for Microsoft Teams (sn_notify_msteams) 
  • Keep a notes file open. You'll copy the Bot ID, client secret, Application (client) ID, Directory (tenant) ID, and service user Object ID along the way. The client secret is shown only once.

 

Part A - Microsoft Teams Developer Portal

A1. Create the app

  1. Sign in to the Teams Developer Portal (https://dev.teams.microsoft.com).
    1. GCC tenants: the Developer Portal for GCC is only available from inside the Microsoft Teams client, so create the app there.
  2. Go to Apps > New app, enter a name in the Add app pop-up, and select Add.
  3. Go to Configure > Basic information.
    1. UI differs from docs: The docs say an App details page opens. It doesn't. You land on the app overview and have to open Basic information yourself.
  4. Fill in the fields:
    1. UI differs from docs: The docs' example short name, ServiceNow for Notify Microsoft Teams, is longer than 30 characters and won't save.
    2. The App ID on this page belongs to the Teams app. It is not the Bot ID you'll use later.
    3. Field Value
      Short name Your app's name, 30 characters max. Example: ServiceNow Notify for Teams
      Full name Full name of the app
      Short / Long description A description of the app
      Version e.g. 1.0
      Developer or company name Your organization
      Website, Privacy policy, Terms of use Your organization's URLs
  5. Select Save

 

A2. Create the bot (Notify connector)

  1. Go to Configure > App features, select Bot, then Create a new bot.
  2. Select New Bot, enter a name in the Add bot pop-up, and select Add.
  3. Copy the Bot ID. It becomes the Client ID used everywhere else. You can copy it from the browser URL or from Bots > Tools.
  4. Go to Channels, enable Microsoft Teams, and select Save.
  5. Go to Client secrets, add a client secret, and copy it right away. It won't be shown again.

A3. Link the bot to the app

  1. Go to Apps and open your app.
  2. Go to Configure > Basic information.
  3. Paste the Bot ID into Application (client) ID and select Save.

A4. Turn on calling for the bot

  1. In your app, go to Configure > App features > Bot and select your bot.
  2. Under What can your bot do?, select Support audio calls and Support video calls.
  3. Under Select the scopes in which people can use this command, select Personal, Team and Group chat.
  4. Select Save.

Part B - Microsoft Azure portal

B1. Find the bot's app registration

  1. Sign in to the Azure portal (https://portal.azure.com) as an Azure admin.
  2. Go to Microsoft Entra ID > Manage > App registrations.
    1. UI differs from docs: The docs path Azure services > Azure Active Directory > Manage > App registrations no longer exists. Azure Active Directory has been renamed Microsoft Entra ID.
  3. Search for the bot by name or by Application (client) ID, and open it.
  4. From Overview, copy the Application (client) ID and the Directory (tenant) ID.

B2. Add Microsoft Graph permissions

  1. Go to Manage > API permissions and select Add a permission.
  2. Select Microsoft Graph, then Application permissions (not Delegated).
  3. Search for and select each of these permissions:
    1. Permission Group
      User.Read.All User
      OnlineMeetings.ReadWrite.All OnlineMeetings
      Calls.InitiateGroupCall.All Calls
      Calls.JoinGroupCall.All Calls
  4. Select Add permissions

B3. Grant admin consent

  1. On API permissions, select Grant admin consent for <tenant>.
  2. Select Yes in the confirmation pop-up.
  3. Check that every permission shows Granted in the Status column.

B4. Create a service user and grant it an application access policy

Role: Microsoft Teams admin

Microsoft Teams starts every online meeting on behalf of a user. The service user is that account. The Graph permissions from B2 aren't enough by themselves: the app also needs a Teams application access policy assigned to the service user.

 

Create the service user

  1. Sign in to the Azure portal (https://portal.azure.com).
  2. Go to Microsoft Entra ID > Manage > Users and select New user > Create new user.
    1. UI differs from docs: The docs path is Azure services > User > New user.
  3. Fill in User principal name and Display name. Example: ServiceNow Notify Service.
  4. Select Create.
  5. Open the new user and copy its Object ID from Overview. This is the user's Object ID, not the app's.
    1. You'll use it in step 5 of the next part and again in C3.

Note: the service user needs a Microsoft Teams license and a valid Usage location. Without them it can't start conference calls.

 

Create and assign the application access policy (PowerShell)

  1. Open Terminal on macOS or Command Prompt on Windows, type pwsh, and press Enter.
  2. Install the MicrosoftTeams module
    1. Install-Module -Name MicrosoftTeams
  3. Connect to your tenant using the below command:
    1. Connect-MicrosoftTeams
      1. A sign-in confirmation appears in the browser, and PowerShell shows your tenant details. 
  4. Create the policy. Use the Bot ID / Application (client) ID from A2 as AppIds:
    1. New-CsApplicationAccessPolicy -Identity "<PolicyName>" -AppIds "<Bot ID>" -Description "<Policy description>"
    2. Example: New-CsApplicationAccessPolicy -Identity "OnlineMeetingsAccessPolicy" -AppIds "aaaaaaaa-1234-er4r-8dc9-123456789012" -Description "Grant OnlineMeeting Application Permission"
    3. PowerShell shows the policy details when it succeeds.
  5. Assign the policy to the service user. Use the policy name from step 4 and the user's Object ID from step 5 of the first part:
    1. Grant-CsApplicationAccessPolicy -Identity "<Service user Object ID>" -PolicyName "<PolicyName>"
    2. Example: Grant-CsApplicationAccessPolicy -Identity "fdcd9c17-ceae-468f-906f-2er76b4dd0f4" -PolicyName "OnlineMeetingsAccessPolicy"
    3. Policy changes can take a while to reach Teams. If test calls fail right after setup, wait and try again.

Part C - ServiceNow instance

C1. Create the Microsoft Teams application registry entry

Role: oauth_admin

  1. Go to All > System OAuth > Application Registry and select New.
  2. Select Connect to a third party OAuth Provider.
  3. Fill in the form:
    1. UI differs from docs: The docs say to replace common. The portal shows organizations.
    2. Field Value
      Name Something short. The OAuth entity profile name is built from it. Example: Notify Teams App
      Client ID The Bot ID / Application (client) ID
      Client Secret The secret from A2 step 5
      Default Grant type Client Credentials
      Token URL

      https://login.microsoftonline.com/<Directory (tenant) ID>/oauth2/v2.0/token

       

      To get the Token URL from Azure: open the app registration and go to Endpoints. Copy OAuth 2.0 token endpoint (v2), then replace organizations in that URL with your Directory (tenant) ID.

  4. In the OAuth Entity Scopes related list, add a record with Name Default and OAuth scope ".default".
  5. Save the record.
    1. UI differs from docs: The docs' step 7 (setting up the OAuth entity profile by hand) isn't needed.

C2. Create the Connection & Credential alias

Role: admin

  1. Go to All > Connections & Credentials > Connection & Credential Aliases.
  2. Open MSTeamsCommunicationsSpoke.
  3. In the Credentials related list, select New > OAuth 2.0 Credentials.
  4. Fill in the form:
    1. UI differs from docs: The docs' example name, Notify Microsoft Teams credentials for self-configured app, is too long for the field.
    2. Field Value
      Name A short name. Example: Notify Teams Credentials
      OAuth Entity Profile The profile created in C1, e.g. Notify Teams App_default_profile
  5. Select Submit.

C3. Update the records on the Microsoft Teams Configuration page

Role: admin

  1. Go to All > Notify > Microsoft Teams > Configuration.
  2. On the Microsoft Teams Configuration form, fill in the fields:
    1. Field Value
      Credential Alias sn_msteams_com_spk.MSTeamsCommunicationsSpoke
      Application registry The record created in C1, e.g. Notify Teams App
      Tenant ID The Directory (tenant) ID from B1
      Requester The credential created in C2, e.g. Notify Teams Credentials
      Service user Azure ID The service user's Object ID from B4.
      Enable create online meeting Selected
  3. Right-click the form header and select Save.

Result: saving the form also creates an OIDC Application Registry record. C4 checks that it was created.

 

C4. Verify the OIDC Application Registry was created

Role: oauth_admin

If this record is missing, the instance can't process callbacks from Microsoft Teams, and meeting details won't update in real time.

  1. Go to All > System OAuth > Application Registry.
  2. Filter the list by your Client ID (the Bot ID / Application (client) ID).
  3. Check that the list has two records for that Client ID:
    1. the OAuth Provider record you created in C1
    2. an External OIDC Provider record

If both are there, you're done. If the External OIDC Provider record is missing, create it yourself using the below steps:

  1. On Application Registries, select New.
  2. Select Configure an OIDC provider to verify ID tokens.
  3. Fill in the form:
    1. Field Value
      Name The C1 record name with OIDC added, e.g. Notify Teams App OIDC
      Client ID Same Client ID as the C1 record
      OAuth OIDC Provider Configuration Notify Teams OIDC Config
  4. Right-click the form header and select Save.
    1. An OAuth entity profile is created automatically. Make sure its grant type is Client Credentials.
  5. In the OAuth Entity Scopes related list, add a row:
    1. Name OAuth scope
      Notify Teams App OIDC default profile https://api.botframework.com/.default
  6. Right click the form header and select Save
Version history
Last update:
Wednesday
Updated by:
Contributors