Forum Discussion

gshapiev's avatar
gshapiev
Frequent Visitor
10 months ago
Solved

REST API. jobs/instances?jobType=Refresh causes error while manual refresh works

Trying to refresh Dataflow Gen2 (CI/CD) dataflow using Rest API

 

Getting error on the service side:

There was a problem refreshing the dataflow: 'Exception encountered in GetPublishStatusAsync: Response status code does not indicate success: 404 (Not Found)..'. Error code: . (Request ID: 00000000-0000-0000-0000-000000000000).

 

When initiating run in the workspace Everything runs fine.

 

What could be the problem? Am I missing something?

  • The problem was with permissions. Was trying to refresh with service principal which is not supported at the moment

     

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi gshapiev,

     

    Thank you for reaching out to the Microsoft Fabric Forum Community.

     

    The error happens because you’re trying to refresh a Dataflow Gen2 with the old Power BI REST API, which only supports Gen1 dataflows. That’s why the call returns 404 Not Found, even though the refresh works fine inside the workspace. The fix is to use the Fabric REST API instead of the Power BI API, make sure you use the correct workspace ID and item ID from Fabric, and authenticate with the Fabric scope. With the right endpoint, IDs, and permissions, the refresh will work as expected.

     

    Thanks & Regards,

    Prasanna Kumar

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi gshapiev,

     

    When you sync changes from Git into the workspace or use deployment pipelines, you need to open the new or updated dataflow and save changes manually with the editor. This triggers a publish action in the background to allow the changes to be used during refresh of your dataflow. You can also use the on-demand Dataflow publish job API call to automate the publish operation and then refresh.

     

    document where limitation is noted : https://learn.microsoft.com/en-us/fabric/data-factory/dataflow-gen2-cicd-and-git-integration

     

    Publish Job API Endpoint : POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/dataflows/{dataflowId}/jobs/instances?jobType=Publish

     

    Thanks & Regards,

    Prasanna Kumar

     

    • gshapiev's avatar
      gshapiev
      Frequent Visitor

      1. Publish method doesn't exist anymore:

      {
          "requestId": "cfb9aff5-00fa-4d4a-90d6-7e2a4e14f40c",
          "errorCode": "InvalidJobType",
          "message": "The requested job type is invalid"
      }
       
      2. It is replaced with ApplyChanges. When calling it getting error in responce. Not very informative:
      {
          "id": "7f6ca2fb-5dda-4c64-bc1d-ada29e2dd093",
          "itemId": "15cacd88-df9d-447a-9caa-b17cdb87af6d",
          "jobType": "Publish",
          "invokeType": "Manual",
          "status": "Failed",
          "failureReason": {
              "requestId": "b5155ec5-6584-4580-a337-5c80b4f6868a",
              "errorCode": "JobInstanceStatusFailed",
              "message": "Job instance failed without detail error"
          },
          "rootActivityId": "36db2346-20a5-4b89-95bc-d2b44021b06b",
          "startTimeUtc": "2025-09-23T13:21:50.9036366",
          "endTimeUtc": "2025-09-23T13:21:50.9036366"
      }
       
      3. I tried to publishing it manually. Error in the topic starter is happening after that. Can refresh manually bit with refreshing through api getting similar message and that error on the service side
       
      Thank you
       
  • gshapiev's avatar
    gshapiev
    Frequent Visitor

    The problem was with permissions. Was trying to refresh with service principal which is not supported at the moment

     

    • gshapiev's avatar
      gshapiev
      Frequent Visitor

      I was authenticating with Service Principal, which was(is?) not supported. Had to create Delegated Auth Token with actual user.