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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
floody
Regular Visitor

Notebook possbile to use mTLS as Auth to API Service

Hi everyone,

 

I am currently looking into options to ingest data from a external service via their API.

 

The API uses mTLS client certificates and private keys for Auth and was wondering what is the possibilities of using this auth method within Fabric Notebook using Python.

 

For testing purposes tried to upload the pem files to OneLake storage and reference them via "abfss" path and then use them in the request, but I get errors (OSError: Could not find the TLS certificate file, invalid path) so I assume something needs to be setup/configured differently.

 

cert = ('path/to/client/cert', 'path/to/client/key')
response = requests.get(url, cert=cert)

 

Hope someone can advise.

 

Cheers

1 ACCEPTED SOLUTION

Thanks Richard, I tried both, but no joy.

 

But what did work was using notebookutils e.g.

path = notebookutils.fs.getMountPath("/test")

 

https://learn.microsoft.com/en-us/fabric/data-engineering/notebook-utilities#access-files-under-the-...

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @floody,

I'd like to suggest you try to use azure key vault to manage these credentials and you can use correspond libraries to invoke them from notebook python code:

Solved: Access Key-vault in notebooks - Microsoft Fabric Community

Accessing Azure Key Vault Secrets from Fabric Notebooks

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thanks! and yes, once we have Key Vault setup this will be the way to go for sure.

richbenmintz
Solution Sage
Solution Sage

Have you tried with the File API Path and or the or the realtive path for pyspark



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Thanks Richard, I tried both, but no joy.

 

But what did work was using notebookutils e.g.

path = notebookutils.fs.getMountPath("/test")

 

https://learn.microsoft.com/en-us/fabric/data-engineering/notebook-utilities#access-files-under-the-...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

JanFabricDE_carousel

Fabric Monthly Update - January 2025

Explore the power of Python Notebooks in Fabric!

JanFabricDW_carousel

Fabric Monthly Update - January 2025

Unlock the latest Fabric Data Warehouse upgrades!