question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to use Bastion to tunnel database connection

See original GitHub issue

As a developer using Azure CLI I’m frustrated that I have to set up and maintain a whole Virtual Machine just to access a database that’s in a private VNet

I’d like to be able to use the Azure Bastion native tunnel feature to directly tunnel to a database inside the connected VNet in the same manner as currently is used for accessing a VM via SSH or RDP. In my particular case I’d like to connect to an Azure Database for MySQL flexible server instance that is set to Private Access (VNet Integration) - though it’d be good for any solution to handle any database.

Possible example:

az network bastion tunnel --resource-group test --name bastion-test --target-resource-id "$(az mysql flexible-server show --resource-group test --name db-test --query id --output tsv)" --resource-port 3306 --port 3306

mysql -u db_admin -p -h 127.0.0.1

Alternatives exist:

Note that every alternative requires the creation of a VM. A VM that my company has to maintain. Bastion’s promise is to limit exposure - but is currently limited to VMs. VMs aren’t the only services that should have limited exposure.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:6
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
justinmchasecommented, Aug 30, 2022

I came here to file this bug also, I’m trying to tunnel to cosmosdb and it fails with this same error.

This is a legit bug at least in the sense that it shouldn’t be crashing with an Unexpected internal error and should probably at least give feedback about what is going wrong.

1reaction
PramodValavala-MSFTcommented, Mar 24, 2022

@kf6kjg Azure Bastion is currently designed for connecting to VMs like you’ve mentioned. The Azure Feedback forum would be the best place to get this idea recorded and have users up vote for it to gain traction.

Once the service supports it, then Azure CLI too would be updated to support the new scenarios as required.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect to an Amazon RDS DB instance using a bastion host ...
1. Set your Amazon RDS DB instance to private by modifying the DB instance. · 2. Launch the smallest available EC2 instance in...
Read more >
Connecting To Private Autonomous Database Using OCI ...
In this quick tip, I'm going to walk you through how to set this up, both for SQL connections, as well as to...
Read more >
Connecting a Bastion Server to a PostgreSQL Server via SSH ...
Learn how to connect bastion server to a PostgreSQL server via Secure Shell Tunnel to lower the level of the private network exposure....
Read more >
SSH to remote hosts through a proxy or bastion with ProxyJump
The ssh command first creates a connection to the bastion host bastion-hostname (the host referenced, by nickname, in the remote host's ProxyJump settings) ......
Read more >
AWS Setup Bastion Host SSH Tunnel | by Amol Kokje - Medium
In real scenarios of cloud deployment, it is recommended to secure the infrastructure with tight network security. To achieve that in AWS, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found