Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Can databricks notebook return the current UPN (equiavalent DAX USERPRINCIPALNAME())?
select current_user()
returns
trusted-service-user which is not useable.
I need it to return the following
john.doe@company.com
Solved! Go to Solution.
mssparkutils.env.getUser
Have you tried this
user = dbutils.notebook.entry_point.getDbutils().notebook().getContext().userName().get()
print(user)
sorry, I meant fabric notebook and not databricks notebook
Fabric Notebooks execute under a service identity rather than the context of an individual user.
thats why When you run a statement such as `select current_user()`, the output is the service account (“trusted-service-user”) rather than the individual’s email address
This is a known limitation which has been discussed here in forum and enhancements to be made to the mssparkutils package.
mssparkutils.env.getUser
Thanks for sharing this. I haven't tried this 🙂
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Fabric update to learn about new features.
| User | Count |
|---|---|
| 24 | |
| 5 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 57 | |
| 13 | |
| 10 | |
| 9 | |
| 8 |