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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
saifeddine
Frequent Visitor

Create DataSet with Odata Source from API.

 

Hi,

 

I am trying to create a dataSet from the PowerBi API with OData Url as datasource. 

 

that request work perfectly but that create a AnalysisServices datasource: 

 

{
   "name":"SalesMarketing",
   "defaultMode":"AsOnPrem",
   "tables": [],
   "datasources":[
      {
         "name":"SalesMarketing",
         "connectionString":"Data Source=asazure://westcentralus.asazure.windows.net/mypowerbi;Initial Catalog=SalesMarketing;Cube=Model"
      }
   ]
}

that is an example of DataSet with odata source that i created manually and published it:

 

{
    "@odata.context": "http://wabi-north-europe-redirect.analysis.windows.net/v1.0/myorg/$metadata#datasources",
    "value": [
        {
            "datasourceType": "OData",
            "connectionDetails": {
                "url": "http://services.odata.org/V4/(S(cswa1ocrxydzpz0gfdqi5obb))/TripPinServiceRW"
            },
            "datasourceId": "e2714955-d44f-4875-a618-be67d989746f",
            "gatewayId": "081e219f-bbe7-441c-bc63-b8e8875c984f"
        }
    ]
}

I would like to know how to create a Odata datasource object in json for the API; tha connectionString ... ? 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @saifeddine,

 

If you want to create a dataset through API using OData as source, I'm afraid it isn't supported for now. Please refer to:

1. Problems-on-creating-a-new-dataset-with-Power-BI-s-REST-API

2. Create-a-Dataset-programatically

3. https://msdn.microsoft.com/library/mt203562.aspx.

>>>A Dataset also has a defaultMode property, which determines whether the dataset is pushed, streamed, or both, with values of "Push", "Streaming", "PushStreaming", "AzureAS" and "AsOnPrem". The default value is "Push".

 

The workaround could be retrieving data from OData source in your program and then pushing them into Power BI dataset.

 

Best Regards,

Dale

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

View solution in original post

1 REPLY 1
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @saifeddine,

 

If you want to create a dataset through API using OData as source, I'm afraid it isn't supported for now. Please refer to:

1. Problems-on-creating-a-new-dataset-with-Power-BI-s-REST-API

2. Create-a-Dataset-programatically

3. https://msdn.microsoft.com/library/mt203562.aspx.

>>>A Dataset also has a defaultMode property, which determines whether the dataset is pushed, streamed, or both, with values of "Push", "Streaming", "PushStreaming", "AzureAS" and "AsOnPrem". The default value is "Push".

 

The workaround could be retrieving data from OData source in your program and then pushing them into Power BI dataset.

 

Best Regards,

Dale

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.