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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kpia
Helper I
Helper I

Dynamic Binding for Direct Query

I am working on a project to embed a report into our website. I have one dataset per customer and I want to dynmaically bind the report to the dataset at the time of embed. 

 

My report has a dataset associated with it and this dataset connects to one of the customers' datasets via direct query. I am trying to generate the embed token using Powershell with the method described here.

 

$bodyUser = [PSCustomObject]@{
    datasets = @(
        [PSCustomObject]@{
            id = "xxxxxxxx-report-dataset"
            xmlaPermissions = "ReadOnly"
        },
        [PSCustomObject]@{
            id = "xxxxxxxx-custer-dataset1"
            xmlaPermissions = "ReadOnly"
        },
        [PSCustomObject]@{
            id = "xxxxxxxx-custer-dataset2"
            xmlaPermissions = "ReadOnly"
        }
    )
    reports = @(
        [PSCustomObject]@{
            id = "xxxxxxxx-reportID"
        }
    )
    datasourceIdentities = @(
        [PSCustomObject]@{
            datasources = @(
                [PSCustomObject]@{
                    datasourceSelector = [PSCustomObject]@{
                        datasourceType = "ODBC"
                    }
                    connectionDetails = [PSCustomObject]@{
                        connectionString = "dsn=akpidatalake"
                        datasourceId = "xxxxxxxxxxx"
                        gatewayId = "xxxxxxxxxxx"
                    }
                },
                [PSCustomObject]@{
                    datasourceType = "AnalysisServices"
                    connectionDetails = [PSCustomObject]@{
                        server = "powerbi://api.powerbi.com/v1.0/myorg/embedded_poc"
                        database = "embedded dataset kap"
                    }
                    datasourceId = "xxxxxxxxxxx"
                    gatewayId = "xxxxxxxxxxx"
                }
            )
        }
    )
}

$jsonBody = $bodyUser | ConvertTo-Json -Depth 10

 

I am getthing this error: 

 

 Encountered errors when invoking the command: {   "code": "InvalidRequest",   "message": "Datasource identity must contain identity blob" }

 

Where do I get the indentity blob?

3 REPLIES 3
AmosHersch
Employee
Employee

Hi @kpia ,

 

If you don't have any external data source with SSO then just don't send the datasourceIdentities in your request. It's only required when you do have SSO.

AmosHersch
Employee
Employee

datasourceIdentities array is only required if you have external data sources (SQL/...) with SSO enabled. In such case this array is for providing access tokens (identity blobs) for those data sources. Since those are your data sources you should know how to create access tokens for them (not through Power BI).

If you don't have such data sources then you should not provide the datasourceIdentities array at all.

Thank you @AmosHersch for your response. It strange because we aren't using SSO so I'm not sure why it is giving this error message. 

 

We are using ODBC to connecto to AWS Athen with standard credentials via a gateway. Shouldn't the gateway handle all the credentials? 

 

 

kpia_0-1685568691955.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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