Datasets - Get Datasources In Group

Returns a list of data sources for the specified dataset from the specified workspace.

Permissions

This API call can be called by a service principal profile. For more information see: Service principal profiles in Power BI Embedded.

Required Scope

Dataset.ReadWrite.All or Dataset.Read.All

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

URI Parameters

Name In Required Type Description
datasetId
path True
  • string
groupId
path True
  • string
uuid

The workspace ID

Responses

Name Type Description
200 OK

OK

Examples

Analysis Services example
Azure Blobs datasource example
Excel example
Extension datasource example
Microsoft Exchange datasource example
OData example
Oracle example
Salesforce datasource example
SAP HANA example
SharePoint example
SQL example

Analysis Services example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "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 Blobs datasource example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "AzureBlobs",
      "datasourceId": "e0315274-90b6-4fc0-abf2-2d60d448cb04",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "account": "myAccount",
        "domain": "blob.core.windows.net"
      }
    }
  ]
}

Excel example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "File",
      "connectionDetails": {
        "path": "c:\\users\\username\\documents\\orders1.xlsx"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Extension datasource example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "Extension",
      "datasourceId": "70540d95-4c8e-41ae-88c6-27a103b12841",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "kind": "AzureDataExplorer",
        "path": "https://myserver.kusto.windows.net"
      }
    }
  ]
}

Microsoft Exchange datasource example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "Exchange",
      "datasourceId": "4d126fc8-1568-46aa-ba16-ccf19b18f012",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "emailAddress": "john@contoso.com"
      }
    }
  ]
}

OData example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "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 example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "Oracle",
      "connectionDetails": {
        "server": "My-Oracle-Server",
        "database": "My-Oracle-Database"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

Salesforce datasource example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "Salesforce",
      "datasourceId": "e8a6e0f5-b244-402a-ba5a-4d578609ede3",
      "gatewayId": "7f1c4e55-544b-403f-b132-da0d3a024674",
      "connectionDetails": {
        "classInfo": "report-detail",
        "loginServer": "https://login.salesforce.com/"
      }
    }
  ]
}

SAP HANA example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "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 example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "value": [
    {
      "datasourceType": "SharePointList",
      "connectionDetails": {
        "url": "https://microsoft.sharepoint.com/hello/myproj/"
      },
      "datasourceId": "33cc5222-3fb9-44f7-b19d-ffbff18aaaf5",
      "gatewayId": "0a2dafe6-0e93-4120-8d2c-fae123c111b1"
    }
  ]
}

SQL example

Sample Request

GET https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/datasets/cfafbeb1-8037-4d0c-896e-a46fb27ff229/datasources

Sample Response

{
  "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 data source

DatasourceConnectionDetails

The Power BI data source connection details. See examples in Get Datasources or Get Datasources In Group.

Datasources

The OData response wrapper for a Power BI data source collection

Datasource

A Power BI data source

Name Type Description
connectionDetails

The data source connection details

connectionString
  • string

(Deprecated) The data source connection string. Available only for DirectQuery.

datasourceId
  • string

The bound data source ID, which is empty when not bound to a gateway

datasourceType
  • string

The data source type

gatewayId
  • string

The bound gateway ID, which is empty when not bound to a gateway. When using a gateway cluster, the gateway ID refers to the primary (first) gateway in the cluster and is similar to the gateway cluster ID.

name
  • string

(Deprecated) The data source name. Available only for DirectQuery.

DatasourceConnectionDetails

The Power BI data source connection details. See examples in Get Datasources or Get Datasources In Group.

Name Type Description
account
  • string

The connection account

classInfo
  • string

The connection class information

database
  • string

The connection database

domain
  • string

The connection domain

emailAddress
  • string

The connection email address

kind
  • string

The connection kind

loginServer
  • string

The connection login server

path
  • string

The connection path

server
  • string

The connection server

url
  • string

The connection URL

Datasources

The OData response wrapper for a Power BI data source collection

Name Type Description
odata.context
  • string

OData context

value

The data source collection