Forum Discussion

xadya's avatar
xadya
Frequent Visitor
8 years ago
Solved

Azure text analyics API access to the resource is forbidden

Hey,

 

I performed sentiment analysis on a dataset of tweets in Power BI and did this with the free Azure text analytics API which was requested via azure.microsoft.com. This has expired, so I requested a new one via the Azure portal. However, I do not get this to work. My query is as follows:

(Source as table) as any =>
let
    JsonRecords = Text.FromBinary(Json.FromValue(Source)),
    JsonRequest = "{""documents"": " & JsonRecords & "}",

    JsonContent = Text.ToBinary(JsonRequest, TextEncoding.Ascii),
    Response =
              Web.Contents("https://westeurope.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment?",
            [
                Headers = [#"Ocp-Apim-Subscription-Key"= "[my key]",
                           #"Content-Type"="application/json", Accept="application/json"],
                Content=JsonContent 
            ]),
    JsonResponse = Json.Document(Response,1252)
in
    JsonResponse

I get no errors, until applying the queries, then it wants me to sign in. I use anonymous login to https://westeurope.api.cognitive.microsoft.com/ and it gives me an 'access to the resource is forbidden.' while the portal clearly shows me usable api keys.

 

Does someone know how to resolve this issue?

  • xadya's avatar
    xadya
    8 years ago

    Found out that I'm over the free API limit.. I'll mark this as solved.

3 Replies

    • xadya's avatar
      xadya
      Frequent Visitor

      Found out that I'm over the free API limit.. I'll mark this as solved.