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
gkakun
Helper III
Helper III

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
v-juanli-msft
Community Support
Community Support

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

 

 

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

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

 

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
Helper III
Helper III

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

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.