What is a recommend way to connect to a private MySQL Server on VNET via Azure Bastion Host

Ruban Siva 20 Reputation points
2023-07-26T22:24:10.82+00:00

I have a private MySQL server on VNET which currently connect to via Azure Bastion VM through SSH. So effectively a double hop and also means I have to allow the users to connect to the Bastion Host which leaves the bastion host exposed.

So was wondering what's the recommended way to do this without user having to SSH to Bastion Host first. As far as I can think, there are possible two ways:

  1. SSH Tunneling
  2. Azure Bastion Native connections (maybe misunderstood what this does?)

Looking for suggestions pls?

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,777 questions
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
996 questions
{count} votes

Accepted answer
  1. KapilAnanth-MSFT 49,616 Reputation points Microsoft Employee Moderator
    2023-08-08T05:36:41.62+00:00

    @Ruban Siva

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    You were interested in the recommended way to connect to your MySQL Server in a VNet.

    I was able to find the documentation for connecting privately to a Server in VNET.

    I also reached out internally wrt SQLProxy and HAProxy and below is the response from them,

    "Like ProxySQL or HAProxy, Heimdall etx, Proxies sit between the mysql client and mysql server, they don't eliminate the need of mysql client,certain mysql clients also have connection pooling features such as JDBC, HikariPool, JBoss, etc,proxies can be installed on the same linux vm hosting application and running mysql client or on a seperate VM in between app and mysql server
    
    Proxies are optional but recommended for workloads that can generate random spikes of connections and/or the customer wants to direct reads and writes to different servers using proxy in between than making the multiple connection strings in application"
    
    Refer: [https://techcommunity.microsoft.com/t5/azure-database-for-mysql-blog/connecting-efficiently-to-azure-database-for-mysql-with-proxysql/ba-p/1279842](https://techcommunity.microsoft.com/t5/azure-database-for-mysql-blog/connecting-efficiently-to-azure-database-for-mysql-with-proxysql/ba-p/1279842)
    

    Wrt, Azure Bastion Native Client

    • Azure Bastion Native connection can only provide RDP and SSH connectivity to VMs in Azure
    • It cannot be used for accessing Azure Database for MySQL though it is in a VNET (as this is a PaaS service integrated into VNET and not a VM on it's own)

    Thanks,

    Kapil


    Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.

    0 comments No comments

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.