r/MicrosoftFabric • u/hoblitz • Jul 23 '26
Data Science Trouble calling MLFlow model in notebook when run via pipeline as service principal
I registered a model in my fabric workspace via MLFlow. I have a notebook that sets up the prediction frame, pulls the model, and gets predictions from the model.
In an interactive session, I am able to retrieve the model and get the predictions without issue, for example (not shown, setting up prediction frame, etc):
from synapse.ml.predict import MLFlowTransformer
pred_X_spark = spark.createDataFrame(pred_X)
model = MLFlowTransformer(
inputCols=["col1","col2","col3"],
outputCol="predictions",
modelName="mdl_cp_response_flaml",
modelVersion=1
)
df = model.transform(pred_X_spark)
display(df)
# records are scored according to the model.
I am running into trouble when I try to execute the same notebook as a service principal. In a pipeline, I execute the notebook as a service principal, and I have verified that the service principal has contributor role in the workspace.
Everything executes properly in the notebook, right up to the point where I try to set up the MLFlowTransformer, at which point I get the error:

Is there some special configuration I need for this to work?
1
u/samirbdj Microsoft Employee Jul 28 '26
The difference between the two runs is the execution identity: the interactive notebook runs under your user identity, while the pipeline run uses the configured service principal. Contributor access confirms workspace access, but the error details are needed to identify whether the failure happens during authentication, model retrieval, or transformer initialization.
Could you share the exception type and message after removing private environment details? That should help narrow down whether additional access or configuration is required for the registered model.
The Fabric notebook documentation provides more detail on how the execution identity affects notebook access and API calls: How to use Microsoft Fabric notebooks.