Forum Discussion

PiotrStukin's avatar
PiotrStukin
Frequent Visitor
3 years ago
Solved

Expression.Error: Access to the resource is forbidden when calling for function

Hello there,
I have simple function to convert ip address to geolocation using https://api.ipstack.com/ service.
When I call for function from query I receive error access forbiden. When I invoke function itself it works fine.
I am not in Azure, I am using PowerBI desktop app. I've reset all credentials and provide correct one (function connect to ipstack and return Json data). I am stuck and I do not know where else to look.

 

  • It was one EMPTY record in the column with IP addresses. 

    Expression.Error: Access to the resource is forbidden error is very misleading. 

     

     

8 Replies

  • Which privacy level did you select for that connection?  

     

    Note: You may not want to put your API key on the interwebs.

    • PiotrStukin's avatar
      PiotrStukin
      Frequent Visitor

      Yeah, I've noticed API key has been exposed, and I replaced my API key right away.
      I tried each level, it returns the same error every time.

      When I hit Apply in Power Query Editor I get this:

      Invoked Function
      Load was cancelled by an error in loading a previous table.
      Locations
      OLE DB or ODBC error: Exception of type 'Microsoft.Mashup.Engine.Interface.ResourceAccessForbiddenException' was thrown..


      I've been using that model for years, never had a problem. I have no idea what changed and why.

       

      • lbendlin's avatar
        lbendlin
        Super User

        Which privacy level did you select for that connection?  

  • PiotrStukin's avatar
    PiotrStukin
    Frequent Visitor

    Interesting fact. When I check ipstack API statistics I can see there is a lot of requests. So PowerBi talks to ipstack.API Statistics

  • PiotrStukin's avatar
    PiotrStukin
    Frequent Visitor

    Anyone have any ideas? The only last thing I want to try is run Power BI on brand new VM or computer with fresh Windows installation and check if this will work.

  • PiotrStukin's avatar
    PiotrStukin
    Frequent Visitor

    No luck. Even when I check "Ignore Privacy Levels checks for this file".
    Again, I can see PowerBI is talking to ipstack.com (I see requests on ipstack.com dashboard). I can Invoke function "manually" providing IP address and it returns vaules.
    It won't work when I am trying to add column (Add Column / Invoke Custome Function).


     

  • PiotrStukin's avatar
    PiotrStukin
    Frequent Visitor

    It was one EMPTY record in the column with IP addresses. 

    Expression.Error: Access to the resource is forbidden error is very misleading.