Symptoms

Task "Unprovisioning "User" for APS application Office 365" fails with the similar output:

APS Application Error:
500 Internal Server Error
[ApplicationUnknownError] Unprovisioning: resource aedcc266-0e2b-4001-89dc-8326a904dcfd of type 'office365users' (http://www.parallels.com/Office365/User/2.5) for APS application 'Office 365-19.1.1-18': Selected licenses cannot be assigned to the same user simultaneously. Please select another license combination..

Body: {
"code": 500,
"message": "Selected licenses cannot be assigned to the same user simultaneously. Please select another license combination.",
"additionalNonlocalizableMessage": "Azure AD GRAPH API Error: 'License assignment failed because service plan 6c57d4b6-3b23-47a5-9bc9-69f17b4947b3 depends on the service plan(s) bea4c11e-220a-4e6d-8eb8-8ea15d019f90'.",
"error": "ApplicationUnknownError",
"http_request": "DELETE /O365App/aps/office365users/aedcc266-0e2b-4001-89dc-8326a904dcfd"
}

The following entry is represented in "apilog" of Office 365 application:

2019-03-23 00:13:29,003 <6996> [ 174] DEBUG apilogger   : Azure AD Graph API request POST url: 'https://graph.windows.net/1f4a9a61-da22-48a2-ff8a-e1318dbff788/users/a6e4d99c-2648-4c69-a505-f43d5ccb41f6/assignLicense?api-version=1.6'

...

Request body:
{
  "addLicenses": [],
  "removeLicenses": [
    "6fd2c87f-b296-42f0-b197-1e91e994b900"
  ]
}

...

{
  "odata.error": {
    "date": "2019-03-22T23:13:28",
    "requestId": "dc916ba6-8ee7-4484-a5fd-52d07f4afc30",
    "code": "Request_BadRequest",
    "message": {
      "lang": "en",
      "value": "License assignment failed because service plan 6c57d4b6-3b23-47a5-9bc9-69f17b4947b3 depends on the service plan(s) bea4c11e-220a-4e6d-8eb8-8ea15d019f90"
    }
  }
}

Cause

Office 365 license can have several so called service plans included on Microsoft side. In the case provided above, these service plans are following:

RMS_S_ENTERPRISE (bea4c11e-220a-4e6d-8eb8-8ea15d019f90)
RMS_S_PREMIUM (6c57d4b6-3b23-47a5-9bc9-69f17b4947b3)

In this example, service plan "RMS_S_PREMIUM" depends on service plan "RMS_S_ENTERPRISE". However, these service plans can be enabled on different Microsoft subscriptions.

It may cause a situation when it is not possible to unassign certain license because service plan from other subscription depends on service plan enabled for the license assigned to the user.

Resolution

Behavior of Office 365 application regarding license assignment is considered to be reworked in scope of request #APSA-19010

Please contact your Technical Account Manager or Member of Pooled Technical Associate team in order to discuss a possibility to apply internal workaround.

Internal content

Link on internal Article