连接到Azure数据库

时间:2016-01-12 11:10:24

标签: azure umbraco azure-sql-database

我有一个使用SQL CE开发的Umbraco站点,然后我将其更改为SQLEXPRESS并可以在本地连接。我部署到Azure(最初使用CE)并且一切运行正常,然后我创建了一个SQL Azure数据库并将SQLEXPRESS复制到那里,这似乎也有效,我可以使用SQL Management Studio连接到SQL Azure数据库。

当我尝试从我的应用程序连接到Azure数据库时出现问题,我已使用Azure连接字符串更新了web.config,但我在本地和Azure中都得到了 -

Value cannot be null.
Parameter name: sqlSyntax 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: sqlSyntax

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 



[ArgumentNullException: Value cannot be null.
Parameter name: sqlSyntax]
   Umbraco.Core.Persistence.Repositories.PetaPocoRepositoryBase`2..ctor(IDatabaseUnitOfWork work, CacheHelper cache, ILogger logger, ISqlSyntaxProvider sqlSyntax) +120
   Umbraco.Core.Persistence.Repositories.DomainRepository..ctor(IDatabaseUnitOfWork work, CacheHelper cache, ILogger logger, ISqlSyntaxProvider sqlSyntax) +23
   Umbraco.Core.Services.DomainService.GetAll(Boolean includeWildcards) +75
   Umbraco.Web.Routing.PublishedContentRequestEngine.FindDomain() +286
   Umbraco.Web.Routing.PublishedContentRequestEngine.PrepareRequest() +15
   Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +361
   Umbraco.Web.UmbracoModule.<Init>b__8(Object sender, EventArgs e) +80
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

任何想法出了什么问题?

2 个答案:

答案 0 :(得分:2)

当web.config包含空的umbracoDbDSN密钥但填充了umbracoConfigurationStatus密钥时,会发生此错误。即:

<appSettings>
  <add key="umbracoConfigurationStatus" value="7.3.4" />
  ...
</appSettings>
<connectionStrings>
  <add name="umbracoDbDSN" connectionString="" providerName="" />
  ...
</connectionStrings>

双击umbracoDbDSN connectionString和providerName。您可以尝试通过在web.config中清空umbracoConfigurationStatus的值来重新安装SQL Azure数据库中的Umbraco。

替换

<add key="umbracoConfigurationStatus" value="7.3.4" />

<add key="umbracoConfigurationStatus" value="" />

答案 1 :(得分:0)

我对Umbraco不熟悉,但您是否按照他们网站上的migration guide to Azure SQL进行了操作?

MSDN上的

This post也引用了Azure Umbraco Acceletator

作为旁注,他们还有一个在Azure上运行的Umbraco-as-a-Service产品。

相关问题