Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Trying to use RLS with PowerBi embedded analytics, when I tested a POST request to generate token:
POST https://api.powerbi.com/v1.0/myorg/GenerateToken
I'm receiving following error:
{ "error": { "code": "InvalidRequest", "message": "Generate token request for proxy model should include the core model ID" } }
This happens only in case when sending identities in request body for reports using direct query connection.
If it is expecting a "Core model Id" in such scenario, cannot understand what is core model Id and how to pass it in request body as request body doesn't mention anything like model or modelId.
For Request body structure, please see: https://learn.microsoft.com/en-us/rest/api/power-bi/embed-token/generate-token
Solved! Go to Solution.
Hi,
i was able to solve it.
a report is using at least one dataset (= proxy model). If that dataset is referring to other datasets (= core model) then these need to be mentioned all in the generate embeded token request.
eg
report1 -> dataset1 (proxy model) -> dataset2 (core model), dataset3 (core model)
then the request should contain dataset1 id, dataset2 id and dataset3 id.
these additional datasets (core models) should be added as a normal dataset (so a separate dataset object iso a modelid inside the existing one)
{
"accessLevel": "View",
"allowSaveAs": "false",
"datasetId": "<dataset ID>",
"identities": [ ... ],
"datasets": [
{
"id": "<dataset1 ID>",
...
},{
"id": "<dataset2 ID>",
...
},{
"id": "<dataset3 ID>",
...
}
]
}
Hope this helps
regards
Hi,
any updates on how to solve this? Where can we find the core model id?
regards,
PJ
Hi,
No luck so far. The actual problem is how to pass modelId to the request.
You can see modelId in browser while report is loading under Network tab:
So you can find modelId through either conceptual schema or models&Exploration request.
But, can't proceed any further.
BR
Hi,
i was able to solve it.
a report is using at least one dataset (= proxy model). If that dataset is referring to other datasets (= core model) then these need to be mentioned all in the generate embeded token request.
eg
report1 -> dataset1 (proxy model) -> dataset2 (core model), dataset3 (core model)
then the request should contain dataset1 id, dataset2 id and dataset3 id.
these additional datasets (core models) should be added as a normal dataset (so a separate dataset object iso a modelid inside the existing one)
{
"accessLevel": "View",
"allowSaveAs": "false",
"datasetId": "<dataset ID>",
"identities": [ ... ],
"datasets": [
{
"id": "<dataset1 ID>",
...
},{
"id": "<dataset2 ID>",
...
},{
"id": "<dataset3 ID>",
...
}
]
}
Hope this helps
regards
I’m also facing the same issue.
We are using the Power BI SDK and have included both dataset IDs in the datasetId list of the GenerateTokenRequestV2 request.
However, we’re still getting the following error:
{"error":{"code":"InvalidRequest","message":"Generate token request for proxy model should include the core model ID"}}
Just to add, core model refers to the upstream datasets
Also, when mentioning datasets under identities in request body, mentioning only the upstream dataset worked without mentioning the direct dataset report is referring to, because Effective identity required only on upsteam dataset in my case
The "Core model ID" mentioned in the error message is a required parameter for generating a token when using row-level security (RLS) with direct query connections in Power BI Embedded. This parameter refers to the ID of the semantic model that the report is based on.
To pass the Core model ID in the request body, you need to add a property called "datasets" to the JSON payload, which contains the list of datasets used in the report. For each dataset, you need to specify the dataset ID and the core model ID in the "id" and "modelId" properties, respectively.
Here's an example of how to modify the request body to include the Core model ID:
{
"accessLevel": "View",
"allowSaveAs": "false",
"datasetId": "<dataset ID>",
"identities": [ ... ],
"datasets": [
{
"id": "<dataset ID>",
"modelId": "<core model ID>"
}
]
}
Replace <dataset ID> with the ID of the dataset used in the report, and <core model ID> with the ID of the semantic model that the report is based on.
You can find the Core model ID by opening the report in Power BI Desktop and selecting "Modeling" from the ribbon. The Core model ID is displayed in the "Current File Properties" section.
I hope this helps!
I tried it, receiving same error.
I have only one dataset with xmlaPermissions set to ReadOnly, hence the request thus formed had a structure like below (Also, replaced all placeholders below with real values)
{
"accessLevel": "View",
"allowSaveAs": "false",
"datasetId": "<dataset ID>",
"identities": [
{
"username": "<userName>",
"roles": [
"Default"
],
"datasets": [
"<dataset ID>"
]
}
],
"datasets": [
{
"id": "<dataset ID>",
"modelId": "<core model ID>",
"xmlaPermissions": "ReadOnly"
}
]
}
I was able to find the modelId, however passing it into the request the way as suggested above didn't work for me. Also, if you could examine the request structure for datasets array inside from https://learn.microsoft.com/en-us/rest/api/power-bi/embed-token/generate-token#generatetokenrequestv..., you'd see there is no mention of modelId there. Still I tried but didn't work.
Hi, did you find the solution for this one?
Yes. See BooaB solution in this page, dated 04-12-2023
Hi @Zed101 I'm trying to make this request work but I'm getting this error. I saw in BooaB response he adviced to put the model id into a different dataset object but when I do that, I get that the dataset doesn't exist. I'm confused in that part 'since the modelId I'm using is a numeric value as the one you showed previously in a screenshot
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
3 | |
3 | |
1 | |
1 | |
1 |
User | Count |
---|---|
8 | |
5 | |
4 | |
4 | |
2 |