gpt4 book ai didi

azure - 无法从azure应用程序连接ms sql服务器

转载 作者:行者123 更新时间:2023-12-03 04:20:30 27 4
gpt4 key购买 nike

我有Azure应用程序和SQL数据库。SQL URL如jdbc:sqlserver://xxxxx.database.windows.net:1433;databaseName=xxxxx,尝试连接我的本地tomcat,成功连接。但是当尝试从 Azure 应用程序连接时,我收到异常

 [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (JCA PoolFiller) IJ000610: Unable to fill pool: java:jboss/DB/DS: javax.resource.ResourceException: IJ031084: Unable to create connection
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:345)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:352)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:287)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1320)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.fillTo(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1136)
at org.jboss.jca.core.connectionmanager.pool.mcp.PoolFiller.run(PoolFiller.java:97)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open server "App-server" requested by the login. The login failed.

最佳答案

but i can't use from azure app server (VM) from sql Database

您的意思是您的应用程序托管在 Azure VM 上吗?

如果我理解正确的话,您应该将Azure VM的公共(public)IP地址添加到sql server防火墙。

通过Azure门户添加VM的IP地址:

enter image description here

此外,您还应该将端口 1433 添加到虚拟机的 NSG 入站规则操作系统防火墙设置

关于azure - 无法从azure应用程序连接ms sql服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49649038/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com