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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
anand2020
Microsoft Employee
Microsoft Employee

Fabric AI Skill API not working

Fabric AI Skill API not working. Tried with sample code from the Fabric documentation and articles, but I'm getting internal error exception. The authentication worked fine but getting internal error exception. Any change in the API contract or schema?
 
 

import requests
import json
import pprint
from synapse.ml.mlflow import get_mlflow_env_config


# the URL could change if the workspace is assigned to a different capacity
url = "https://<used valid url here>"

configs = get_mlflow_env_config()

headers = {
"Authorization": f"Bearer {configs.driver_aad_token}",
"Content-Type": "application/json; charset=utf-8"
}

question = "{userQuestion: \"what is an example product?\"}"

response = requests.post(url, headers=headers, data = question)

print("RESPONSE: ", response)

print("")

response = json.loads(response.content)

print(response["result"])

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @anand2020 
Thank you for reaching out microsoft fabric community forum.
We appriciate you for bringing it to the notice. If there are any changes required in document it will reviewed and updated soon.


As it is in preview mode please submit your valuable feedback 

vshamiliv_0-1738822463221.png

 

If this solution helps, please consider giving us Kudos and accepting it as the solution so that it may assist other members in the community.

Thank you

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @anand2020 
As per our pervious coversation could you please let us know if you have submitted  your feedback ?
Thank you.

Anonymous
Not applicable

Hi @anand2020 
Thank you for reaching out microsoft fabric community forum.
We appriciate you for bringing it to the notice. If there are any changes required in document it will reviewed and updated soon.


As it is in preview mode please submit your valuable feedback 

vshamiliv_0-1738822463221.png

 

If this solution helps, please consider giving us Kudos and accepting it as the solution so that it may assist other members in the community.

Thank you

FabianSchut
Super User
Super User

Just to make sure, all the prerequisites are fulfilled?

I've experienced the same issue. Previously, this API was working fine and provided both the SQL query and its execution output. I haven’t made any changes to my workspace, and since it was working earlier, I assume all requirements were met. I’m wondering if there might have been an update to the API or its schema that isn’t yet reflected in the documentation.

Yes, it is a paid F64, AI Skill is enabled, I'm able to create AI Skill run it, but I'm not able to call the published AI Skill API even within Fabric in the Notebook with the following code. 

 

 

import requests
import json
import pprint
from synapse.ml.mlflow import get_mlflow_env_config
# the URL could change if the workspace is assigned to a different capacity
url = "https://msitapi.fabric.microsoft.com/v1/workspaces/<guid>/aiskills/<guid>/__private/aiassistant/openai"
configs = get_mlflow_env_config()
headers = {"Authorization"f"Bearer {configs.driver_aad_token}","Content-Type""application/json; charset=utf-8"}
question = "{userQuestion: \"sample question?\"}"
response = requests.post(urlheaders=headersdata = question)
print("RESPONSE: "response)
print("")
response = json.loads(response.content)
print(response)
Response is below:
RESPONSE: <Response [500]> {'requestId': 'ae02ccee-33bc-4aeb-82da-45fb848c5d61', 'errorCode': 'UnknownError', 'message': 'An error occurred while processing the operation'}

Helpful resources

Announcements
Fabric July 2025 Monthly Update Carousel

Fabric Monthly Update - July 2025

Check out the July 2025 Fabric update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.