The error you're seeing "The calling application is enrolled in logical permissions and is not permitted to call this API. Please work with ODSP Auth team: aka.ms/ODSPS2SAuthOnboarding" is a SharePoint/OneDrive authentication error that occurs when the Excel Online (Business) connector tries to access your SharePoint library using app-level (Service-to-Service) authentication, but the tenant policy blocks it.
This is a known issue that tends to surface suddenly even when a flow was working before, usually triggered by a policy change in your Microsoft 365 tenant, a connector credential refresh, or a recent Microsoft platform update.
Here's what you should try to fix it:
1. Delete and re-add the Excel Online (Business) connection
Go to Power Automate → Data → Connections, find your Excel Online (Business) connection, delete it, and create a new one by signing in fresh. Then re-authenticate all steps in your flow that use that connection. This often resolves stale token or permission issues.
2. Check Office Scripts admin settings
In Microsoft 365 Admin Center → Settings → Org settings → Office Scripts, make sure both of these options are enabled:
- Let users automate their tasks in Excel
- Let users with access to Office Scripts run their scripts with Power Automate
If either was recently toggled off (even accidentally), it would break existing flows immediately.
3. Re-share the script file with necessary permissions
Ensure the account used by the flow connection has Edit access to the SharePoint library where the .osts script file is stored — not just the Excel workbook. The "Run script from SharePoint library" action needs access to both the script file and the workbook.
​
4. Re-save the flow and re-select the script
Sometimes the dynamic reference to the script breaks when the file path changes or the library is reorganized. Open the Run script from SharePoint library step, clear the Script field, and re-browse and select the .osts file again, then save the flow.
​
5. If the issue persists contact your tenant admin
The ODSPS2SAuthOnboarding error specifically means your tenant may have enabled ODSP S2S Auth restrictions, which is a security feature that limits which apps can access SharePoint via service accounts. Your Microsoft 365 or SharePoint admin would need to check whether the Power Automate Excel Online connector is allowlisted under this policy. The link in the error (aka.ms/ODSPS2SAuthOnboarding) has the onboarding steps for the admin.
​
If it helps kindly accept the answer.
Best Regards,
Jerald Felix