Forum Discussion

1ng4lipt's avatar
1ng4lipt
Regular Visitor
3 months ago
Solved

GetScanResult endpoint does not return "datasourceInstances" list

Hello! I'm collecting company's PBI metadata via PBI API (Scan Jobs to be precise). Following documentation, I call PostWorkspaceInfo endpoint with additional params   getArtifactUsers=True&line...
  • v-tejrama's avatar
    3 months ago

    Hi 1ng4lipt ,

     

    Thank you for providing the detailed request flow. I have reviewed your implementation, and your PostWorkspaceInfo call appears to be correct. so the parameters are set appropriately. The use of true versus True will not affect the response in this context.

    Notably, your scan result returns datasourceUsages with a valid datasourceInstanceId, indicating that the scan is successfully identifying the relationship between the dataset and its datasource. If there were an issue with the request, this information would typically not be present.

    The absence of the datasourceInstances section generally occurs when the scan API cannot fully resolve the underlying datasource metadata. As outlined in the Microsoft documentation for GetScanResult, the API may only return certain properties depending on the metadata available in the Power BI service. As a result, the response can vary based on datasource type, connection configuration, gateway setup, or how the dataset was created.

    This behavior is common with specific cloud connections, custom connectors, parameterized connections, dataflows, and certain Fabric related sources where the relationship is detected, but complete datasource details are not provided in the scan response.

    Since your request is properly configured and the scan completes successfully, this appears to be related to the API’s metadata return for that datasource, rather than an issue with your code.

    If you require comprehensive datasource connection details, I recommend using the Get Datasources As Admin endpoint, which is generally more reliable when datasourceInstances is missing.

    For further reference, please see the following Microsoft documentation:

    GetScanResult API documentation
    https://learn.microsoft.com/rest/api/power-bi/admin/workspace-info-get-scan-result

    PostWorkspaceInfo API documentation
    https://learn.microsoft.com/rest/api/power-bi/admin/workspace-info-post-workspace-info

    Get Datasources As Admin documentation
    https://learn.microsoft.com/rest/api/power-bi/admin/datasets-get-datasources-as-admin

    Thank you.