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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
anish_vs
Regular Visitor

Power BI Custom Connector to connect the AZURE SQL with ODBC using Accesstoken

I am relatively new to power bi. We are creating a Customer Connector for Power BI Desktop. In the custom connector, we will be authenticating the Azure AD guest user. After authenticating the guest user, using that access token, we will call the AZURE SQL DB using the ODBC data source. Our issue here is passing the access token to the ODBC connection. We have tried multiple option but all are generating errors. Below are how we are building the ODBC connections.

 

CredentialConnectionString = if (Credential[AuthenticationKind]? = "OAuth") then ** [ database = "DB_Name", accesstoken = Credential[access_token] ] ** else error Error.Record("Error", "Unhandled authentication kind: " & Credential[AuthenticationKind]?), defaultConfig = Diagnostics.LogValue("BuildOdbcConfig", BuildOdbcConfig()), SqlCapabilities = Diagnostics.LogValue("SqlCapabilities_Options", defaultConfig[SqlCapabilities] & [ // Place custom overrides here // The values below are required for the SQL Native Client ODBC driver, but might // not be required for your data source. FractionalSecondsScale = 3 ]),

 

OdbcDatasource = Odbc.DataSource(ConnectionStringNoNulls, [ // A logical (true/false) that sets whether to view the tables grouped by their schema names
HierarchicalNavigation = true,
// Allows upconversion of numeric types
SoftNumbers = true,
// Allow upconversion / resizing of numeric and string types
TolerateConcatOverflow = true,
// Enables connection pooling via the system ODBC manager
ClientConnectionPooling = true,

// These values should be set by previous steps
CredentialConnectionString = CredentialConnectionString,
SqlCapabilities = SqlCapabilities,
SQLColumns = SQLColumns,
SQLGetInfo = SQLGetInfo,
SQLGetTypeInfo = SQLGetTypeInfo
])

 

0 REPLIES 0

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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