Symptoms

The task for provisioning 'Tenant' Office 365 application resource, scheduled as a result of importing existing Office 365 CSP subscriptions into OSA, fails with the following output:

500 Internal Server Error
[ApplicationUnknownError] Provisioning: resource 0ef1cf21-eea0-42ef-8b57-c45a7a863d66 of type 'tenants' (http://www.parallels.com/Office365/Tenant/1.1) for APS application 'Office 365-6.4.1-8': The INSERT statement conflicted with the FOREIGN KEY SAME TABLE constraint "FK_Subscription_Subscription_Parent". The conflict occurred in database "O365", table "dbo.Subscription", column 'Id'.
The statement has been terminated..

Body: {
"code": 500,
"message": "The INSERT statement conflicted with the FOREIGN KEY SAME TABLE constraint \"FK_Subscription_Subscription_Parent\". The conflict occurred in database \"O365\", table \"dbo.Subscription\", column 'Id'.\r\nThe statement has been terminated.",
"additionalNonlocalizableMessage": "",
"error": "ApplicationUnknownError",
"http_request": "POST /O365/aps/tenants to '192.168.1.1'"
}

Cause

The behavior is caused by the software-related issue APSA-14747: "Task 'Provisioning "Tenant" for APS application Office 365' fails with 'The INSERT statement conflicted with the FOREIGN KEY SAME TABLE'" and fixed in Office365 16.5.

Resolution

To prevent the issue, please update Office365 APS to version 16.5. To workaround the issue please contact Odin Technical Support.

Internal content

Link on internal Article