ACI needs MS SQL access which is on an azure VM, how do I achieve this?

Sean Kelly 0 Reputation points
2024-07-03T11:19:30.1433333+00:00

Hi, I have deployed a container instance which has a connection string which points to a SQL database which is hosted on an azure virtual machine. The virtual machine has its own public IP address. However, the container instance cannot "see" the SQL database instance. I have tried creating an inbound rule on the VNET which is associated with the VM to allow the subnet which the container instance is on to connect but this does not work. The VM is on its own subnet.

What am I doing wrong?

Thanks,

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. akinbade abiola 16,480 Reputation points
    2024-07-03T11:28:41.39+00:00

    Hello Sean Kelly,

    Thanks for your question

    There can be many reasons. While you've created an inbound rule on the VNET, the VM itself might have its own firewall blocking access on port 1433.

    You can also use nslookup to see if the container is resolving the hostname.

    See: https://video2.skills-academy.com/en-us/azure/azure-sql/virtual-machines/windows/ways-to-connect-to-sql?view=azuresql

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola


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.