microsoft / PowerBI-Cli

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

problems updating connection #32

Open jordiruiz opened 8 years ago

jordiruiz commented 8 years ago

Hello,

We have some problems when trying to update the connection on a direct query report. We have a job that checks for reports in a folder and then automatically upload to azure powerbi workspace using the nodejs powerbi client. The process check if exist the report in the workspace and if it exist delete it and then upload again. Sometimes we receive an error and if we try it again the command returns that the connection was updated succesfully We send the command with a parametrized bat file that contains the following (removed private data):

`@echo off setlocal

powerbi update-connection -w workspace -d %1 -u user -p password -s "data source=ourserver.database.windows.net;persist security info=True;Connection Timeout=120;encrypt=True;trustservercertificate=True;initial catalog=%2"`

In the following screenshot you can see the same command executed twice with diferent results:

image

When the command tells that the connection is changed, when we load the report we receive an error if we send the command again the report loads correctly.

The error when load the report:

image

jordiruiz commented 8 years ago

I've saw that when I change the connection successfully at the first time but receives the error DMTS_DatasourceHasNoCredentialError when trying to load the report. If I run the update command again the command result has a different datasource id and then the report is loaded correctly. Seems like at the first time is getting a wrong datasoure.

first time result --> DMTS_DatasourceHasNoCredentialError:


[ powerbi ] Found 1 Datasources for Dataset 51XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXc8 [ powerbi ] -------------------------------------------------------------------- [ powerbi ] Datesource ID: 39XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX52


second time result --> OK:


[ powerbi ] Found 1 Datasources for Dataset 51XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXc8 [ powerbi ] -------------------------------------------------------------------- [ powerbi ] Datesource ID: 57XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXf2


ali-hamud commented 7 years ago

Is this still the case?

FutureGUIs commented 7 years ago

Yep, I'm getting the same problem, the first time I run the update-connection command it fails with {"error":{"code":"DMTS_MonikerNotFoundError","pbi.error":{"code":"DMTS_MonikerNotFoundError","parameters":{},"details":[]}}}

But the second time around it works