Azure Data Factory Writing to Business Central Purchase Header and Purchase Lines

Kayode Ogidan 90 Reputation points
2024-07-24T13:59:56.7166667+00:00

Hello @Harishga

I am working on posting data to Business Central using ADF from CSV files to Purchase Header and Purchase Lines tables. I am having the following error on trying to post the data. The sink is a REST. I have checked my permissions on the Purchase Header table and also installed the .app file in the extension management in Business Central. Please can you assist on this?
Job failed due to reason: Error response from server: Some({"error":{"code":"Internal_ServerError","message":"Sorry, the current permissions prevented the action. (TableData 5109 Purchase Header Archive Read: Base Application) CorrelationId: 859d9c85-c363-4efd-832e-d8817b3e1169."}}), Status code: 403. Please check your request url and body. (url:https://api.businesscentral.dynamics.com/v2.0/be8cd747-0b4b-4f5f-91d5-2c9b3a1b770d/SandboxDev05_14_2024/ODataV4/Company('Med%20for%20America%20Inc')/PurchaseHeader,request body: Some({"DocumentType":"Invoice","BuyfromVendorName":"Order.co","BuyfromVendorNo":"V03515","Vendor_Invoice_No":"389901"}), request method: POST)

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,672 questions
0 comments No comments
{count} votes

Accepted answer
  1. Chandra Boorla 14,685 Reputation points Microsoft External Staff Moderator
    2024-07-25T06:57:53.2633333+00:00

    Hi @Kayode Ogidan

    Thanks for the question and using MS Q&A platform.

    As I understand that you are trying to use Azure Data Factory to automate the process of posting data from a CSV file to the Purchase Header and Purchase Lines tables in your Dynamics 365 Business Central environment. You have configured an ADF pipeline with a REST sink that uses an API call to write data to Business Central. However, you are receiving a 403 Forbidden error, indicating a permissions issue.

    Based on the error message - "Sorry, the current permissions prevented the action. (TableData 5109 Purchase Header Archive Read: Base Application)" This part of the message is crucial and explains that the user or application making the request (ADF in this case) doesn't have the necessary permissions to create a new record in the Purchase Header table.

    • Check the permissions for your user account in Business Central. Ensure that you have the necessary permissions, and they are correctly set. For additional information please refer: Permissions on Database Objects.

    Here are few additional troubleshooting steps that might help you in resolving your query:

    Extension Installation: Although you mentioned installing the .app file, it's possible that the extension is not properly installed or configured, leading to permissions issues. Sometimes, re-publishing the extension can resolve permission issues.

    Authentication: Ensure that the authentication method you are using in ADF is correctly configured. If you are using OAuth, make sure the token has the necessary scopes to access the Business Central API.

    For more details please refer: Troubleshooting web service errors.

    I hope this information helps! Please do let us know if you have any further questions.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.