Forum Discussion
Error creating ODBC type datasource using powerbi rest api
Hi,
I followed the powershell example set here https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/create-datasource to create an ODBC datasourceType where I set the connectionDetails value to DSN=my_sample_dsn with Basic authentication, a username, and a password. When performing this task in the powerbi web portal, it works. However, when using powershell, I receive an error code: DMTS_UnsupportedConnectionStringError. Is this not supported by the v1.0 powerbi api endpoint? Incidentally, fiddler shows a different v2.0 powerbi api used by the powerbi web portal. Is ODBC not supported by the v1.0 endpoint? If we have to use the v2.0 endpoint, can this be documented?
My environment uses the following:
- powershell core 7.4.1
- MicrosoftPowerBIMgmt.Profiles 1.2.1111 powershell module
- nuget packages microsoft.powerbi.api 4.18.0, microsoft.rest.clientruntime 2.3.24, newtonsoft.json 13.0.3, System.Security.Cryptography.cng 4.7.0 which I loaded via add-type
1 Reply
- AnonymousNot applicable
Hi tb98 ,
Based on your description, I checked the documentation, which shows that Power BI rest API V1.0 does not support ODBC links, as your reported error shows does not support ODBC as a data source character. Currently, the documentation you mentioned is for the v1.0 endpoint. Since the Power BI portal uses the v2.0 endpoint, ODBC data sources may be better supported there. While there is no direct documentation for creating an ODBC data source through the v2.0 API, you can check out this documentation for a method that suits your workaround. If you'd like step-by-step documentation , you can submit an idea for it at https://ideas.powerbi.com/ideas/ and wait for users with the same needs as you to vote for you to help make it happen as soon as possible.Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly