Skip to main content

Connecting SQL Server on Azure VM

Steps for configuring SQL Server connectivity in an Azure VM
The connection path is summarized by the following diagram:


Create a TCP endpoint for the virtual machine

In order to access SQL Server from the internet, the virtual machine must have an endpoint to listen for incoming TCP communication. This Azure configuration step, directs incoming TCP port traffic to a TCP port that is accessible to the virtual machine.
Note
If you are connecting within the same cloud service or virtual network, you do not have to create a publically accessible endpoint. In that case, you could continue to the next step. For more information, see Connection Scenarios.
1.      On the Azure Portal, select Virtual machines (classic).
2.      Then select you SQL Server virtual machine.
3.     Select Endpoints, and then click the Add button at the top of the Endpoints blade.

4.      On the Add Endpoint blade, provide a Name such as SQLEndpoint.
5.      Select TCP for the Protocol.
6.      For Public port, specify a port number such as 57500.
7.      For Private port, specify SQL Server's listening port, which defaults to 1433.
8.      Click Ok to create the endpoint.

Configure a Network Security Group inbound rule for the VM

If you want to be able to connect to SQL Server over the internet, you have to configure an inbound rule on the Network Security Group for the port that your SQL Server instance is listening. By default, this is TCP port 1433.
1.      In the portal, select Virtual machines, and then select your SQL Server VM.
2.     Then select the Nework interfaces.

3.      Then select the Network Interface for your VM.
4.     Click the Network security group link.

5.      In the properties of the Network Security Group, expand Inbound security rules.
6.      Click the Add button.
7.      Provide a Name of "SQLServerPublicTraffic".
8.      Change Protocol to TCP.
9.      Specify a Destination port range of 1433 (or the port that your SQL Server Instance is listening on).
10.  Verify that Action is set to Allow. The security rule dialog should look similar to the following screenshot.

11.  Click OK to save the rule for your VM.
NOTE – If after these settings you are not able to access the VM through SSMS then please check whether Static IP is been set on the VM.
  

Comments

Popular posts from this blog

Code Review - Tips

1.      Check for all the warnings given on compiling of the code and try to remove the warnings 2.      Perform  Code analysis tool and check for the following a.      Constraint Violators b.      Redundancies in Code c.       Redundancies in Symbol Declarations d.      And most important – Solve the Compiler Error 3.      “null” check needs to be performed where every application to avoid Null Reference Exception error. 4.      Naming Conventions should be followed with all variables following Camel Casing , and Class names following Pascal Casing. This rule helps in making Code better readable and this makes it more maintainable. 5.      Liskov substitution – Any derived class should not modify the behaviour of the Base Class. 6.      Code Reusability –...

Shrink all SQL Server databases transaction log files

PROBLEM: You want to shrink all SQL Server databases  transaction   log files to clean up some space SOLUTION: Use the following script to shrink all databases transaction log files. You can use it also as a maintenance job using SQL Server Agent DECLARE   @Log_name   VARCHAR ( 1000 ) DECLARE   @Db_name   VARCHAR ( 1000 ) DECLARE   @Recovery_model_desc   VARCHAR ( 1000 ) DECLARE   @SQL   nvarchar ( 2000 ) DECLARE   @ParmDefinition   nvarchar ( 1000 ) DECLARE   @SizeAfter   int DECLARE   db_cursor   CURSOR   FOR SELECT         F . NAME   AS   [LOG_NAME] ,         DB . NAME   AS   [DB_NAME] ,         DB . RECOVERY_MODEL_DESC   AS   [RECOVERY_MODEL_DESC] FROM         MASTER . SYS . MASTER_FILES   F ...

Random Forest Introduction

Random Forest Introduction Random forest is one of popular algorithm which is used for classification and regression as an ensemble learning. It means random forest includes multiple decision trees which the average of the result of each decision tree would be the final outcome for random forest. There are some drawbacks in decision tree such as over fitting on training set which causes high variance, although it was solved in random forest by the aid of Bagging (Bootstrap Aggregating). Now firstly it is better to pay attention to decision tree algorithm and then study about random forest. Because random forest is divided to multitude decision tree. Decision Tree: Decision tree uses tree-like graph to take as best as possible decision by considering all elements of graph. For instance, remember tennis player who has agenda to play in different weather conditions. And now we want to know if player will play on 15th day or not? Finding Pure Branch There are 15 days which in...