Forum Discussion
Error 21503 using REST connector for a copy activity -
- Anonymous11 months ago
Hi pmscorca,
Since Organizational account is not available in the dropdown for Web connection, Need to switch from using a Web connection to a REST connector configured with supported authentication types.
By follwoing bellow steps yo can try to achive this.Option 1: Use Service Principal
This is the most reliable workaround. Go to Azure Portal and register an app.
Generate - Client ID - Client Secret - Tenant ID
Assign necessary API permissions to the app for Business Central.
In Fabric, create a new REST connection using.Authentication type: Service Principal - Provide the above credentials and use this connection in your copy activity.
This avoids the OAuth2 limitation and works seamlessly with Business Central’s API.
Option 2: Use Organizational Account via Dataflow Gen2
If it insists on using Organizational account, You needs to use Dataflow Gen2 instead of a copy activity and in Dataflow Gen2, the Organizational account option is available and supported for Business Central by Authenticate using Azure AD credentials and pull the data.
If still wants to use Power BI Desktop to test the connection.
- Connect to Business Central via OData connector.
- Copy the M code from Power Query.
- Paste it into a blank query in Dataflow Gen2 in Fabric
Thanks,
Akhil.
Hi pmscorca,
The error comes because the REST connector does not support generic OAuth2.
Instead, when connecting to Business Central you need to use either:
- Organizational account (your Azure AD login), or
- Service principal (client ID + secret).
So just recreate the connection and choose Organizational account or Service principal instead of OAuth2 that will resolve error 21503.
Regards,
Akhil.
Hi, in Manage Connections respect to the Web connection type I cannot select the Organizational account as an authentication method.
Thanks
- Anonymous11 months agoNot applicable
Hi pmscorca,
Since Organizational account is not available in the dropdown for Web connection, Need to switch from using a Web connection to a REST connector configured with supported authentication types.
By follwoing bellow steps yo can try to achive this.Option 1: Use Service Principal
This is the most reliable workaround. Go to Azure Portal and register an app.
Generate - Client ID - Client Secret - Tenant ID
Assign necessary API permissions to the app for Business Central.
In Fabric, create a new REST connection using.Authentication type: Service Principal - Provide the above credentials and use this connection in your copy activity.
This avoids the OAuth2 limitation and works seamlessly with Business Central’s API.
Option 2: Use Organizational Account via Dataflow Gen2
If it insists on using Organizational account, You needs to use Dataflow Gen2 instead of a copy activity and in Dataflow Gen2, the Organizational account option is available and supported for Business Central by Authenticate using Azure AD credentials and pull the data.
If still wants to use Power BI Desktop to test the connection.
- Connect to Business Central via OData connector.
- Copy the M code from Power Query.
- Paste it into a blank query in Dataflow Gen2 in Fabric
Thanks,
Akhil.