问题
I am working on windows Azure VM Role, I am having sql server installed on Azure VM, now I want to connect to that sql server from outside, is it possible?
回答1:
Unfortunately the default SQL port is blocked on azure - see this thread for more details: Azure input endpoint using port 1433 is blocked?
回答2:
Please refer to this link to configure your VM Role; part of what you need is to open a firewall port that allows communication into your VM Role. http://social.msdn.microsoft.com/Forums/en-US/windowsazuremanagement/thread/b5f2967e-57e6-4099-9077-fb6d74897dbf - then you also need to enable TCP connections on your SQL Server instance.
But more importantly, are you aware that VM Roles do not have persistent storage capability? Refer to this link for an interesting discussion about that issue specifically: http://social.msdn.microsoft.com/Forums/en-US/windowsazuremanagement/thread/b5f2967e-57e6-4099-9077-fb6d74897dbf
Did you consider using SQL Azure instead?
回答3:
To all of you who keep questioning his use of the VM Role instead of SQL Azure, I'm looking at the same possibility and there's no arguing the point. SQL Azure might as well be SQL Server Express because of all the limitiations it imposes. There is NO way I could reasonably develop/redevelop my app to run using SQL Azure. The persistent storage issue is definately the challenge, but far from a show stopper thanks to services like iSCSI and blob storage, but the same reasons MS suggests for using a VM Role (long running setup for example) are why I think this can be done successfully. What I'm yet to determine is the sort of resources the VM will get. I have a 20GB DB that really needs at least 8GB RAM (or the hosted equivalent) to do its job well.
Anyway, my point is that like me, I imagine he has he reasons and anyone that's made it into the VM Role beta is highly unlikely not to have heard of and researched SQL Azure so perhaps you're wasting your time and insulting him with these replies. Then again, he's asking a question that's addressed pretty well (firewall issues) so maybe I'm giving him too much credit. Either way, food for thought.
来源:https://stackoverflow.com/questions/5502729/how-to-access-sql-server-installed-on-azure-vm-vm-role-outside-of-vm