【发布时间】:2021-04-06 09:36:12
【问题描述】:
我有一个微服务来从 json 读取数据并保存在本地 postgres 中,但现在我想使用 azure postgres 而不是本地 DB。当我尝试使用应用程序属性进行连接时,出现超时错误。我有什么遗漏吗?
在我的连接安全中,我启用了允许访问 Azure 服务,我还在防火墙规则中添加了我的 ip 地址,并且我的 SSl 设置被禁用。
我的本地 postgres 应用程序属性文件,运行良好
spring.datasource.url=jdbc:postgresql://localhost:5432/MyDB
spring.datasource.username=postgres
spring.datasource.password=1234
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.platform=postgres
我的 azure postgres 应用程序属性不工作
spring.datasource.url : myapp.postgres.database.azure.com/test
spring.datasource.username: adminmyapp@myapp
spring.datasource.password: 123456
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.platform=postgres
我的应用程序属性是否正确?
【问题讨论】:
标签: java postgresql azure spring-boot