Forum Discussion
Implement TestConnection with both Uri.Type plus optional parameter
- Anonymous1 year ago
Thank you for reaching out to the Microsoft Fabric Forum Community.
Akash_Varuna thank you for your inputs.
f_daniel_souza -I have attached some official documents below for your reference. They may be helpful, so please take a look.
Gateway Support for Power Query connectors - Power Query | Microsoft Learn
Solved: Custom Connectors - API url + body - Microsoft Fabric Community
Custom API Connector - Data Source Path - Microsoft Fabric Community
Thanks. - 1 year ago
Hi Anonymous , unfortunately I couldn't solve this current problem, however I managed to create a dynamic navigation table that let me to call specific entities APIs with some engineering. You can close this thread nonetheless.
Thanks!
You're building a custom Power BI connector for Microsoft Purview that interacts with two types of endpoints—one that requires a JSON body for querying data, and another that targets a specific entity using an ID embedded in the URL path. While this setup works perfectly in Power BI Desktop, you're running into issues implementing the TestConnection function, which is required for publishing certified connectors and for validating credentials in the Power BI Service. The challenge arises because Power BI expects the dataSourcePath used in TestConnection to be a stable, base URL (like the hostname or a consistent API root) that doesn't contain dynamic elements such as JSON bodies or path parameters. However, your connector uses Uri.Type to handle relative URLs for entity-specific lookups, and combining this with TestConnection causes inconsistencies or validation errors. The recommended approach is to isolate your connector's base URL and use it as the dataSourcePath—ensuring it's static and predictable—while keeping the dynamic parts (like JSON payloads or entity IDs) within individual function logic using RelativePath and Query in Web.Contents. Structuring your connector this way satisfies Power BI’s validation requirements for TestConnection while preserving the flexibility needed for your relative URL invocations.