Power BI api + password?

I spent this morning trying to understand and compile how to use Power BI with Epicor BAQs. Power BI is new to me; I know Power Query but not this interface.

cough Plug for Epiusers Wiki cough @Mark_Wonsil

Thus far I have ascertained the following points - and tell me if any of it is out of date or wrong, etc.

  1. Power BI is all about connecting to data and visualizing. Even live data.
  2. Smart people here say don’t do it with live data, though.
  3. Let’s say you’re going to do it anyway. How do you do it?
    a. ODBC? NOOOOOO! (I knew that already.)
    b. Some app you install called Power BI Gateway
    c. REST v1? Can only use Desktop version; supposedly works, but not secure. [I have not tried it myself]
    d. REST v2? Maybe - this is where my questions come in.

Again, I am gathering (and would love to be wrong) that the only way to use REST is through PBI Desktop (not online)?! So that stinks.

Also, the connection type is Web, not Odata. Got it.

I am using basic authorization (what else is there for REST, except maybe Azure AD?).

I wanted to put the API key as a header, but it looks like you can’t with basic auth.

image

So I saw a hack where you put the API key in the URL (I used the “parts” just for fun). And this seems to work.

But is this it? I am underwhelmed so far.

Also, since it is allegedly not a good idea to do this with live data, what do people use for that?EDD/EDA, I guess?

And I’ll misspell it as PowerBI here for some search engine optimization. :wink:

EDA also doesn’t use live-data. They all upload the data on a schedule to their own data cubes. Epicor did acquire www.grow.com I am not sure how that works. I would try that.

2 Likes

I don’t know bro. We use Power BI here and I just grip it and rip it with DirectQuery right into live data refreshing every 5 seconds.

I talked to the Grow people at Insights and they said they don’t do real-time data either.

1 Like

Desktop or online?

I use PowerBI and RESTv1 without API. I pass basic authentication username and password when I setup the datasource. It all comes through oData and seems to be pretty easy.
The REST API helper is invaluable!
Expor BAQ to PowerBI - ERP 10 - Epicor User Help Forum (epiusers.help)

Should have specified. We use Desktop to make the dashboards, etc.

We use Power BI heavily with Epicor I would say connect to the SQL DB Directly either via a Gateway or SQL Direct if you are on Azure.

Doing Power BI via REST is not going to work it isn’t performant enough.

Also checkout BlueSky ERP They have a pre-built Epicor Model that is pretty sweet

1 Like

Still want to work on it…

Been talking people off ledges this week…

(Not pushing them, to be clear…)

2 Likes

I’ve written several direct queries also and it seems to work OK. I was also interested in connecting through the API to get at my BAQs. Watching…

1 Like

Yep, I set up a number of stored procedures for data analytics in power BI and configured the query in there to just execute the SP. Works well

You can get V2 to work if you pass the x-api-key and encoded authorization through the headers:

image

EDIT: Then you could use an on-premise data gateway to have Power BI Online auto-refresh published reports that use the endpoint.

2 Likes

Right, I mentioned that in the original post, but I got the error that I showed.

So you are not using basic auth, I take it?

It’s still basic auth, just manually passed through the http headers instead of having power bi add it for you.

image

power bi would do the encoding for you, but you can also do it manually. The encoding is just user:password in base64 ( https://www.base64decode.org/ can do it )

1 Like

OhhhhKay.

Take this as the compliment it’s intended to be – that’s next-level nerd to me. I felt clever putting the API key in the URL (not very secure, of course).

Makes you realize the big push for different, more secure auth methods huh! Decoding a base64 encoded string containing a username and password is trivial.

1 Like

EDIT: Then you could use an on-premise data gateway to have Power BI Online auto-refresh published reports that use the endpoint.

Have you actually accomplished this in coordination with REST v2 and the HTTP headers you mentioned?

I can get the report to pull in the data, but it doesn’t seem to allow connection to an on-premise gateway and the credentials fail as configured in the http headers.

Hey Justen,

Yes we have this working with the workarounds mentioned above. May be an issue with your gateway installation/configuration. It looks like you have that data source in your screen shot configured as a cloud connection, not a gateway connection. If you go into that “Maps to:” drop down menu, you may have the option to “Add to Gateway”.