In this article, let us see steps to connect to SQL Server on VM over Internet.
Below are the three steps to connect to SQL Server on VM over Internet :
1) In Azure portal - Under VIRTUAL MACHINES - Create an ENDPOINT
2) In VM - Create SQL Server login and enable SQL Server Authentication mode
3) In VM - Windows Firewall with Advanced Security - Add a New Inbound rule to enable Port
Click on your Virtual Machine Name
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixyEwyhSfPE1C-Hj7IqMssG2IOCjyiwrqeGe6BrhSe1n06Sx-6hcteEznaR-fVbaWsHm6Vk_1WTZdMgbTalBorys1pgTE5va59PczYgYJXy8vZAChSFf6vqKeko0C972hpt2cZ8a2d66t2/s640/i1.JPG)
Goto ENDPOINTS and click on ADD icon in the bottom
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ikVrs2go_stylrpPilZeWhVNsZi9n_5n6VyFfaemgDdwPbIYp6IkHeJcjUZPudoyc9D_p0QRyrW-X4hHaqz1FZ7dVdvKo7F2gHjvfitN6Dj2uP9OvnPmVnpXVpEHc0ETZ5wC4mZdV9Kn/s640/i2.JPG)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxCl8nWNrdUznJ5Ypztju-QCKD4NKeS7C-rxU6A2X2xObUpOnjq739I29QTe78Iyq3DxK3f7vNCBKhBLFb3VEIKIUE7B4XVijdVeKDbKpkohK_OrbfRVAz7wo1fq8_HQdoF-SRiobJcqZH/s320/i3.JPG)
Next, Provide Endpoint Name and Public Port = 57500 , Private Port = 1433
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUHIaSyNbVOeTzRe91-BsEVSU0LlPvmSy8FyJf-p7Wg2DatSC2AL8CDBGYdypIBsmQFPJ3qgaiZlfaBni_uIR22-FUUwcSHGpbt3G9WDb8bF1dGZz7JW1lRXsc_V-eIcoO9t1s0kUq1VpZ/s640/i5.JPG)
Note: select different port numbers to avoid malicious security attacks
i) Open SSMS on VM -> Under Object Explorer -> right-click on Server -> Properties -> Security -> Enable SQL Server and Windows Authentication mode
ii) Under Object Explorer -> Security -> Create a Login with Server role - Sysadmin
Below are the three steps to connect to SQL Server on VM over Internet :
1) In Azure portal - Under VIRTUAL MACHINES - Create an ENDPOINT
2) In VM - Create SQL Server login and enable SQL Server Authentication mode
3) In VM - Windows Firewall with Advanced Security - Add a New Inbound rule to enable Port
1) In Azure portal - Under VIRTUAL MACHINES - Create an ENDPOINT
Click on your Virtual Machine Name
Goto ENDPOINTS and click on ADD icon in the bottom
Next, Provide Endpoint Name and Public Port = 57500 , Private Port = 1433
Note: select different port numbers to avoid malicious security attacks
2) In VM - Create SQL Server login and enable SQL Server Authentication mode
ii) Under Object Explorer -> Security -> Create a Login with Server role - Sysadmin
3) In VM - Windows Firewall with Advanced Security - Add a New Inbound rule to enable Port
In VM, Start - > Search WF.msc - > Windows Firewall with Advanced Security
Create New Inbound Rule as shown below:
Next provide Name and description and click Finish.
Now this is how I connected to SQL Server VM instance from some other computer over internet
Server=VMname.cloudapp.net,57500 and With the login created in above step
No comments:
Post a Comment