After site deletion and re-creation: got "old" site IDs back from Microsoft Graph - why?
![](https://techprofile.blob.core.windows.net/images/fHkApv5_AwAAAAAAAAAAAA.png?8D9144)
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.
Picture 2 - this is MS Graph returning a different site ID and lastModificationDateTime - for the same site:
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?