Office365 Cloud Subscription issue: SAM - Import user subscriptions job failing


Description

Microsoft Office365 user subscriptions will not be present under SaaS License > All User Subscriptions though there is an active integration with Microsoft Office 365 Admin Center. 

Cause

This particular scenario would be observed when the SAM - Import user subscriptions job is failing to complete.

The status of this job can be viewed from under samp_job_log and there would be no relevant error that can be seen in the job record. To identify the error, the below steps have to be followed. 

Resolution

This solution is applicable for a scenario where we find the below errors in the sys_log for the SAM - Import user subscriptions job.

  1. Unhandled exception for profile
  2. Authorization_RequestDenied
  3. Insufficient privileges to complete the operation.

The reason for seeing this issue is because of the incorrect client secret.

Note While on the Microsoft Office 365 Admin Center, when the client key is being generated from under Certificates and Secrets section, the client secret is not shown only ONCE. So, the admin who is setting up the integration has to make a note of the key or else there is no chance to have it retrieved. 

To resolve the issue-

  1. If the Microsoft Office 365 Admin has a track of the client key, then, on the existing subscription under SaaS License module, open up the subscription and update the client key section.
  2. If there is no track of the client key, it is always recommended to delete the existing subscription from the instance and perform a new set up by generating a new profile on Microsoft Office 365 Admin Center. ServiceNow's documentation Set up Microsoft Office 365 Cloud License Management can be followed to perform a fresh install.