0

I'm trying configure a app in Spring Boot to connect with Azure DataBase using com.microsoft.sqlserver.jdbc.SQLServerDriver driver.

This is my configuration:

spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.url=jdbc:sqlserver://hdonrns815.database.windows.net:1433;databaseName=code_dev
spring.datasource.username=user
spring.datasource.password=password
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServerDialect
spring.jpa.show-sql=true

this is my SQL Server pom.xml configuration:

<dependency>
   <groupId>com.microsoft.sqlserver</groupId>
   <artifactId>mssql-jdbc</artifactId>
</dependency>

And this is the error:

com.microsoft.sqlserver.jdbc.SQLServerException: SQL Server did not return a response. The connection has been closed. ClientConnectionId:d7304f30-4c29-4258-ac9f-4409dee20fdd

I can connect to the DB from Sql Server management.

I don't know what happend.

Thanks.

1 Answer 1

0

Allow Azure Services to access Azure SQL.

Reference: https://learn.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure#connecting-from-azure

Sign up to request clarification or add additional context in comments.

4 Comments

I can connect to the DB from Sql Server management because this is configurate.
SSMS isn't Azure service, you need to enable Azure Services specifically
Are you running your spring boot application from the same machine as that you have SSMS (for which IP is already whitelisted) or have you deployed/running from some other machine.
Same machine and I can connect to the DB, but not in Spring Boot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.