Microsoft Graph Presence Publisher (Set) Configuration
Note
Introduced in DC2023.04.
Introduction
The Microsoft Graph Cloud Communications Presence APIs are used by Anywhere365 for two distinct presence actions:
Announcement
As the presence publisher is a relatively new development compared to the presence source in the Microsoft Graph API, there is no thorough field experience which may lead to throttling Throttling, in the context of a software cloud delivery service, is the practice of temporarily suspending or diminishing access to a service offering to a cloud customer. Because cloud platforms are mostly multi-tenant, shared platforms and the usage at any moment of many customers is unpredictable, throttling is a normal and logical procedure of retaining a cloud service for all customers, sometimes at the expense of one or a handful of customers who are at that time using too many resources for the backend platform. Not only a customer itself, but also a "noisy neighbour" on the same platform can be the cause of throttling. Usually service will be resumed at a normal level after a short cool-down period, but can even take up to 24 hours or more. In Microsoft 365 throttling is usually indicated by "429 errors" or "server too busy" messages in logfiles or replies. or other ill-effects. Also, both apps require different authentication methods and permissions, and publishing presence may not be a feature wanted or even allowed in your region and so is optional. For now it is required to create two separate App Registrations one for each presence feature.
-
See other article: Microsoft Graph Presence Source (or Get Presence) which enables the UCC A Unified Contact Center, or UCC, is a queue of interactions (voice, email, IM, etc.) that are handled by Agents. Each UCC has its own settings, IVR menus and Agents. Agents can belong to one or several UCCs and can have multiple skills (competencies). A UCC can be visualized as a contact center “micro service”. Customers can utilize one UCC (e.g. a global helpdesk), a few UCC’s (e.g. for each department or regional office) or hundreds of UCC’s (e.g. for each bed at a hospital). They are interconnected and can all be managed from one central location. to collect presence of Teams users, and
-
This Article: Microsoft Graph Presence Publisher (or Set Presence) enables the UCC to set presence of Teams users.
For more information, see Microsoft’s documentation on https://docs.microsoft.com/en-us/graph/api/resources/presence?view=graph-rest-1.0
Steps
In order to start setting or changing presence of other Microsoft Teams user accounts. There are two prerequisites, per tenant.
-
A Microsoft Entra ID Formerly known as Azure Active Directory (or Azure AD, or AAD) App registration is needed to access the Microsoft Graph APIs.
-
A ClientID and ClientSecret are needed to authenticate against the App Registration.
Microsoft Azure App Registration setup
Please follow below the steps to setup an App Registration in the Microsoft Entra ID Formerly known as Azure Active Directory (or Azure AD, or AAD) portal.
- Navigate to: https://entra.microsoft.com/
-
Under Applications -> App registrations create a new App registration
-
Provide a Name for the application, for example: A365 Graph Presence Publisher Application
-
Select the account type “Accounts in this organizational directory only”
-
Click “Register”
-
-
On the API permissions tab, add the following Application Microsoft Graph permission:
Presence.ReadWrite.All - Read presence information of all users in your organizationDescription: Allows the app to read all presence information and write activity and availability of all users in the directory without a signed-in user. Presence information includes activity, availability, status note, calendar out-of-office message, time zone and location.
Why is this required? To allow the Graph Presence Publisher to set the presence of an Agent, for example when setting a Reason Code.
Permission name: Microsoft Graph / Presence.ReadWrite.All
User.Read.All - Read all users' full profilesDescription: Allows the app to read user profiles without a signed in user.
Why is this required? To allow the Graph Presence Publisher App to translate UPN In Windows Active Directory, a User Principal Name (UPN) is the name of a system user in an email address 'like' format. A UPN (for example: john.doe@domain.com) consists of the user name (logon name), separator (the @ symbol), and domain name (UPN suffix). to ID, ID is required to retrieve presence from user.
Permission name: Microsoft Graph / User.Read.All
-
Since the Presence.ReadWrite.All and User.Read.All permissions needs Admin consent, click the button “Grant admin consent for <tenant>”.
Note
Only a tenant administrator can grant the admin consent
-
On the Authentication tab, change “Allow public client flows” to “Yes”.
-
Click “Save”
-
-
On the Overview tab, copy both the Application (client) ID and the Directory (tenant) ID
-
These IDs need to be used for Basic Configuration.
-
Client secret
An App authenticated with a ClientId and ClientSecret is used to set presence via the Graph API. The ClientSecret needs to be created separately (and periodically renewed) on the Entra ID App registration.
- Navigate to the Application you created in Microsoft Azure App Registration setup
-
On the Client secret tab, click on New client secret:
-
Enter a Description and set the Expires value
-
On the next screen, copy the Value of this secret (so not the Secret ID)
-
The Value needs to be used for Basic Configuration.
-
Configure the Presence Publisher
Note
Introduced in DC2023.04.
In the config.xml of the UCC service, add the following configuration as child node to the <PresenceProvider> element. Make sure to choose a unique ID
(we recommend the domain name). Set the correct TenantId
and ClientId
copied during Microsoft Azure App Registration setup. The Encryptedsecret
must be generated using the Anywhere365 Password Tool to encrypt the ClientSecret
<PresencePublisher >
<MsGraphPresencePublisher>
<Account Id="my-presence-account1" ClientId="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TenantId="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" Encryptedsecret="ENCRYPTED Secret" />
</MsGraphPresencePublisher>
</PresencePublisher>