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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Custom connector Power Bi

 

Hello,

 

I need create a new cutom connector for Power Bi. In the code is necessary put conection to the database included user and paswword for to connect automatically.

 

In the next try i put the folow code:

 

 

section HelloWorld;

[DataSource.Kind="HelloWorld", Publish="HelloWorld.Publish"]
shared HelloWorld.Contents = (optional message as text) =>
//     let
//         _message = if (message <> null) then message else "(no message)",
//         a = "Hello from HelloWorld: " & _message
//     in
//         a;

        let
            HELLO = Oracle.Database("ORADES11", [HierarchicalNavigation=true, Query="ANY QUERY"])
        in
            HELLO;

// Data Source Kind description
HelloWorld = [
    TestConnection = (dataSourcePath) => {"HelloWorld.Contents"},
    Authentication = [
        UsernamePassword = [Username = "USERNAME", Password = "PASSWORD"]
    ],
    Label = Extension.LoadString("DataSourceLabel")
];

 

what I try to do is pass the database, a query already made and the credentials so that automatically in power bi desktop, login automatically .

 

I do not know if it is possible in a connector and if so I do not know how it could be done.

 

Thank you

1 ACCEPTED SOLUTION

@Anonymous,

Why not use built-in Oracle connector in Power  BI Desktop? As per this article, for custom connector, Currently, a limited set of data source functions have been enabled to support extensibility. It doesn't support using Oracle.Database function.

Web.Contents
OData.Feed
Odbc.DataSource
AdoDotNet.DataSource
OleDb.DataSource




Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yuezhe-msft
Employee
Employee

@Anonymous,

I don't think it is possible to hard-code the usename and password in the code to make login automatically in custom connector.

You can define different authentication types(OAuth, Key, Windows, Basic (Username and Password), and anonymous credentials) following the guide in this article, but you still need to manually enter username and password when using the custom connector in Power BI Desktop.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

ok, thank you,

 

Now, i put:

 

 

section HelloWorld;

[DataSource.Kind="HelloWorld", Publish="HelloWorld.Publish"]
shared HelloWorld.Contents = (optional message as text) =>

    let
			qry = "Select.....",
			Source = Oracle.Database("ORADES11", [HierarchicalNavigation=true, Query=qry])
    in
                        Source;

HelloWorld = [
    TestConnection = (dataSourcePath) => {"HelloWorld.Contents"},
    Authentication = [
        Anonymous = []
    ],
    Label = Extension.LoadString("DataSourceLabel")
];

HelloWorld.Publish = [
    Beta = true,
    ButtonText = { Extension.LoadString("FormulaTitle"), Extension.LoadString("FormulaHelp") },
    SourceImage = HelloWorld.Icons,
    SourceTypeImage = HelloWorld.Icons
];

HelloWorld.Icons = [
    Icon16 = { Extension.Contents("HelloWorld16.png"), Extension.Contents("HelloWorld20.png"), Extension.Contents("HelloWorld24.png"), Extension.Contents("HelloWorld32.png") },
    Icon32 = { Extension.Contents("HelloWorld32.png"), Extension.Contents("HelloWorld40.png"), Extension.Contents("HelloWorld48.png"), Extension.Contents("HelloWorld64.png") }
];
when trying to connect the message comes out:  "specify how to conect" when trying to put the credentials for to connect to database.
 
I cant to connect to database.
 
If i open a new power bi and i do new login to the same database the login is successfully.
 

@Anonymous,

Why not use built-in Oracle connector in Power  BI Desktop? As per this article, for custom connector, Currently, a limited set of data source functions have been enabled to support extensibility. It doesn't support using Oracle.Database function.

Web.Contents
OData.Feed
Odbc.DataSource
AdoDotNet.DataSource
OleDb.DataSource




Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

ok, thank you

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors