unable to open tcp connection with host 'localhost:1433' in azure container app

175 views Asked by At

Hello am new to Azure platform. I have created a hello world basic azure container app which is running fine and am able to access the app over internet. I added database connection to connect and execute some SQL queries. I understand it's trying to establish connection through TCP and fails to do so. I have added principal id to SQL database IAM too. Application is running inside same subscription as SQL Server db.

Two days ago I created a container instance and run the same image and was able to connect to db. Issue started when I created container apps and started using containers inside. So am sure this is a problem how I set up and managing access to container apps.

2023-10-13T04:11:08.584085724Z INFO: 2023/10/13 04:11:08 *Server strting 2023-10-13T04:11:09.818464540Z server has started 2023-10-13T04:14:29.970589453Z INFO: 2023/10/13 04:14:29 Root request

2023-10-13T04:17:55.852719129Z INFO: 2023/10/13 04:17:55 DB process creation started

2023-10-13T04:17:55.853183078Z 2023/10/13 04:17:55 unable to open tcp connection with host 'localhost:1433': dial tcp [::1]:1433: connect: connection refused

0

There are 0 answers