Questions:
Can you share the event viewer error log
A few assumptions:
- Assuming the SharePoint site, site collection and D365 Development Tier-1 environment all are in the same tenant.
- Assuming a Microsoft 365 subscription license is associated with the user account trying to connect to the SharePoint Online site.
You can do the following:
1. Create a site collection in Sharepoint and grant access to both the sharepoint site and the site collection repository. The site collection and the repositories both need to be accessed through the development Tier-1 environments. Ensure you have a site collection administrator
2. With an On-Premise environment, you definitely do an app registration for Dynamics 365 ERP in the app registration section as explained in the blog article shared by Andre. Also, if you are using SharePoint Online you need to update the certificates in your development Tier-1 box along with the Service principal names to facilitate authentication.
3. The most important step is to update web.config with the Service principal ids. If we don't perform this step, the authentication and authorization will fail. (Because the authentication and authorization are from AAD, we need to register the application id, service principal names to facilitate authentication and authorisation to the SharePoint Online site collection).
4. With regards to SharePoint not supported on D365 Development Tier-1 environments the recommendation is to use SharePoint Online instead of On-Premise Sharepoint.
Note:
If you are using heavy files that are large in size then the Document tables (DocuRef tables) run out of space quickly. Ensure you have some jobs to frequently archive or clean up these tables.
The other suggestion you can go with is connect to a Tier-2 environment from a Tier-1 environment, if you are debugging any functionality to test etc.
Hope this helps. Happy to answer questions, if any.