I have an Azure account where a developer that used to work with me has set up an MSSQL database on an Ubuntu VM.

The PHP (CodeIgniter) system I am working on logs in (so database queries work correctly). I have the following information available:

  • The connection string uses "sqlsrv" driver in CodeIgniter
  • The hostname in the CI config is "".
  • Using "top" command, I can see "sqlservr" using resources (12.8% mem, 0.7% CPU)
  • I can run SQL scripts with "sqlcmd -S localhost"

But yet, I can't find anywhere where this database is listed in my Azure portal. Very frustrating. There is nothing listed under "SQL databases" and I have been through all the visible options in the Linux VM, and can't find it.

What am I missing?


The connection information suggest the SQL instance is simply a local SQL Server instance installed in the VM like any other software so you don't use the Azure portal to manage it. Instead, ssh into the VM and run systemctl status mssql-server --no-pager to see if mssql-server.service is listed.

The instance could also be a docker database container, in which case you can use docker ps to list the docker containers running on the machine.

  • Thank you Dan. I was pulling my hair out. docker ps returned nothing, so it was not a docker container, but running systemctl status mssql-server --no-pager shows me that the database is running. How would I go about accessing this database in an external tool such as SSMS or DBForge? Any idea? I tried using the Azure host name, but getting an error "A network-related or instance-specific error occurrd while establishing a connection to SQL Server." SSH is enabled on the VM. – Kobus Myburgh Sep 21 '19 at 14:07
  • You ought to be able to connect remotely using the tool of your choice (e.g. SSMS, Azure Data Studio) as long as port 1433 is reachable from the client. This may require creating an inbound rule or network security group as described here. Avoid exposing the SQL port on the public interface. – Dan Guzman Sep 21 '19 at 15:04
  • Thanks, Dan. I missed creating a subnet. Thank you! – Kobus Myburgh Sep 21 '19 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.