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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.