Registering the Microsoft Graph App On Microsoft Azure Active Directory

To achieve this, follow the steps detailed below:

  1. Login to the Office 365 portal as a Global Administrator and to the Admin center.

  2. When Figure 1 appears, browse the left panel of Figure 1 for the Admin Centers node. Expand the node and select the Azure Active Directory sub-node within.

    Figure 1 : Clicking on Azure Active Directory under Admin Centers

  3. Figure 2 then appears. From the list of options under Manage in the left panel of Figure 2, select App registrations to register the Microsoft Graph app.

    Figure 2 : Selecting the App registrations option to register a new app on Azure AD

  4. Figure 3 then appears, using which you can register the Microsoft Graph app. In the Name text box, specify the display name of the app you intend to register. Make sure you copy this name to notepad. Then, from the drop-down in the Redirect URI section, select Web. In the text box adjacent to the drop-down, specify the URL to which the authentication response needs to be returned after successfully authenticating users to the new app. Make sure that this URI is in the format: https://<initial/default domain> For example, the URI can be Finally, click the Register button in Figure 3 to register Microsoft Graph on Azure AD.

    Figure 3 : Registering the Microsoft Graph app on Azure AD

  5. Upon successful app registration, Figure 4 will appear displaying a message to that effect. Additionally, Figure 4 will display the Application (client) ID that is auto-generated and auto-assigned to the Microsoft Graph app. Make sure you copy this ID also to notepad.

    Figure 4 : Viewing and making a note of the Application ID of the Microsoft Graph app

  6. Next, proceed to create a secret for the new app. To achieve this, click on the Certificates & Secrets option under Manage in the left panel of Figure 4. Figure 5 will then appear. Now, click on the New client secret link in the Client Secrets section in the right panel of Figure 5.

    Figure 5 : Clicking on the New client secret link

  7. When Figure 6 appears, provide a Description for the new secret, set it to Never expire, and click the Add button to add the new secret.

    Figure 6 : Creating a new secret for the Microsoft Graph App

  8. Once the new secret is successfully created, a key Value will be generated for it as depicted by Figure 7. Make a note of this key in notepad.

    Figure 7 : The key Value that is generated and assigned to the client secret of the Microsoft Graph app

  9. Next, proceed to grant permissions to the Microsoft Graph app, so it can pull the desired metrics. For this, click on the API permissions option under Manage in the left panel of Figure 7. This will invoke Figure 8. In the right panel of Figure 8, click on the Add a permission link.

    Figure 8 : Clicking on the Add a permission button

  10. Then, click on Microsoft Graph in the Request API Permissions window that appears (see Figure 9).

    Figure 9 : Selecting the Microsoft Graph option

  11. When Figure 10 appears, click on Application permissions. Then, when the Permission tree appears (see Figure 11), do the following:

    • Expand the ServiceHealth node and select the ServiceHealth.Read.All option;

    • Expand the ServiceMessage node and pick the ServiceMessage.Read.All option;

    • Expand the User node, and select the User.Read.All option;
    • Expand the Reports node, and select the Reports.Read.All option;

    This will allow the Microsoft Graph app to read the service health information, user profiles, and usage reports of your organization. Finally, click on Add permissions in Figure 11 to add the chosen permission.

    Figure 10 : Selecting the Application permission option

    Figure 11 : Granting ServiceHealth and ServiceMessage permissions

  12. When Figure 12 appears, click on Grant admin consent for ... to grant admin consent to the permissions requested.

    Figure 12 : Clicking on the Grant admin consent option

  1. Now, click on the Add a permission link in Figure 12.

  2. From Figure 13 that then appears, select the Yammer option.

    Figure 13 : Selecting the Yammer option

  1. This will invoke Figure 14. Here, select the Delegated Permissions option, and then click the check box alongside user_impersonation in the Select Permissions section (see Figure 14). Then, click the Add permission button in Figure 14.

    Figure 14 : Granting the user_impersonation permission

  2. You will now return to Figure 12, where you will find the Yammer permission you selected in Figure 14 displayed. Click onGrant admin consent for ... to grant admin consent to that permission.

  3. Next, proceed to create a .dat file to which the details of the Microsoft Graph app - i.e., the app name, its client ID, and client secret - will be written. At run time, the eG agent reads the .dat file to know which app should be used for pulling metrics from Office 365. To create the .dat file, first, login to the eG agent host, Then, using Powershell ISE, execute the O365_CreateGraphDat.ps1 command from the <EG_INSTALL_DIR>\lib\O365 directory. Upon successful command execution, the dialog box depicted by will appear.

  4. In , specify the Username and Password of the O365 user account that you have created for monitoring purposes. If the eG agent will be communicating with Office 365 via a Proxy server, then configure the Host IP and Port number of the Proxy server. If the Proxy server requires authentication, then provide a valid Username and Password for the Proxy user. Then, in the O365 MS Graph Details section, mention the App name. This should be the same name you gave the app in step 4 above. Then, specify the Client ID and Client secret for the app. The Client ID should be the Application (client) ID you made a note of in step 5 above (see Figure 4). The Client secret should be the key that is generated and assigned to the client secret in step 8 above (see Figure 7). Finally, click the OK button.
  5. If the .dat file is created successfully, a message to that effect will appear. You will find this .dat file in the <EG_AGENT_INSTALL_DIR>\agent\O365\MSGraph folder in the eG agent host.


    In environments where hundreds of users connect to Office 365, it is common-place to configure multiple agents to monitor a single Office 365 tenant for the purpose of load-balancing. In such environments, you do not have to run the O365_CreateGraphDat.ps1 script on each agent and create a separate .dat file on every agent host. Instead, after registering the MS Graph App, run the O365_CreateGraphDat.ps1 script on any one agent, and have the .dat file (containing the app name, client ID, client secret) automatically created on that agent. You can then copy the MSGraph folder (containing the .dat file) so created to the <EG_AGENT_INSTALL_DIR>\agent\O365\ directory of every other agent that has been configured to monitor the target Office 365 tenant. If this folder is not copied to the other eG agents as well, then none of these agents will be able to report those metrics for which the MS Graph App is required..