Forum Discussion
GetScanResult endpoint does not return "datasourceInstances" list
- 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-resultPostWorkspaceInfo API documentation
https://learn.microsoft.com/rest/api/power-bi/admin/workspace-info-post-workspace-infoGet Datasources As Admin documentation
https://learn.microsoft.com/rest/api/power-bi/admin/datasets-get-datasources-as-admin
Thank you.
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.
- 1ng4lipt3 months agoRegular Visitor
Hello v-tejrama ,
Thank you for this detailed explanation.
I want to add that dataRetrievalState column has valuesUpstreamLineageErrors; DatasetSchemaDisabledByAdmin; DatasetExpressionsDisabledByAdmin
and
DatasetSchemaDisabledByAdmin; DatasetExpressionsDisabledByAdmin
which is obviously because of the situation you mentioned.
Still, I want to ask does it make sense to go to PBI admin/app settings to check what metadata is allowed to collect or something like that (if it is possible at all. Unfortunately, I am not a PBI admin and have no clue what is inside PBI admin panel). If so, could you please suggest which settings should I ask to check.