Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
TexasBI
Helper II
Helper II

Find the mode type in a dataset through the API

Hello,

 

I have been able to pull all the datasets as the admin, but I would like to tell what mode they are on (Direct Query, Import, Dual)?? How can I do this through the API?

 

Thank you,

 

Chris

6 REPLIES 6
v-rzhou-msft
Community Support
Community Support

Hi @TexasBI 

If you connect to your data source by API, I think you use Web connector. Web connector only support import mode. 

1.png

If you use other connector to connect to your data source, you may refer to this blog for more details about supporting connection mode.

Here is a offical blog about Power BI Rest API. For reference: Power BI REST APIs

It seems that Power BI doesn't support you to change connection mode by API.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @v-rzhou-msft ,

 

Thank you for your response but this what not what I was talking about.

 

What I was asking is when I use the Power BI REST API to pull the metadata on the dataset from the Power BI Service, how can I determine what mode the dataset is in?


https://docs.microsoft.com/en-us/rest/api/power-bi/datasets

Hi @TexasBI 

Power BI REST API doesn't support you to determine what mode the dataset is in Power BI Service directly.

You could try Datasets - Get Datasources In Group to determind what data source your dataset contains. Find the connection mode the Power BI data sources support to determind.

Here is a post that the user determind whether his dataset is Import or Direct Query by Set All Connections API.

This API only support Direct Query.

For reference: REST API Identification of Import vs Direct Query Datasets

Or you can determind by the refresh way. For example, if your data source support Import/DQ or Import / Live connection, make sure the refresh way, schedule refresh(Import) or schedule cache refresh(DQ or LC). 

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @v-rzhou-msft ,

 

Thank you for sending that info. What is interesting is that I have an Azure SQL database and I have created a report using Direct Query mode. When I go to do a GET call in the REST API for datasources, I am returned the same result as if I am on Import mode. This is really strange.

Hi @TexasBI 

Did you call REST API in Power BI Desktop?

What connector did you use to do a GET call in the REST API for datasource?

As my above reply, if you use web connector to call REST API, the connection mode will be Import mode.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

My datasource is an Azure SQL database and I used the Azure SQL connector.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.