slow connection to SQL server on same Azure VNET - sql-server

We have several virtual machines on Azure. One running an SQL Server, the others are Windows Virtual Desktop hosts.
We have an application on the WVD hosts that connects to the SQL server but it takes forever to connect and start.
When running the application on the SQL machine using 127.0.0.1 to connect, everything works fine. Whenever I use the private IP of the machine, everything slows down immensely (even when running on the SQL server machine)
Alle machines are in the same VNET and region. Everything is also connected to Azure Active Directory Domain Services in the same VNET.
What might becausing the 'slowness'? Where should I start looking?
Thanks in advance!
I've added an image of the network topology. Could it have anything to do with the AADDS Load balancers? (I'm not at home when it comes to load balancing, etc)

Related

Looking for a easy enough way to manage virtual machine accounts connecting to MS SQL 2008R2

Our solution stack consists of multiple services, each of which can be run on individual host machines. For a variety of reasons, the services are hosted as a windows service running under a virtual account. Many of these services need to connect to a MS SQL 2008R2 instance running on a remote host. Each of the host machines running the services thus need to added to the MS SQL2008R2 instances as logins. e.g if our services are running on hostnames machine1, machine2...machinen, machine accounts machine1$, machine2$... machinen$ need to be added to MS SQL as logins. I thought I could simplify this by adding each host machine to a machine group on the domain and add the machine group as a login on the MS SQL instance. This did not work. Am I missing some steps ? OR am I forever condemned to add each individual machine accounts to MS SQL instance ? I know that I can run the windows services under a domain user (or maybe have the services impersonate a domain user if possible) and add the domain user to the MS SQL instance but I do not want to try this approach as the password for the domain user now needs to be managed.
Any help appreciated
Once the server and workstation were rebooted, it worked. Now just having the security group on MS SQL and no individual machine account on MS SQL gets our solution stack up and running. Thank you SQLChao for keeping me on track.

Using Power Desktop with an Azure VM and Enterprise Gateway

I am developing a report in PowerBI Desktop based on data hosted in an Azure SQL Server VM.
When publishing a report, I get the below error:
Publishing succeeded, but the published report cannot connect to the
data source because we were unable to find a gateway. Please install
and configure an enterprise gateway
I believe this is because the enterprise gateway is installed locally on my azure VM, however I'm accessing it from my desktop by going over the web and through the firewall. Therefore I believe the issue is that my pc acceses the machine at
mymachine.cloudapp.net
Whilst the enterprise gateway knows the machine as
netbios-name
Is there any way that I can upload a desktop report to powerBI web using this configuration? The other solution would be to get the machine and sql server to identify itself as "mymachine.cloudapp.net" so that I can use this as the name to connect to through the enterprise gateway, but I'm not sure how to do that (adding the alias to SQL Server isn't enough).
It's a bit hacky, but I've got a work around.
Open the server and edit your hosts file and add the following line:
127.0.0.1 mymachine.cloudapp.net
Make sure that mymachine.cloudapp.net has been configured in SQL Server as an alias.
In PowerBI, add a new enterprise gateway data source, this time, use mymachine.cloudapp.net to connect rather than netbios-name. You will need to use SQL Authentication to connect.
Obviously connecting PowerBI to an Azure VM in this way is not ideal, as it could potentially be unencrypted, but this works around the issue of different host names between PowerBI Desktop and Web.

WPF Application with SQL Server

I have developed a WPF application (Visual Studio 2012) with SQL SERVER (2008) database. This application going to run in multiple (above 5) systems via Internet.
So I have installed a SQL SERVER(2008) and WPF Application (.exe format) in First machine (is a server). And another four or more machines have only WPF Application (.exe) with internet. How to connect a database via internet to storing data and centralize the database.. it is possible??? please reply..
The broad brushstrokes of the method are:
Register a domain name.
Point the domain name at the internet IP address of your web server.
On SQL server, open up the firewall, turn on encryption. Open up ports on PC. Switch on security.
Now, you can connect to the remote SQL database over the internet.
If you are running SQL server on a home PC, you need a dynamic DNS server, see http://dyn.com/dns/.

How to Access Database hosted on localhost sql server 2008r2 by another computer in LAN

I created a windows form application in which I used an SQL server database.
It is working fine on my computer. Now I want to run this application on another computer that is connected with LAN with my computer.
The problem is both application must share the same database. I don't want to host my database online.
Please tell me how to access the same database from different computers by using LAN or another technique.
You will have to set up the SQL server to allow access from within the LAN.
You may also have to set up the firewall on your server to allow access to the SQL server port(s), usually 1433 1434 for MS SQL server.
Then point your application on the client machines to the server's IP address within your lan. Usually something like 192.168.xxx.xxx
Find the folder where your DB files are. SHARE that folder to 'Everyone' in network.
Turn*Off* Windows Firewall (this can be a problem sometimes when it's turned on).
Be sure that your second PC has the same ConnectionString (ServerName, ex. //PC-NAME/SQLEXPRESS) and is watching into your 'server' computer (PC with database on it).

Are we doing DMZ correctly?

We are building a client solution that will be hosted on servers in a data-centre. It consists of several servers all related to providing the client solution. There is no internal network to protect but for some reason our UAT environment has the notion of a DMZ in the server diagram.
We have an IIS box which will have a public IP. Then we have two servers DB(Sql Server) and APP that are only on the internal lan with no public IPs. You can only RDP to these servers via VPN. Our IIS server needs sql access so port 1433 is open from IIS box(DMZ) to the sql server. We are also opening several ports from the IIS server to the APP server which hosts WCF services.
My understanding was that a DMZ was meant to protect internal private networks and that these networks should not be accessible from the DMZ but we are now opening up ports to both our APP and DB servers so they are accessible from the DMZ. In the end most of our servers are accessible from the IIS server via certain ports.
We originally wanted to setup our SQL server for AD authentication only but since our IIS server is in the DMZ and has no AD access we will be forced to enable mixed mode authentication in SQL server. This might be another security issue in it's own since we are now forced to store passwords somewhere on the IIS server to be able to auth against sql server.
Are we not perhaps missing the idea of a DMZ?
So with a system where you have a DMZ, there is also a firewall involved.
So your system should look like this I think:
SQL-server hosting internal data
Other servers needed for the company
---- firewall ----
SQL-server hosting data for web solution
AD-server (if needed)
Web-server
FTP-server (could be on the web server also)
With this setup you don't expose company-sensitive database to the outside world and you also don't open up a port in the firewall making it possible for attackers to (maybe) get access to the internal database which has company sensitive data...
Just my suggestion based on the information provided.

Resources