SharePoint Online – Time interval where Delete Sites are completly deleted

Bechir 41 Reputation points
2021-04-16T12:08:02.753+00:00

Hi Microsoft SharePoint Online Community

In one of our process we are deleting a site collection from "Active Sites" than permanently deleting from "Deleted Sites" based on the "SharePoint Admin Center".

Just After deleting the site from "Deleted Sites" we are creating the same site again with same title, users, groups and some custom actions. All these actions are REST API and CSOM based.

The site creation process works fine, the problem what we are getting, is that the process is often failing, and it is failing in different stages when we try to reproduce the scenario.

Here are some REST API logs:
Microsoft.SharePoint.Client.ServerException: Cannot get site https://XXXXX.sharepoint.com/sites/XXX
Error while setting the site https://XXXXX.sharepoint.com/sites/XXX as Read Only in SharePoint Online
Microsoft.SharePoint.Client.ServerException: The object id "site:fa9e246a-523e-4d3d-a769-2d1e18057cca:web:4dcb967c-9a5e-4367-bc0e-d3cf7a49da75" is invalid

But some how, if we wait for some X time, the site creation process is working fine.

My Feeling that the site deletion in background is not 100% done after deleting the site from "Deleted Sites", it could be that there is some naming conflicts are there....

As we are in SharePoint Online is hard to truck some kind of actions. that is why I am asking here, if somebody could validate my theorie and give us some advice.

Thank you in advance

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,028 questions
No comments
{count} votes

Accepted answer
  1. Allen Xu_MSFT 13,511 Reputation points
    2021-04-19T06:16:15.49+00:00

    Hi @Bechir ,

    Yes, your feeling is totally right. There are some timer jobs in the backend to control the site deletion process like what is in SharePoint on-premise. The difference is that we can manage those timer jobs in SharePoint on-premise, however, in SharePoint Online, there is no way to force the timer job execution or any kind of workaround, since we don’t have control of backend timer jobs which is managed by Microsoft.

    As per my experience, it might take up to 24 hours for the completion of site deletion process. So, just be patient and recreate the site 24 hours after deleting it.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    No comments

1 additional answer

Sort by: Most helpful
  1. Bechir 41 Reputation points
    2021-04-19T08:20:30.907+00:00

    Thank you for your Feedback

    No comments