【发布时间】:2017-03-08 16:47:33
【问题描述】:
我将我的 API 从免费计划 app service 移动到基本计划 app service 以及 custom domain 和 SSL certificate。
1) 我看到我的 API 应用的状态是“正在运行”,身份验证 (AAD) 工作正常
2) 如果我打开它的 api 定义(即 */swagger/docs/v1),它就可以工作
3) 如果我尝试一个不尝试访问后端 Azure sql db 的请求,那么它工作正常
4) 如果我使用调用后端 Azure SQL db 的请求(它在将 API 移动到自定义域之前工作)它会失败并出现以下错误:
{"底层提供者在打开时失败。, StackTrace: at System.Data.Entity.Core.EntityClient.EntityConnection.Open()\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(布尔 shouldMonitorTransactions)\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func
1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)\r\n at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass651.b__63()\r\n 在 System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func1 operation)\r\n at System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQueryReliably[TElement](String commandText, String entitySetName, ExecutionOptions executionOptions, Object[] parameters)\r\n at System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreQuery[TElement](String commandText, ExecutionOptions executionOptions, Object[] parameters)\r\n at System.Data.Entity.Internal.InternalContext.<>c__DisplayClass141.b__13()\r\n 在 System.Data.Entity.Internal.LazyEnumerator1.MoveNext()\r\n at System.Collections.Generic.List1..ctor(IEnumerable1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable1 源)\r\n
在 P..Repositories.DataAccessLayer.DbContexts.P..DbContext.GetP..Dtos()\r\n 在 P..Repositories.Repositories.P..Repository.P..Repository..ctor()\r\n 在 P..API.Controllers.A..Controller.Get()"}]}
到目前为止,我发现的唯一一件事表明我的 API 由于防火墙规则而无法访问 Azure SQL,但这听起来不是一种选择,因为我刚刚为我的应用程序分配了一个自定义域,我相信它是在 Azure 中的同一个“地方”......到目前为止,在将 API 迁移到自定义域时,我还没有找到关于 Azure SQL 数据库连接的任何建议......
有什么想法吗?
【问题讨论】:
标签: azure ssl dns azure-sql-database azure-api-apps