cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
KBO Continued Contributor
Continued Contributor

Power BI cognitive services - Error: Endpoint (404)

Hi, I had a little question may be one of you had the same issue. I tried to use the Cognitive Services for PBI Text Analytics. I create a cognitive Service on azure and create a funktion in PBI. But then a error occure - I get the mesage: "Web.Contents failed to get contents from 'https://powerbianalyticstext.cognitiveservices.azure.com/' (404):". So May be one of you had an idea how to handle this issue.

I tried also to finde the "Ocp-Apim-Subscription-Key" - but I failed, If this is the missing link may be someone can help me to finde it :)?

The code for the fuction:

= (text) => let
    apikey      = " Insert your API Key here ",
    endpoint    = " Insert your Endpoint here ",
    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),
    sentiment   = jsonresp[documents]{0}[score]
in  sentiment

 

Best,

Kathrin 

1 ACCEPTED SOLUTION

Accepted Solutions
KBO Continued Contributor
Continued Contributor

Re: Power BI cognitive services - Error: Endpoint (404)

Solved the problem by myself 😄 wasn't so easy but it works. Problem was the wrong Endpoint which MSFT wrote in the endpoint row. The right one can be find under point 2 (Api console).

View solution in original post

2 REPLIES 2
Community Support
Community Support

Re: Power BI cognitive services - Error: Endpoint (404)

Hi @KBO ,

 

Could you please try to post this request using other tools to verify if the endpoint and  api key are valid? The sent endponint is similar like "https://<your-custom-subdomain>.cognitiveservices.azure.com" & "/text/analytics/v2.1/sentiment" based on this document: https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/tutorials/tutorial-power-bi...


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
KBO Continued Contributor
Continued Contributor

Re: Power BI cognitive services - Error: Endpoint (404)

Solved the problem by myself 😄 wasn't so easy but it works. Problem was the wrong Endpoint which MSFT wrote in the endpoint row. The right one can be find under point 2 (Api console).

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors