Forum Discussion

RonaldBalza-943's avatar
1 year ago
Solved

Microsoft Fabric API - Update Lakehouse delta table

Hi beautiful people,

I'm working on an application to update a Lakehouse Delta table in Microsoft Fabric. My app needs to take source system credentials and write them to the Lakehouse.

I've already:

  • Added the Service Principal to the workspace.
  • Granted the necessary API permissions in Azure.

Could you please advise on any other considerations for using the Microsoft Fabric APIs to update Lakehouse Delta tables? Am I missing anything crucial? Thanking in advance 🙂

  • Hi RonaldBalza-943 ,

    Thanks for posting in Microsoft Fabric Community.

    When building an application to update a Lakehouse Delta table using a Service Principal, it’s important to note that Microsoft Fabric does not currently support direct insert, update, or delete operations on Delta tables through REST APIs.

     

    A supported method is to first upload data files such as CSV or Parquet into the Lakehouse Files section. After that, the Load to Tables API can be used to ingest the data into a Delta table. This is an asynchronous operation, and the load status can be tracked via the operation ID returned.

     

    Another approach is to trigger a Spark notebook using the Notebook Public API. The notebook can perform necessary transformations using PySpark and write the results to the Delta table using standard Spark operations such as merge, overwrite, or append modes.

     

    Ensure that the Service Principal has the Contributor role at the workspace level and sufficient permissions on the Lakehouse and its schemas.

     

    For a broader overview of managing Lakehouse assets via API, refer to Managing Lakehouse using Fabric APIs.

     

    The following threads may be helpful:

    Hope this helps. Please reach out for further assistance.
    If this post helps, then please consider to give a kudos and Accept as the solution to help the other members find it more quickly.


    Thank you.

     

     

2 Replies

  • v-veshwara-msft's avatar
    v-veshwara-msft
    Icon for Community Support rankCommunity Support

    Hi RonaldBalza-943 ,

    Thanks for posting in Microsoft Fabric Community.

    When building an application to update a Lakehouse Delta table using a Service Principal, it’s important to note that Microsoft Fabric does not currently support direct insert, update, or delete operations on Delta tables through REST APIs.

     

    A supported method is to first upload data files such as CSV or Parquet into the Lakehouse Files section. After that, the Load to Tables API can be used to ingest the data into a Delta table. This is an asynchronous operation, and the load status can be tracked via the operation ID returned.

     

    Another approach is to trigger a Spark notebook using the Notebook Public API. The notebook can perform necessary transformations using PySpark and write the results to the Delta table using standard Spark operations such as merge, overwrite, or append modes.

     

    Ensure that the Service Principal has the Contributor role at the workspace level and sufficient permissions on the Lakehouse and its schemas.

     

    For a broader overview of managing Lakehouse assets via API, refer to Managing Lakehouse using Fabric APIs.

     

    The following threads may be helpful:

    Hope this helps. Please reach out for further assistance.
    If this post helps, then please consider to give a kudos and Accept as the solution to help the other members find it more quickly.


    Thank you.