Forum Discussion

Rabi's avatar
Rabi
Resolver I
2 months ago
Solved

API authentication error on scheduled refresh

I have a API feed that require API Key , Tenant and Report UUID. Report ID goes in the base URL and API Key and Tenant in headers and this works fine in desktop but fails in service when scheduling ...
  • v-hashadapu's avatar
    v-hashadapu
    2 months ago

    Hi Rabi , Your M query looks correct, so the issue is probably no longer the Web.Contents syntax itself. Since the error still occurs when creating the connection in the Service, Power BI is likely failing the datasource validation against the API endpoint rather than the refresh query.

     

    Many APIs require the custom headers (X-Api-Key and X-Tenant) on every request, but Power BI Service test connection does not always include those headers during validation. Check whether the API root URL can be accessed without headers, if there are any firewall/IP restrictions blocking Power BI Service and whether Skip test connection can be enabled in your tenant/gateway settings. If the API only works when those headers are present, you may ultimately need a custom connector or gateway-based approach because some header-authenticated APIs do not validate cleanly with anonymous web connections in the Service.

     

    Skip Test Connection for On-premises and Cloud Dat... - Microsoft Fabric Community

    Implement test connection | Microsoft Learn