After site deletion and re-creation: got "old" site IDs back from Microsoft Graph - why?

Heinrich Ulbricht 11 Reputation points
2021-05-11T07:27:49.12+00:00

We got stale site IDs for re-created sites. This is unexpected and I wonder if we did something wrong or - if not - how this can be explained.

Here's what we did:

  • created a SharePoint site (using MS Graph)
  • later deleted it using the browser UI, also removed it from the recycle bin
  • re-created the site using the same URL - which succeeded (using MS Graph again)
  • later deleted it again, using the browser UI
  • re-created a third time using the same URL - which also succeeded

Why did we do this? We used PnP provisioning to apply a provisioning template to this site - and this failed with a weird exception that the site couldn't be found. Despite being connected to it.

I went to investigate and used MS Graph Explorer to request information about the troublesome site. This is the endpoint I used to query for the site:

https://graph.microsoft.com/v1.0/sites/<tenant>.sharepoint.com:/sites/43295  

I clicked on Graph Explorer's "Run query" button multiple times in row. My expectation would be to get back the same site information every time I click. But the site ID changed for some requests. This is unexpected.

Here are two screenshots that I took over the course of a couple of seconds showing the effect:

Picture 1 - this is MS Graph returning site information, including site ID and lastModificationDateTime.

95416-image.png

Picture 2 - this is MS Graph returning a different site ID and lastModificationDateTime - for the same site:

95458-image.png

Both for the same URL. Further tests sometimes also returned a third site ID which I assume is the very first one (we deleted twice, created thrice). And the IDs kept coming randomly on each click with the current one appearing more often than the older ones.

After some hours of mulling the effect disappeared. If I now query MS Graph I only get back one site ID. Also the PnP provisioning succeeds. (It turned out it had tried to work with one of the "old" site IDs and had failed.)

So what's up with MS Graph? How can it happen that I get back different site IDs for an identical URL within seconds?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,265 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,784 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,594 questions
{count} votes