On Premises

Microsoft Graph Presence Source (Get) Configuration

Introduction

The Microsoft Graph Cloud Communications Presence APIs are used by AnywhereNow for two distinct presence actions, Get Presence states of agents and Set Presence state of agents:

High Level Steps

In order to start collecting presence for Microsoft Teams users, there are two requirements per tenant:

  1. Microsoft Entra ID Formerly known as Azure Active Directory (or Azure AD, or AAD) App Registration:

    1. Register an app in Microsoft Entra ID to query the Microsoft Graph APIs.

  2. Choose Authentication Method:

    1. Delegated Permissions:

      Authenticate using a user account (username and password).

    2. Application Permissions:

      Authenticate using a Client ID and Client Secret.

      Note

      Introduced in DC2024.02

Microsoft Entra Id App Registration setup

Tip

As Microsoft enabled throttling to prevent an overload off API calls, it is advised to use a separate Microsoft Entra ID App registration per UCC Service.
In order to prevent throttling, AnywhereNow queries a maximum of 650 users per request. With the limitation of a maximum of 1.500 requests per 30 seconds. This way AnywhereNow is able to collect presence of 15.000 uniquely configured Agents per App registration.

Please find below the steps to setup an App Registration in Azure.

  1. Navigate to: https://entra.microsoft.com/
  2. Under Applications -> App registrations create a new App registration

    1. Provide a Name for the application, for example: AnywhereNow Graph Get Presence Application

    2. Select the account type “Accounts in this organizational directory only”

    3. Click “Register”

  3. On the API permissions tab,

    Add the following Delegated Microsoft Graph permissions:

    Note

    Introduced in DC2024.02

    Add the following Application Microsoft Graph permissions:

  4. Since the Admin consent are required, click the button “Grant admin consent for <tenant>”.

    Note

    Only a tenant administrator can grant the admin consent

  5. On the Authentication tab, change “Allow public client flows” to “Yes”.

    • Click “Save”

  6. On the Overview tab, copy both the Application (client) ID and the Directory (tenant) ID

Authentication Methods

User Account

Note

You will need one user account for each tenant.

The user account that is used to retrieve presence must be a Microsoft Entra ID Useraccount. This useraccount has the default ability to retrieve presence of other users in the same tenant.

The account does not require any permissions, nor does it need any licenses. Simply create an new user account without any licenses to use it like a service account.

Note

During the setup procedure, the account requires access to Teams to read the presence and complete the setup.

Password policy

Client Secret

Note

Introduced in DC2024.02

An App authenticated with a ClientId and ClientSecret is used to get presence via the Graph API. The ClientSecret needs to be created separately (and periodically renewed) on the Entra ID App registration.

  1. Navigate to the Application you created in Microsoft Entra Id App Registration setup
  2. On the Client secret tab, click on New client secret:

  3. Enter a Description and set the Expires value

  4. On the next screen, copy the Value of this secret (so not the Secret ID)

Configure Agents for presence collection via MS Graph

In order to collect presence for Agents using Microsoft Graph, make sure that the UPN field in the SharePoint Agent list is populated with the correct UPN of the Agent.

Configure the Presence Source

In the config.xml of the UCC service, add the following configuration as child node to the <PresenceProvider> element. Make sure to enter a unique ID (we recommend the domain name). Set the TenantId and ClientId copied during Microsoft Entra Id App Registration setup.

Copy
XML
<MsGraphPresenceSource enabled="true">
<Accounts>
<Account Id="my-presence-account1" ClientId="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TenantId="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" />
</Accounts>
</MsGraphPresenceSource>

This will enable the MsGraphPresenceSource inside the UCC. However after starting the UCC the provider is not authenticated to retrieve presence. Open the UCC logs and search for the following line:

Copy
 
MsGraphPresenceSource GraphPresenceManager::Graph API needs authentication for account with ID 'my-presence-account1' (tenant: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). Please login on the following w

Additional Information

Multiple tenants

It is also possible to use multiple tenants. For example given there is an Azure tenant A dedicated and trusted instance of Azure AD. The tenant is automatically created when your organization signs up for a Microsoft cloud service subscription, such as Microsoft 365. An Azure tenant represents a single organization. [Taken from Microsoft Docs] with 10 users and another Azure tenant with 25 users. Both tenants have to be added in the config as an Account. Always make sure to login with a user from the same tenant.

UCC cache policy

When the complete cache of a UCC is removed, the tokens of the account will also be removed and a new device token must be granted access to start collecting presence information again. This can be prevented by not removed the following folder:

Copy
Folder
%programdata%\Anywhere365\Core\Service\<servicename>\cache\_presence-provider-msgraph

In the config.xml of the UCC service, add the following configuration as child node to the <PresenceProvider> element. Make sure to enter a unique ID (we recommend the domain name). Set the TenantId and ClientId copied during Microsoft Entra Id App Registration setup.

Note

EncryptedSecret: Encrypted secret of the Azure application. Encrypt with A365.PWTool.exe located in UCC install package

Copy
XML
<MsGraphPresenceSource enabled="true">
<Accounts>
<Account Id="my-presence-account1" ClientId="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TenantId="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" EncryptedSecret="xxxx"/ />
</Accounts>
</MsGraphPresenceSource>