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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors