0
votes

https://docs.microsoft.com/en-us/power-bi/service-real-time-streaming

I am using the REST API to send live data to PowerBi. (From a native application on a Windows)

How can I handle the authentication , encryption and other security features while streaming data to PowerBi?

Can I use the powerBI gateway somehow?

I see following issues currently:

  • If someone gets the REST Api link to the dataset, they can induce incorrect data.
  • The json data that I stream is not encrypted
2

2 Answers

0
votes

As @silent said in his answer, the communication is fully encrypted. Pushing data to a streaming dataset looks like this (sample code in PowerShell):

$endpoint = "https://api.powerbi.com/beta/08bbc04c-a46d-4c45-b587-9dec9454fc2d/datasets/15e4b6c3-4697-442f-91f9-2ad056eef2a8/rows?key=QINNGFRYZnWHHFA51G6VCDeL%2FYyfh0oDZ0qsV1qwzIh18tNfs2POjWgFIJdnWxxA3bjqJqfMhWPOhzQ6bK3vgw%3D%3D"
$payload = @{
"datetime" ="2019-05-03T17:17:05.830Z"
"somevalue" =98.6
}
Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))

Note that the endpoint uses HTTPS protocol, i.e. it is encrypted. However, the difference between pushing data to a streaming dataset and pushing data to a "normal" push dataset, is that with streaming you do not use access token generated when you authenticate yourself against Azure AD, but a key in the endpoint URL. You must protect this key the same way as you are protecting your account's password. If someone got an access to them, he can harm you. So in the regard of authentication, there is not much difference. Also, because the communication is encrypted, you should not worry about the streamed data.

You can't use the gateway, because you don't need it. First, it is used to enable communication from Power BI Service to your premise (while in your case it is in the other direction and can be established directly) and second, even if you communicate through the gateway, the data will be encrypted the same way (so there is no difference regarding that).

0
votes

Not sure if I understand your question correctly, but the REST APIs are all only accessible via TLS encryption and authentication is based on Azure AD.

All requests to REST APIs are secured using Azure AD OAuth.

https://docs.microsoft.com/en-us/power-bi/service-real-time-streaming#using-power-bi-rest-apis-to-push-data