The OData connector's Web API mode always says "A web api key can only be specified when a web api key name is provided." Is this broken? Or is there a way to make it do something?
I hacked up some code in our server to find out what headers are sent by PowerBI; looks like "Web API" mode doesn't even send a request. Since our normal Azure Active Directory authentication is not supported, it looks like realistically the only mode we can use is Basic (though I know we could also use a custom connector); For future reference, the headers I receive from PowerBI in Basic mode is:
Headers on /odata/entities?$top=1000:
Accept = application/json;odata.metadata=minimal;q=1.0,application/json;odata=minimalmetadata;q=0.9,application/atomsvc+xml;q=0.8,application/atom+xml;q=0.8,application/xml;q=0.7,text/plain;q=0.7
Accept-Encoding = gzip, deflate
Authorization = Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Host = localhost:5001
User-Agent = Microsoft.Data.Mashup (https://go.microsoft.com/fwlink/?LinkID=304225)
MaxDataServiceVersion = 3.0
OData-MaxVersion = 4.0
where the username and password are base64-encoded after "Authorization = Basic".
Solved! Go to Solution.
Hi @david_piepgrass ,
You can pass ApiKeyName in the OData.feed() use Power Query. For more information, see:
authenticating with Excel Power Query against .Net Odata Web Api
API Strategies with Power BI
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi @david_piepgrass ,
You can pass ApiKeyName in the OData.feed() use Power Query. For more information, see:
authenticating with Excel Power Query against .Net Odata Web Api
API Strategies with Power BI
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
So, fiddling around, the answer seems to be that the "OData feed" connector does not support "Web API" authentication, but there's a workaround involving the M function called OData.Feed:
But wait! What does the "Web API" option actually do? Apparently all it does is add a key-value pair to the URL (twice?). Here is the relative URL and headers that my app received from Power BI when I set the "Key" to "YourWebApiKey":
Headers on /odata/entities?$top=1000&YourCustomKeyName=YourWebApiKey&YourCustomKeyName=YourWebApiKey:
Accept = application/json;odata.metadata=minimal;q=1.0,application/json;odata=minimalmetadata;q=0.9,application/atomsvc+xml;q=0.8,application/atom+xml;q=0.8,application/xml;q=0.7,text/plain;q=0.7
Accept-Encoding = gzip, deflate
Host = localhost:5001
User-Agent = Microsoft.Data.Mashup (https://go.microsoft.com/fwlink/?LinkID=304225)
MaxDataServiceVersion = 3.0
OData-MaxVersion = 4.0
Lucien, the domain of the second link (angryanalyticsblog.azurewebsites.net) is currently inaccessible.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!
User | Count |
---|---|
188 | |
69 | |
66 | |
60 | |
55 |
User | Count |
---|---|
194 | |
103 | |
90 | |
81 | |
75 |