-1

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

1

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.