Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I am trying to debug the Python code that a colleague wrote following the example given here:
the code is really simple. We just plugged in our URL and question and ran it. Here is the 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/65c73be1-bfdf-4683-812e-cab91cc98cbeNaN"
configs = get_mlflow_env_config()
headers = {
"Authorization": f"Bearer {configs.driver_aad_token}",
"Content-Type": "application/json; charset=utf-8"
}
#print (configs)
#question = "{userQuestion: \"Please list all providers\"}"
question = "{userQuestion: \"Please give me total number of claims in the claims.csv table\"}"
# question = "{userQuestion: \"Could you give me total cost of procedures done in year 2023 grouped by procedure code?\"}"
response = requests.post(url, headers=headers, data = question)
print ("I am here now")
print("RESPONSE: ", response)
#print("")
responsebody = json.loads(response.content)
print (responsebody)
#print(response["result"])
HI @bruparel,
I check the error message and I found it means the request method not allowed, you may need to check the api document to use allow methods to send these requests.
Regards,
Xiaoxin Sheng
I have the same issue, the difference I see is the trailing NaN in the URL, is it by design?