Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Can't miss session! The 9 FabCon and SQLCon takeaways the community can't stop talking about. Join us on April 2nd. Register now

Reply
NuwanAthukorala
Advocate I
Advocate I

Notebook parameters not passing through RunNotebook API call in Microsoft Fabric

Hi everyone,

I’m trying to trigger a Fabric notebook programmatically using the RunNotebook API, but it looks like the parameters I’m sending aren’t being passed into the notebook runtime.

The notebook runs fine when I start it manually in Fabric, but when I trigger it from my API, all the parameters show up empty inside the notebook.

 

I’m calling the following API endpoint:

POST https://api.fabric.microsoft.com/v1/workspaces/<workspaceId>/items/<notebookId>/jobs/instances?jobTy...

 

Here’s a simplified version of my C# code:

 

var payload = new
{
name = $"Add_branch_notebook_{DateTime.UtcNow:yyyyMMdd_HHmmss}",
notebookInputParameters = new[]
{
new { name = "isf_code", value = isfCode },
new { name = "oracle_name", value = oracleName },
new { name = "oracle_code", value = oracleCode }
}
};

 

The request goes through successfully — I get a 200 response, and the notebook starts running.

 

But when I check the parameters inside the notebook using this code:

 

import os

 

isf_code = os.environ.get("isf_code", "")
oracle_name = os.environ.get("oracle_name", "")
oracle_code = os.environ.get("oracle_code", "")

 

print(isf_code, oracle_name, oracle_code)

 

all of them are empty.

If I run the same notebook manually in Fabric and define parameters in the UI (“Run with parameters”), it works perfectly — the values print correctly.
So the issue only happens when running it through the API.

 

I’ve tried

  • Verified the token scope (https://api.fabric.microsoft.com/.default)

  • Double-checked workspace and notebook IDs

  • Tested both of these endpoints:

    • /items/{notebookId}/jobs/instances?jobType=RunNotebook

    • /notebooks/{notebookId}/jobs
      Both run the notebook, but the parameters don’t show up.

  • Tried checking both os.environ and globals() — nothing there.

 

 

Is parameter passing currently supported when triggering a Fabric notebook using the RunNotebook API?

If it is, how are those parameters supposed to be accessed from inside the notebook?
(os.environ, sys.argv, or something else?)

If not yet supported, is this a known limitation or something still being rolled out?

 

Expected behavior

When I send this payload:

{
"name": "Add_branch_notebook_20251010_172200",
"notebookInputParameters": [
{ "name": "isf_code", "value": "ISF001" },
{ "name": "oracle_name", "value": "OracleDB1" },
{ "name": "oracle_code", "value": "ORC123" }
]
}

 

I expect the notebook to receive:

 

isf_code = ISF001
oracle_name = OracleDB1
oracle_code = ORC123

 

But instead, I’m getting all empty values.

 

Would really appreciate it if someone from the Fabric team or anyone who has successfully passed parameters to a notebook through the API can confirm how this is supposed to work (or if it’s not supported yet).

2 ACCEPTED SOLUTIONS
KNP
Super User
Super User

I'm not sure specifically about the API, but do you have a parameter cell in your notebook?

https://learn.microsoft.com/en-us/fabric/data-engineering/author-execute-notebook#designate-a-parame... 

KNP_0-1760310617017.png

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

View solution in original post

DaleT
Resolver II
Resolver II

Hi,

I tried this API using Postman successfully. The main differences with yours are the request body that shows below. And also according to the doc https://learn.microsoft.com/en-us/fabric/data-engineering/notebook-public-api#run-a-notebook-on-dema... , the status code is 202.

{
    "executionData": {
        "parameters": {
            "p_a": {
                "value": "I sent it 321",
                "type": "string"
            }
        }
    }
}

DaleT_0-1760316353606.png

 

View solution in original post

2 REPLIES 2
DaleT
Resolver II
Resolver II

Hi,

I tried this API using Postman successfully. The main differences with yours are the request body that shows below. And also according to the doc https://learn.microsoft.com/en-us/fabric/data-engineering/notebook-public-api#run-a-notebook-on-dema... , the status code is 202.

{
    "executionData": {
        "parameters": {
            "p_a": {
                "value": "I sent it 321",
                "type": "string"
            }
        }
    }
}

DaleT_0-1760316353606.png

 

KNP
Super User
Super User

I'm not sure specifically about the API, but do you have a parameter cell in your notebook?

https://learn.microsoft.com/en-us/fabric/data-engineering/author-execute-notebook#designate-a-parame... 

KNP_0-1760310617017.png

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Fabric Update Carousel

Fabric Monthly Update - March 2026

Check out the March 2026 Fabric update to learn about new features.

Top Kudoed Authors