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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello there,
I want to push the data to Power BI Real time API so that I can see data on real time in Power BI dashboard. I am using python to post data to the API Provided by Power BI. The problem is that some time it works and some time it doesn't. Sometimes it successfully post the data with 200 status code and sometimes it gives 401 Authorization required. If I referesh the Power BI page and then again post the data the 401 error goes away but it comes back after some time. below is the python code that through which I am trying to post the data.
import requests
import json
from datetime import datetime
from random import randint
import time
url = "API URL"
try:
for i in range(100):
print(i)
date = datetime.now().strftime("%Y-%m-%dT%H:%M:%S")
print(date)
data = [{"date_time": date, "value": randint(0,200)}]
#print(json.dumps(data))
r = requests.post(url, json.dumps(data), verify = False)
print(r.status_code)
print(r.reason)
except Exception as e:
print(e)According to the oficial documentaion(can be found here) no authorization should be required.
For streaming datasets created using the Power BI service UI, as described in the previous paragraph, Azure AD authentication is not required. In such datasets, the dataset owner receives a URL with a rowkey, which authorizes the requestor to push data into the dataset with out using an Azure AD OAuth bearer token. Take now, however, that the Azure AD (AAD) approach still works to push data into the dataset
How to reslove this issue?
Solved! Go to Solution.
I found out the problem. It was the proxy related issue. 401 status code was thrown due to proxy settings on my PC and it wasn't related to Piower BI.
I found out the problem. It was the proxy related issue. 401 status code was thrown due to proxy settings on my PC and it wasn't related to Piower BI.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 12 | |
| 7 | |
| 4 | |
| 3 | |
| 3 |