March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi !
I'm trying to use the msgraph sdk in Fabric notebook, but I'm facing an SSL issue.
import asyncio
import msal
from azure.identity.aio import ClientSecretCredential
from azure.identity import DeviceCodeCredential
client_secret="AAA"
client_id = "BBB"
tenant_id = "CCC"
credential = ClientSecretCredential(tenant_id,client_id,client_secret)
scopes = ['https://graph.microsoft.com/.default']
from msgraph import GraphServiceClient
client = GraphServiceClient(credentials=credential, scopes=scopes)
async def get_user():
user = await client.users.by_user_id('myUPN').get()
if user:
print(user.display_name)
await get_user()
Solved! Go to Solution.
Thank you for your answer.
The simpliest way is to add those 3 lines :
import certifi
import os
os.environ['SSL_CERT_FILE'] = certifi.where()
Jérôme
Thank you for your answer.
The simpliest way is to add those 3 lines :
import certifi
import os
os.environ['SSL_CERT_FILE'] = certifi.where()
Jérôme
Hi @jFloury ,
Thank you for joining us on the Microsoft Fabric Community Forum.
This error happens because Python can't verify the SSL certificate for the Microsoft Graph API. Basically, it can't find a valid root certificate in your local certificate store. This issue is quite common in custom or isolated environments that don't automatically install root certificates.
If my answer addressed your query, kindly mark it as the Accepted Solution to assist others.
I'd also be grateful for a 'Kudos' if you found my response useful!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
7 | |
6 | |
5 | |
2 | |
1 |
User | Count |
---|---|
15 | |
10 | |
5 | |
4 | |
4 |