We are getting error "Error during upload" when uploading a file that is configured to save files to SharePoint Online. This is on latest Microsoft Dynamics AX 2012 R3.
We have document management enabled, we are currently saving files to a local folder on the AOS server but now want to save files to our online sharepoint library in O365.
- I created the following folder AXTest in sharepoint, and granted the AX service account access to the sharepoint team.

2. I set Archive directory appropriately. I tried various veresions of the URL, which were all unsuccessful. And under document management, authentication type = "SharePoint Online"

3. All result in an error when trying to upload a file that is local to the AOS server - "Error during upload"
4. Debugging those the error is raised here:

5. There is no exception stack so I don't know the exact reason why, but we tried various versions of the URL, we tried uploading a file locally, and we know the service account has access to the sharepoint site/team.
Any suggestions/ideas?