【发布时间】:2020-04-06 13:24:21
【问题描述】:
我有一个 .NET Core 2.2 Web 应用程序部署到 Azure 应用程序服务,我正在连接到一个 Azure SQL 托管实例。 Appsettings.json 中要写入的连接字符串应该是什么。我尝试了在 Azure 门户中找到的以下连接字符串,但它不起作用。
"AZURESQLCONNSTR_":Server=tcp:azure-abcde.database.windows.net,1433;Persist Security Info=False;User ID=userid;Password=password;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
但是当我尝试运行下面的 Azure 应用服务时,我没有得到任何数据。
http://productwebapp.azurewebsites.net/api/ProductDetails/GetProductDetails.
您能否提出解决此问题的方法?
【问题讨论】:
-
您是否遇到任何连接错误?
-
您是否按照本教程进行操作:docs.microsoft.com/bs-latn-ba/azure/sql-database/…?
-
您可以在 Azure SQL 数据库托管实例中配置公共终结点,以允许 azure 应用服务访问该实例。更多详情请参考docs.microsoft.com/bs-latn-ba/azure/sql-database/…
标签: azure connection-string azure-app-service-envrmnt azure-sql-managed-instance