首页 > 解决方案 > Umbraco.Core.Exceptions.BootFailedException:配置了连接字符串,但 Umbraco 无法连接到数据库

问题描述

大家好,任何有 Umbraco 经验和 Azure 的人,我在 azure 上托管了我的 umbraco 网站,它首先运行良好,但是现在出现这个错误,我已经阅读了几乎所有关于这个的帖子,但我无法得到解决方案,实际上当我在本地运行该项目,它可以正常工作并很好地连接到 Azure SQL 服务器和数据库,但在托管后,它会在使用 8.1.2 版本时引发以下异常:

[BootFailedException: Boot failed: Umbraco cannot run. See Umbraco's log file for more details.

-> Umbraco.Core.Exceptions.BootFailedException: A connection string is configured but Umbraco could not connect to the database.
   at Umbraco.Core.RuntimeState.DetermineRuntimeLevel(IUmbracoDatabaseFactory databaseFactory, ILogger logger)
   at Umbraco.Core.Runtime.CoreRuntime.DetermineRuntimeLevel(IUmbracoDatabaseFactory databaseFactory, IProfilingLogger profilingLogger)
   at Umbraco.Core.Runtime.CoreRuntime.Boot(IRegister register, DisposableTimer timer)]
   Umbraco.Core.Exceptions.BootFailedException.Rethrow(BootFailedException bootFailedException) +226
   Umbraco.Web.Composing.ModuleInjector`1.Init(HttpApplication context) +162
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +523
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +176
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +220
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +303

[HttpException (0x80004005): Boot failed: Umbraco cannot run. See Umbraco's log file for more details.

-> Umbraco.Core.Exceptions.BootFailedException: A connection string is configured but Umbraco could not connect to the database.
   at Umbraco.Core.RuntimeState.DetermineRuntimeLevel(IUmbracoDatabaseFactory databaseFactory, ILogger logger)
   at Umbraco.Core.Runtime.CoreRuntime.DetermineRuntimeLevel(IUmbracoDatabaseFactory databaseFactory, IProfilingLogger profilingLogger)
   at Umbraco.Core.Runtime.CoreRuntime.Boot(IRegister register, DisposableTimer timer)]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +658
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +89
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +189

任何帮助将不胜感激

标签: c#azureumbraco

解决方案


如果您使用的是用于 Umbraco 的 Azure 应用服务,请在 Azure 门户中确保您的数据库防火墙设置将“允许 Azure 服务和资源访问此服务器”设置为“是”。


推荐阅读