This week I was struggling with an OnPrem installation of Business Central, Oauth2 and SharePoint Online. It was hard to find any documentation of it. Maybe you already know how it work. But if not here is some documentation of it 😀.
As always if you are running Business Central Online it is much easier to integrate with (just follow the Excel Add-in Centralized Deployment assisted setup).
I think everybody is well know about the feature “Export to Excel” and “Open in Excel” in Business Central. And if you click on it in Business Central it is perfeclty downloaded the page into Excel (it gives you a download). But what if you want to put it on an SharePoint Online tenant. For that you must go to the “Microsoft SharePoint Connection Setup”:
- “Document Repository”
- “User Name”
The Excel will go into your personal OneDrive folder. So in this case you can only access and not the whole organisation.
But if you want it for the whole organisation you have to fill in “Document Repository” and “User Name” (here is a validation with the field “Authentication E-mail” from your user) and the excel file will be uploaded in your SharePoint tenant:
But how do you setup Oauth2 for SharePoint Online?
In the tab “Authentication” (this tab is only visible if you are onprem) you can put your “Client Id” and “Client Secret”.
Just go to your Azure Portal, create an application and assign the following “API permissions”:
Fill these values in Business Central and you are connected with SharePoint Online from an Business Central Onprem installation 👍.