Datasets - Get Datasources

Returns a list of datasources for the specified dataset from "My Workspace".

Required scope: Dataset.ReadWrite.All or Dataset.Read.All
To set the permissions scope, see Register an app.

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

URI Parameters

Name In Required Type Description
datasetId
path True
  • string

The dataset id

Responses

Name Type Description
200 OK

OK

Examples

Analysis Services
Azure Analysis Services
Azure SQL
Excel
OData
Oracle
SAP HANA
SharePoint
SQL

Analysis Services

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "AnalysisServices",
      "connectionDetails": {
        "server": "My-As-Server",
        "database": "My-As-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Azure Analysis Services

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "AnalysisServices",
      "connectionDetails": {
        "server": "My-As-Server",
        "database": "My-As-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Azure SQL

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "Sql",
      "connectionDetails": {
        "server": "My-As-Server",
        "database": "My-As-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Excel

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "File",
      "connectionDetails": {
        "path": "c:\\users\\username\\documents\\orders1.xlsx"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

OData

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "OData",
      "connectionDetails": {
        "url": "http://services.odata.org/MyOdata/MyOdata.svc"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Oracle

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "Oracle",
      "connectionDetails": {
        "server": "My-Oracle-Server",
        "database": "My-Oracle-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

SAP HANA

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "SAPHana",
      "connectionDetails": {
        "server": "My-SapHana-Server",
        "database": "My-SapHana-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

SharePoint

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "SharePointList",
      "connectionDetails": {
        "url": "https://microsoft.sharepoint.com/hello/myproj/"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

SQL

Sample Request

GET https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/datasources

Sample Response

{
  "@odata.context": "http://api.powerbi.com/v1.0/myorg/groups/222f0f33-3abc-4a57-9f98-ff01bd2aaabb/$metadata#datasources",
  "value": [
    {
      "datasourceType": "Sql",
      "connectionDetails": {
        "server": "My-As-Server",
        "database": "My-As-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Definitions

Datasource

A Power BI datasource

DatasourceConnectionDetails

A Power BI datasource connection details

Datasources

Odata response wrapper for a Power BI datasource collection

Datasource

A Power BI datasource

Name Type Description
connectionDetails

The datasource connection details

connectionString
  • string

(Deprecated) The datasource connection string. Available only for DirectQuery.

datasourceId
  • string

The bound datasource id. Empty when not bound to a gateway.

datasourceType
  • string

The datasource type

gatewayId
  • string

The bound gateway id. Empty when not bound to a gateway.

name
  • string

(Deprecated) The datasource name. Available only for DirectQuery.

DatasourceConnectionDetails

A Power BI datasource connection details

Name Type Description
database
  • string

The connection database.

server
  • string

The connection server.

url
  • string

The connection url

Datasources

Odata response wrapper for a Power BI datasource collection

Name Type Description
odata.context
  • string

OData context

value

The datasource collection