cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gkakun Regular Visitor
Regular Visitor

Power BI with Azure text analysis

Hi all,

 

I'm trying to use the keyphrase service in Azure, I used the API key from Azure and used anonymous credentials after I got few errors.

now, this is the error I'm getting, and have no idea how to solve this. 

I have tried all the options and get the same feedback

 

 

 Capture.JPG

5 REPLIES 5
gkakun Regular Visitor
Regular Visitor

Re: Power BI with Azure text analysis

This is the code I am using 

 

(text) => let
apikey = "fd8e13fb24384e5fa9b2106fa5c7ab9d",
endpoint = "https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/keyPhrases",
jsontext = Text.FromBinary(Json.FromValue(Text.Start(Text.Trim(text), 5000))),
jsonbody = "{ documents: [ { language: ""en"", id: ""0"", text: " & jsontext & " } ] }",
bytesbody = Text.ToBinary(jsonbody),
headers = [#"Ocp-Apim-Subscription-Key" = apikey],
bytesresp = Web.Contents(endpoint, [Headers=headers, Content=bytesbody]),
jsonresp = Json.Document(bytesresp),
keyphrases = Text.Lower(Text.Combine(jsonresp[documents]{0}[keyPhrases], ", "))
in keyphrases

Community Support Team
Community Support Team

Re: Power BI with Azure text analysis

Hi @gkakun

As tested with your code in Query editor, I will see a query like this, but can't see any dataset imported.

8.png

 

Also, when i click on the URL, it go to a page with error.

9.png

 

Please check if your URL is wrong, and if your account for Power BI Desktop is the same with Azure text analysis'.

Additionally, you could check this article to see if you have applied wrong steps.

 

Best Regards

Maggie

 

 

gkakun Regular Visitor
Regular Visitor

Re: Power BI with Azure text analysis

Hi Maggie, 

 

I have dataset connected, I didnt mentioned it since I dont think it's the problem.

 

About the URL, this is the URL I need to add since it's the one I have got from the Azure workspace.

 

see attached  (end point)

 

Capture.JPG

 

Highlighted
gkakun Regular Visitor
Regular Visitor

Re: Power BI with Azure text analysis

And about the article, I just reviewed it, and looks like I did exactly the same. I can't see in the article any reference to the credentials. I think this is the problem I just couldn't find any way to solve this.  

gkakun Regular Visitor
Regular Visitor

Re: Power BI with Azure text analysis

Hi Maggie,

 

I have managed to solve the problem in the query editor, and i can see the column I created from the functions. when i apply the changes I get this error- any idea why?Capture.JPG

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)