Forum Discussion
Reference current workspace with notebook without Spark
- 1 year ago
As far as I can tell it's impossible to write data to the Tables section of a datalake without starting a Spark session, so this approach will not work.
Hi DCELL ,
Thanks for the follow-up question
Here's a simple guide to help you set up and use a .json config file in your Fabric notebook (non-Spark) to make your workflows dynamic and environment-aware:
Step-by-Step: Using a config.json in Fabric (Pandas) Notebook
Create the config.json file
Place it in your Lakehouse Files/ area (e.g., Files/config/config.json). Example contents:
{
"lakehouse_name": "SalesLakehouse",
"environment": "dev",
"data_path": "Tables/sales_data",
"region": "East US"
}
Load the JSON in your notebook using Pandas or built-in file APIs
import json
config_path = "Files/config/config.json"
with open(config_path, "r") as f:
config = json.load(f)
print(config["lakehouse_name"])
If reading directly from the Lakehouse via Pandas:
import pandas as pd
import json
with open("/lakehouse/default/Files/config/config.json", "r") as f:
config = json.load(f)
print(config["environment"])
Use config values in your logic
data_path = config["data_path"]
region = config["region"]
Solved: Parameterizing a notebook - Microsoft Fabric Community
Develop, execute, and manage notebooks - Microsoft Fabric | Microsoft Learn
Best Regards,
LakshmiNarayana
As far as I can tell it's impossible to write data to the Tables section of a datalake without starting a Spark session, so this approach will not work.
- v-lgarikapat1 year agoCommunity Support
DCELL ,
Thanks for the clarification really appreciate the detailed explanation. That clears things up
Best Regards
Lakshmi Narayana