Problem
Administrators observed that the 365 Connector had difficulty creating Teams from existing Microsoft 365 Groups. Even when the corresponding option was enabled in the UMC and the configuration was saved, the expected Teams did not appear in Azure/Entra. A review of the environment revealed that the Team creation process was not completing as intended.
Root Cause
Team creation from Groups relies on asynchronous synchronization with Azure/Entra. Microsoft advises waiting up to 15 minutes before retrying when creating a Team from a Group. The 365 Connector follows this logic and retries the operation if the initial attempt fails.
However, multiple repeated attempts were triggered for the same Groups in the UMC:
Each time the configuration was saved, a new task was added to the processing queue in
/var/lib/univention-office365/async/. Over time, this caused the queue to grow significantly.Additionally, attempts were also processed for Teams that already existed, resulting in unnecessary operations and further delays. As the queue expanded, new Team creation jobs were postponed, causing the overall functionality to appear unresponsive.
Solution
The queue processing was optimized by skipping the creation of Teams that already exist in Azure/Entra. This adjustment led to a rapid reduction of the backlog, allowing valid tasks to be processed more quickly. As a result, Team creation now behaves as expected, with new Teams appearing in Azure/Entra once the asynchronous process completes.
The Microsoft guideline of waiting approximately 15 minutes for the asynchronous operation remains relevant.
For customers interested in the code modification that enables skipping already existing Teams, the adjustment can be made in:
/usr/lib/python3/dist-packages/univention/office365/microsoft/core.py
+++ modules/univention/office365/microsoft/core.py
@@ -223,6 +223,7 @@ class MSGraphApiCore(object):
expected_status=[
201, # the documented success value is never returned in tests
202, # instead there is 202 if it works
+ 409,
],
)
@@ -247,7 +248,7 @@ class MSGraphApiCore(object):
}
),
headers={'Content-Type': 'application/json'},
- expected_status=[201],
+ expected_status=[201, 409],
)
def modify_team(self, team_id, team):
The described behavior of the connector when creating a Team from a Group, specifically when the Team already exists, and its resulting impact has been documented in this bug report.
