How to connect Azure SQL in Azure VM from local computer?

Matt. P 20 Reputation points
2023-12-01T15:59:16.3+00:00

Hello,

I'd like to connect Azure SQL in Azure VM through SSMS from local computer (in office network).

Is there any connection string for that?

security guy doesn't want to open port 1433.

thank you in advanced

Mtt.

Azure SQL Database
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dan Rios 2,020 Reputation points MVP
    2023-12-01T16:20:28.76+00:00

    Hi Matt,

    You need to most likely get the relevant team to created a Network Security Group rule which will allow your local office IP inbound access to the VM on port 1433. There's more on best practices around SQL access and how to do this here: https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/security-considerations-best-practices?view=azuresql#access-control

    There are some other options laid our from the docs here which may be of interest: https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/ways-to-connect-to-sql?view=azuresql

    Ideally, your office would have a S2S VPN to the Azure hub network so you can access the VM via port 1433 just like you would do for any other server on your local corp network only so it's private. If that is not the case, review the above two options and see which one would be acceptable for your current network.

    Hope this helps, if so, please mark as accepted answer.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.