admin管理员组

文章数量:1124688

As part of report migration project from other technologies to PowerBi.
i am using Fabric Rest APIs ()
to create semantic layer in directQuery Mode.

And i am using below "model.bim" JSON configuration for connecting with database
but here i don't see any option to provide database username and password

so when i open this dataset from power bi service it gives popup like "The datasource is missing credentials and cannot be accessed"

now my requirement is somehow i need to pass database username and password along with model.bim JSON

so semantic layer will already get connected with database and we can create visual report directly

   "partitions": [{
"name": "Applications",
"mode": "directQuery",
"source": {
"type": "m",
"expression": [
"let",
" Source = Sql.Database(\"xxx-xxxx..database.windows\", \"database_name\"),",
" dbo_Applications = Source{[Schema=\"dbo\",Item=\"country\"]}[Data]",
"in",
" dbo_Applications"
]
}
}
]

Image Link Click Here

As part of report migration project from other technologies to PowerBi.
i am using Fabric Rest APIs (https://learn.microsoft.com/en-us/rest/api/fabric/semanticmodel/items/create-semantic-model)
to create semantic layer in directQuery Mode.

And i am using below "model.bim" JSON configuration for connecting with database
but here i don't see any option to provide database username and password

so when i open this dataset from power bi service it gives popup like "The datasource is missing credentials and cannot be accessed"

now my requirement is somehow i need to pass database username and password along with model.bim JSON

so semantic layer will already get connected with database and we can create visual report directly

   "partitions": [{
"name": "Applications",
"mode": "directQuery",
"source": {
"type": "m",
"expression": [
"let",
" Source = Sql.Database(\"xxx-xxxx..database.windows.net\", \"database_name\"),",
" dbo_Applications = Source{[Schema=\"dbo\",Item=\"country\"]}[Data]",
"in",
" dbo_Applications"
]
}
}
]

Image Link Click Here

Share Improve this question edited 2 days ago Umesh asked 2 days ago UmeshUmesh 12 bronze badges New contributor Umesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 1
  • Credentials are not stored in the model, they are set in the PBI Service. See github.com/microsoft/PowerBI-Developer-Samples/blob/master/… and data4v.com/… and learn.microsoft.com/en-us/power-bi/developer/embedded/… – Sam Nseir Commented 2 days ago
Add a comment  | 

1 Answer 1

Reset to default 0

Credentials are not stored in the model, they are set in the PBI Service.

See

https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/Patch-SQL-Datasource-Credentials-and-Refresh.ps1

https://www.data4v.com/automated-updation-of-power-bi-data-source-credentials/

https://learn.microsoft.com/en-us/power-bi/developer/embedded/configure-credentials?tabs=sdk3

本文标签: powerbiWhile Creating Semantic Layer in directQuery Mode Need to attach with databaseStack Overflow