Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Write to Virtual Tables in Dataverse Connected to Business Central #472

Open
alwill opened this issue Oct 4, 2024 · 1 comment
Labels
question Further information is requested

Comments

@alwill
Copy link

alwill commented Oct 4, 2024

Description:
We are attempting to programmatically write data to the Customer and Company virtual tables that are connected to Business Central. These virtual tables reside in Dataverse and function correctly when accessed directly through the PowerApps portal at https://make.powerapps.com/.

However, when using our connection string in the C# application to connect to Dataverse, we are unable to write to these virtual tables.

Notably:
We can write data to other Dataverse tables.
We cannot write to the virtual tables associated with Business Central.
It seems that the authentication token generated by ServiceClient might not be receiving the necessary scope to write to Business Central tables.

What We've Tried:
We verified that the Azure App Registration has appropriate API permissions for both Dynamics 365 and Business Central.
The issue appears to be specific to virtual tables, as other Dataverse tables are not affected.

Error:
Message: Microsoft.OData.Client.DataServiceQueryException: An error occurred while processing this request. ---> Microsoft.OData.Client.DataServiceClientException: {"error":{"code":"Authentication_InvalidCredentials","message":"The server has rejected the client credentials. }} ---> Microsoft.OData.ODataErrorException: An error was read from the payload. See the 'Error' property for more details.

Question:
Is this behavior expected? Does ServiceClient support writing to virtual tables connected to Business Central, or are additional configuration steps needed for the token to include the required scope?

@MattB-msft
Copy link
Member

@alwill

Are you using a User Interactive flow to create the connection? or are using a non-interactive flow to create the connection?
Most Virtual Tables to other Dynamics Products require User Tokens and will not work with Service Principal tokens.

@MattB-msft MattB-msft added the question Further information is requested label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants