set_data_source
Set up or replace a Power BI data source, choosing between structured connection details or legacy provider connection strings.
Instructions
Create or update a first-class DataSource object (separate from raw M partitions). kind = Structured (modern Power Query - connectionDetails and credential are each a flat JSON object of key/value pairs, e.g. connectionDetails={"protocol":"tds","server":"srv","database":"db"}) or Provider (legacy - connectionString + provider + impersonation = Default | ImpersonateAccount | ImpersonateAnonymous | ImpersonateCurrentUser | ImpersonateServiceAccount | ImpersonateUnattendedAccount). Replaces a same-named data source in place.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Structured | Provider | |
| name | Yes | ||
| provider | No | (Provider) the OLE DB/provider name | |
| sessionId | Yes | ||
| credential | No | (Structured) flat JSON object of credential key/value pairs | |
| impersonation | No | (Provider) impersonation mode | |
| connectionString | No | (Provider) the connection string | |
| connectionDetails | No | (Structured) flat JSON object of connection-detail key/value pairs |