Forum Discussion

siva_powerbi's avatar
siva_powerbi
Icon for Helper IV rankHelper IV
5 years ago

Passing the datasource user name and password in M Code - Power Query

When I connect to database in power BI, I get the database driver and database name in Source step of power query formula, When I run the same M code in any other/remote system Power BI is prompting for the database credentials to conenct to database.

 

But my requirement is to when I use the M code in any other system Power BI shouldn't ask me for the login credentials, for this I have tried to various connection options like Oracle Driver, ODBC, OLE DB but nothing seems to work.

 

Can experts suggest me the approach to pass the login credentials with in the Source of power Query or make the M Code to use any active/Live connection in application.

 

Thanks

3 Replies

  • Jimmy801's avatar
    Jimmy801
    Icon for Community Champion rankCommunity Champion

    Hello siva_powerbi 

     

    whenever Power BI needs a logon, it asks for it. You cannot hardcode any password in Power BI


    If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
    Kudoes are nice too

    Have fun

    Jimmy

    • siva_powerbi's avatar
      siva_powerbi
      Icon for Helper IV rankHelper IV

      Thanks for the answer,

       

      Can you please help if we can use any active/Live connection to use in M Query code when integrating M Query in a power shell. So that we can avoid giving user name and password in M Query.

      • Jimmy801's avatar
        Jimmy801
        Icon for Community Champion rankCommunity Champion

        Hello siva_powerbi 

         

        sorry, I cannot follow you. You would like to have a Live-connection to a datasource where credentials are needed. This means whenever somebody needs to update your datamodel, he needs to have credentials for it. I don't know what power shell here can change.

         

        BR

         

        Jimmy