The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, i use msgraph in notebooks in Fabric.
I have a Fabric environment : 1.2 (Spark 3.4, Delta 2.4) with libraries azure-identity and msgraph
everything works fine.
When I duplicate this environement (the reason is I need to move the environment to another workspace) and change my notebook to use this new seemingly identical environment, i now get the following error :
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)
I tried the following, but to no success :
https://community.fabric.microsoft.com/t5/Fabric-platform/Using-msggraph-sdk-in-Fabric-notebooks/m-p...
Any idea why it's happening when my notebooks are connected to one Fabric environment but not when connected to the other one that's identical?
Also, any ideas on how to solve it? Do I need to authorize the new environment or something? I don't remember doing it for the old environment but not 100% sure.
Any help would be appreciated! Thanks!
Solved! Go to Solution.
Ok so the solution for me was :
This seems to do the trick!
Thanks again everyone for the help.
Ok so the solution for me was :
This seems to do the trick!
Thanks again everyone for the help.
Hi @renaudjmathieu , Thank you for reaching out to the Microsoft Community Forum.
Please let us know if your issue is solved. If it is, consider marking the answer 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
Thank you.
Hi @renaudjmathieu, thank you for reaching out to the Microsoft Fabric Community Forum.
Please check & try the following:
We sincerely appreciate your continued support within the community and thank you for your dedicated efforts in resolving issues @nilendraFabric.
If this helps, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details.
Thank you.
Hi, thanks for the answer!
the problem is not solve but I may have some clues now. I think its related to "python-dotenv"
Both environment are in the same workspace.
I tried and retried creating a new environment and I always get the same error.
The new environments I created use the same Public Libraries as the old one, and I compared Built-in Libraries and they are the exact same.
I used "!pip list" to compare packages and it looks like new envionments are created with "python-dotenv" whereas the old, working environment didn't include it.
It's probably related to this? Still looking into it..
Hi @renaudjmathieu , thank you for reaching out to the Microsoft Fabric Community Forum.
Sorry to know it didn’t help you. If the new environment includes python-dotenv while the old one does not, it's likely that python-dotenv is interfering with the SSL configuration or environment variable loading.
Please check the following:
import dotenv
print(dotenv.find_dotenv()) # Check if a .env file is being loaded
print(dotenv.load_dotenv()) # See if it's modifying environment variables
*If a .env file is present, inspect its contents to ensure it’s not altering SSL-related settings.
!pip uninstall -y python-dotenv
import os
os.environ["SSL_CERT_FILE"] = "/home/trusted-service-user/cluster-env/clonedenv/ssl/cert.pem"
os.environ["SSL_CERT_DIR"] = "/home/trusted-service-user/cluster-env/clonedenv/ssl/certs"
If this helps, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details.
Thank you.
Hi! Thanks again for pointing me in the right direction!
It seems dotenv gets install automatically when I include more recent versions of the msgraph-core/msgraph-sdk librairies
I'm still investigating the exact cause of this and will also try to explicitly set the SSL certificate paths like you suggested, if need be.
I will update this ticket once I'm done.
Thanks again! Have a good day
Hi , Thank you for reaching out to the Microsoft Community Forum.
Happy to help. Thanks for the update. Please share the insights here once it is solved, which will help others with similar queries.
Have a great day. Hope your issue’s solved soon.
Also, please consider marking the answer 'Accept as Solution' so others with similar queries may find it more easily.
Thank you.
Hi, thanks for the help.
in both cases, the old working environment and the new one, the ssl.get_default_verify_paths() is the same :
DefaultVerifyPaths(cafile='/home/trusted-service-user/cluster-env/clonedenv/ssl/cert.pem', capath=None,
openssl_cafile_env='SSL_CERT_FILE', openssl_cafile='/home/trusted-service-user/cluster-env/clonedenv/ssl/cert.pem',
openssl_capath_env='SSL_CERT_DIR', openssl_capath='/home/trusted-service-user/cluster-env/clonedenv/ssl/certs')
sadly, setting the environment variables as described above, and restarting the session, does not seem to help. I get the same error.
Try these
Check Python’s default certificate path
import ssl
print(ssl.get_default_verify_paths())
Set Environment Variables (as suggested in community discussions):
import os
os.environ["SSL_CERT_DIR"] = "/etc/pki/ca-trust/extracted/openssl:/opt/olcclient"
User | Count |
---|---|
19 | |
13 | |
6 | |
3 | |
3 |
User | Count |
---|---|
48 | |
25 | |
12 | |
11 | |
11 |