【发布时间】:2021-12-23 12:07:02
【问题描述】:
目前正在尝试使用配置构建器在我们的 .net 应用程序中填充我们的 web.config 连接字符串,这会导致超时。我关注了这个guide。我可以确认数据库的密码是正确的。我也已经尝试过确保通过 Azure CLI 登录。这无济于事。我还要注意我们在数据库中使用 vpn。
错误
SqlException: Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=356; handshake=14649;
System.Data.EntityException: 'The underlying provider failed on Open.'
Web.config 文件:
<configSections>
<section name="configBuilders" type="System.Configuration.ConfigurationBuildersSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="false" requirePermission="false" />
</configSections>
<configBuilders>
<builders>
<add name="AzureKeyVault" vaultName="{vaultname}" type="Microsoft.Configuration.ConfigurationBuilders.AzureKeyVaultConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Azure, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /></builders>
</configBuilders>
<connectionStrings configBuilders="AzureKeyVault">
<add name="Entities" connectionString="" providerName="System.Data.EntityClient" />
<add name="ADConnectionString" connectionString="LDAP://52.157.144.83:389/DC=INFORMATIONSECURITYTOOLKIT,DC=Local" />
</connectionStrings>
有没有更好的方法可以诊断这里发生了什么?
【问题讨论】:
标签: c# .net azure entity-framework azure-keyvault