cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JBeyers Regular Visitor
Regular Visitor

Error when loading DirectQuery PBIX file: Datasource has no credentials, unable to Patch the gateway

Hi, 

 

I wanted to test out PowerBI embedded so I downloaded the sample app that is able to publish a pbix file and to embed it.

So I created the easiest PowerBI file one is able to make with Azure SQL, using the DirectQuery option, as underlying data source.

 

I succesfully imported the PowerBI file in my workspace collection
1.png

 

I changed the connection string of my PowerBI file succesfully

3.PNG

 

After that the code to patch the gateway with the username and password credentials fails

4.png

 

Then when I tried to view the embedded report I got this error. 
2.png

I believe the connectionstring is in the correct format because it was updated succesfully. I also already tried to point it to another SQL database and then the error shows the other SQL database in the error message.

 

1) I thought this could be because the Gateway does not get the credentials that I gave it is that correct?

2) And how can I fix this?

 

Thanks in advance!

 

7 REPLIES 7
Moderator Eric_Zhang
Moderator

Re: Error when loading DirectQuery PBIX file: Datasource has no credentials, unable to Patch the gat

@JBeyers

 

At the moment I post, it shall work. It seems a period outage and right now it works. I get the positive reponse from the ones who had the same error in this link.

JBeyers Regular Visitor
Regular Visitor

Re: Error when loading DirectQuery PBIX file: Datasource has no credentials, unable to Patch the gat

Hi @Eric_Zhang

 

Thanks for your response! I tried this but instead of a NotFound exception I received a BadRequest.

However I'm able to update my credentials with:

 

await client.Datasets.SetAllConnectionsAsync(workspaceCollectionName, workspaceId, datasetId, connectionParameters);

 

Here is a screenshot of the output

5.png

JBeyers Regular Visitor
Regular Visitor

Re: Error when loading DirectQuery PBIX file: Datasource has no credentials, unable to Patch the gat

Finally found the issue! When I used PowerBI-CLI the problem became a bit clearer. Apparently I needed to "Allow access to Azure services" in the relevant SQL database. After that I could finally Patch the Gateway and now I can see data in my report.

 

We definitely need more/the same feedback in the PowerBI API SDK!

 

This was my error (the IP Address is an Azure IP Address):

 

[ powerbi ] {"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":"Cannot open server 'engiep-dev-weeu-sql' requested by the login. Client with IP address 'xx.xx.xx.213' is not allowed to access the server.  To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.  It may take up to five minutes for this change to take effect."}},{"code":"DM_ErrorDetailNameCode_UnderlyingHResult","detail":{"type":1,"value":"-2146232060"}},{"code":"DM_ErrorDetailNameCode_UnderlyingNativeErrorCode","detail":{"type":1,"value":"40615"}}]}}}

jeffand Frequent Visitor
Frequent Visitor

Re: Error when loading DirectQuery PBIX file: Datasource has no credentials, unable to Patch the gat

How do you find the up address of PowerBI Embedded in order to whitelist the up address? Is it guaranteed not to change? I was under the impression that azure to azure calls didn't need it address whitelisting. 

JBeyers Regular Visitor
Regular Visitor

Re: Error when loading DirectQuery PBIX file: Datasource has no credentials, unable to Patch the gat

You mean IP address right? The IP address is an Azure IP Address, apparently you can switch on "Allow access to Azure services" on the Azure SQL Database. Then all Azure Services will have access to the database, including the Gateway. This way you don't need to add the Gateway's IP Address to the list of allowed IP addresses

jeffand Frequent Visitor
Frequent Visitor

Re: Error when loading DirectQuery PBIX file: Datasource has no credentials, unable to Patch the gat

I think I might be hitting a different issue specific to PBI embedded. My server is already set to allow all azure services through the firewall and is still throwing a NotFound error in the PatchGateway call. It was working on Tuesday this week and hasn't since. I see some other threads about similar problems, so I'm asssuming it's an outage for embedded specifically. I'll keep digging. Thanks for the info though. 

JBeyers Regular Visitor
Regular Visitor

Re: Error when loading DirectQuery PBIX file: Datasource has no credentials, unable to Patch the gat

I also got the NotFound error yesterday. I tried again today and now it works. Are you able to set your connection string in the following line:

 

 

await client.Datasets.SetAllConnectionsAsync(workspaceCollectionName, workspaceId, datasetId, connectionParameters);

 

What you can also do is to use PowerBI-CLI, just to try if you can make it work. I received better error handling from it, which helped me to solve the issue as you read above.

 

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,413)