microsoft / PowerBI-Cli

Power BI command line tool for managing Power BI Embedded workspace collections
Other
98 stars 40 forks source link

DM_GWPipeline_Gateway_DataSourceAccessError #27

Closed IvanovOleg closed 8 years ago

IvanovOleg commented 8 years ago

Hi guys,

I am working on the Power BI Embedded deployment automation for a multi-tenant application. Each tenant has his own datasource but reports have the same structure. I've built a deployment script that imports a templates of the reports with a fake datasource. The next command is "powerbi update-connection" to update credentials and connection string in these reports according to the tenant settings. The issue appears after the update of the connection string. It looks like it tries to get a datasource with a fake credentials right after that and before the credential update itself and fails with the next error: {"error":{"code":"DM_GWPipeline_Gateway_DataSourceAccessError","pbi.error":{"code":"DM_GWPipeline_Gateway_DataSourceAccessError","parameters":{},"details":[{"code":"DM_ErrorDetailNameCode_UnderlyingErrorCode","detail":{"type":1,"value":"-2146232060"}},{"code":"DM_ErrorDetailNameCode_UnderlyingErrorMessage","detail":{"type":1,"value":"Login failed for user 'admin'."}},{"code":"DM_ErrorDetailNameCode_UnderlyingHResult","detail":{"type":1,"value":"-2146232060"}},{"code":"DM_ErrorDetailNameCode_UnderlyingNativeErrorCode","detail":{"type":1,"value":"18456"}}]}}}

wbreza commented 8 years ago

On the initial import, is the datasource connection string valid in the PBIX file? To understand your flow you are performing the following:

  1. Import PBIX file using import command
  2. Update connection string using update-connection command
  3. Update credentials using update-connection command

If you are attempting to set both the credentials and connection string in a single command it may fail since setting the credentials attempts to login to validate the credentials of the datasource before succeeding. Try splitting your deployment into the steps outline above.

Hope this helps.

IvanovOleg commented 8 years ago

Thank you!