Forum Discussion
SQL Managed Instance - Dataflow Refresh Issue
Hi , danjo914
According to your description, you can connect your sql server in Power Query Online but when you refresh it it return an error code "An attempt was made to access a socket in a way forbidden by its access permissions". This is actually strange.
For your problem, you can try chek:
(1) Is your SQL SERVER a cloud data source, because you said you can move away gateway. If it is a cloud data source, then there is no need to use a local data gateway to connect to the data source, you can use your credentials to try to access the data source, and configure the credentials in "Data Source credential". If it cannot be refreshed, according to your error message, the Power BI Service cannot find the server through your server name and credentials. You can try to check whether the request from Power BI Service is blocked on the SQL SERVER side. And to check that your credentials are correct, try using ip:port as the server name.
(2) If you need to use the local data gateway to access your SQL SERVER, you can try to test whether Desktop can connect on the computer where the local data gateway is installed. Also, you need to check if the firewall is blocking some requests from the cloud:
Adjust communication settings for the on-premises data gateway | Microsoft Learn
And you can also refer to this if it can help :
A network-related or instance-specific error occurred - SQL Server | Microsoft Learn
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- danjo9143 years agoFrequent Visitor
Thank you for your response. We believe that the issue was caused by the On-Premises Gateway redirecting to the on-premises database, rather than to the Azure SQL MI as specified in the data source , as the tables and datbase name are the same it was rather misleading. When we removed the Gateway from the Power Query, the connection failed. As we intend to move away from the On-Premises Gateway, we'll need to reassess our networking rules.