Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
When accessing to Azure Open AI Service with openai==1.61 from Microsoft Fabric notebook, I get the error below.
ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)
APIConnectionError: Connection error.
You can reproduce the issue with the code below.
%pip install -U openai
from pyspark.sql import Row
from synapse.ml.services.openai import OpenAIChatCompletion
from openai import AzureOpenAI
def get_response(question):
prompt = f"""
Please answer the questions based on the following information.
"""
messages = [{'role': 'system', 'content': prompt}, {'role': 'user', 'content': question}]
aoai_client = AzureOpenAI(
api_key = "<api_key>",
api_version = "2024-02-01",
azure_endpoint = "https://<azure_open_ai_service>.openai.azure.com/"
)
result = aoai_client.chat.completions.create(messages=messages, model="gpt-4o-mini").choices[0].message.content
return result
question = "Please tell me how to reserve the restaurant."
response = get_response(question)
print(response)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @eigokainai,
I'm glad you found workaround and shared it, for those of you who have had similar experiences check out the comments below.
Best regards.
Community Support Team_Caitlyn