Forum Discussion

hcaballero's avatar
hcaballero
Regular Visitor
5 months ago
Solved

Dataflow Gen2 refresh via Service Principal returns SPNBasedRefreshNotAllowed even though Fabric RES

We are investigating a Microsoft Fabric Dataflow Gen2 execution scenario and would like to confirm whether the current behavior is expected or if there is a supported workaround.

## Scenario

We migrated a refresh process from classic Power BI Dataflows to Dataflow Gen2.
The execution is performed using a Service Principal.

## What we validated

- The Service Principal can successfully obtain a Fabric token using:
  with scope:

- The Service Principal is:
  - Admin of the workspace
  - Included in the tenant setting group for `Service principals can call Fabric public APIs`
  - Running against a workspace hosted on Fabric capacity

- Fabric REST read calls work correctly:
  `GET /v1/workspaces/{workspaceId}/dataflows`
  successfully returns the Dataflow Gen2 item.

- The Dataflow exists and is visible through Fabric REST:
  - `workspaceId`: `66271d22-1f8b-4d0d-90d3-504e4de02640`
  - `dataflowId`: `b2ba3796-a22c-4392-bb7a-369ac2697ba9`
  - `displayName`: `CollectionTarget`

## What happens when we try to run it

- `POST` to:
  `/v1/workspaces/{workspaceId}/items/{itemId}/jobs/DefaultJob/instances`
  returns:
  `InvalidJobType`

- `POST` to:
  `/v1/workspaces/{workspaceId}/items/{itemId}/jobs/Execute/instances`
  returns:
  `202 Accepted`

This indicates that `Execute` appears to be the correct job type for this Dataflow Gen2 item.

However, once the execution starts, the Dataflow fails in the service with this error:

`There was a problem refreshing the dataflow: "SPN based refresh is not allowed for the dataflow with id b2ba3796-a22c-4392-bb7a-369ac2697ba9.". Error code: SPNBasedRefreshNotAllowed.`

## Questions

1. Can Microsoft confirm whether Dataflow Gen2 execution or refresh using a Service Principal is currently unsupported by design?
2. Is there any supported workaround?
3. Is Workspace Identity supported for this scenario?
4. Is there any roadmap or ETA for SPN-based refresh support for Dataflow Gen2?

This is important for CI/CD and production automation, because we need non-interactive execution without depending on a user identity.

Thanks.

2 Replies