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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Sergiy
Resolver II
Resolver II

How to specify HTTP request header parameter in Power BI service

Hi everyone,

 

In Power BI Desktop I can connect to Web specifying HTTP request header parameter:

Desktop.png

 

I need my report to get updated in Power BI service as well. The issue is there seems to be no means for setting HTTP request header parameter which is mandatory in my case.

Service.png

 

What are my options? What can be done to set it?

Any comments are appreciated.

1 ACCEPTED SOLUTION

Hi Sergiy,

 

I see you're trying to get data from the Power BI API by writing your own M code in the Power Query Editor - this is not going to work unfortunately, because it is not possible to work with APIs that use OAuth2 authentication in this way. The only way to get data from an API that uses OAuth2 authentication is by creating a custom connector; there is a reasonably easy way to do this that I describe here https://blog.crossjoin.co.uk/2018/11/13/openapi-power-bi-rest-api-m/ and I think other people have blogged about this too.

 

HTH,

 

Chris

View solution in original post

7 REPLIES 7
marcel1318
New Member

Hello! did you get any solution to this problem? i have the same one im trying to add the HTTP request 

to the updated link

Sergiy
Resolver II
Resolver II

to be correct - I specify HTTP request header parameter in my M code but that is not enough apparently. 

Something is missed.

 

Code.png

I think this article explains what is happening:

https://powerbi.microsoft.com/en-us/blog/skip-test-connection-for-on-premises-and-cloud-data-sources...

The auther says:

For cloud data sources connecting to a URL, a test connection is performed against the root URL. This may be a blocker where the URL contains authentication keys, for example. Enabling Skip test connection also helps in such scenarios.

 

OK, but there is no such option "Skip test connection" visible.

NoOption.png

The article starts saying:

we have temporarily disabled the “skip test connection” feature

Is it really disabled now and I have to wait, or there never were such an option in a window whose screen I provided?

 

Hi @Sergiy ,

You can setting query parameter to parametrized your connection string:

Edit parameter settings in the Power BI service

In addition, I'd like to suggest you add 'relativepath' optional parameter to web connector to prevent anonymous credentials not valid issues.

Sample:

Source= Json.Document(Web.Contents("https://api.powerbi.com", [Headers=[Authorization=parameter],RelativePath="/v1.0/myorg/groups"]))

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft ,

 

Thank you for trying to help.

1.

Regarding using a parameter. I use it. It might have been not so obvious from my screens, but I use it.

Parameter is 'Groups_Bearer'. I made it noticeable on the screen below.

 

2.

Regarding your suggestion adding RelativePath optional parameter to web connector.

Unfortunately It didn't work:

CantUpdate_1.png

With regard to the statement I mentioned earlier "For cloud data sources connecting to a URL, a test connection is performed against the root URL." I assume that your advice should have worked if the root URL could have been hit without supplying an authorization Bearer. Apparently even with RelativePath option specified the root URL still couldn't be hit.

 

I'd like to quote once more:

For cloud data sources connecting to a URL, a test connection is performed against the root URL. This may be a blocker where the URL contains authentication keys, for example. Enabling Skip test connection also helps in such scenarios.

I might be wrong but I suspect that if I skipped a test connection where the authorization Bearer I provide isn't applied than the actual dataset refresh where the authorization Bearer is applied would succeed.

 

Dear @v-shex-msft , could you clarify the statement made at the beginning of the article:

https://powerbi.microsoft.com/en-us/blog/skip-test-connection-for-on-premises-and-cloud-data-sources...

Update: Due to few issues identified recently, we have temporarily disabled the “skip test connection” feature . We are working on making this available again for on-premises data sources by late-June. For cloud data sources we don’t have an ETA yet, but will circle back as soon as we do. 

 

- Does this mean that the option "skip test connection" will become available for the web connection I am willing to make?

- Was the option "skip test connection" available at the time of announcement was made for the web connection I am willing to make?

Hi Sergiy,

 

I see you're trying to get data from the Power BI API by writing your own M code in the Power Query Editor - this is not going to work unfortunately, because it is not possible to work with APIs that use OAuth2 authentication in this way. The only way to get data from an API that uses OAuth2 authentication is by creating a custom connector; there is a reasonably easy way to do this that I describe here https://blog.crossjoin.co.uk/2018/11/13/openapi-power-bi-rest-api-m/ and I think other people have blogged about this too.

 

HTH,

 

Chris

Hi Chris,

 

Thank you very much for the references you provided. I'll definitely try to use them to my advantage!

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors