C# 错误:无法在Azure Mobile Services上完成请求(内部服务器错误)

C# 错误:无法在Azure Mobile Services上完成请求(内部服务器错误),c#,azure,windows-8.1,backend,azure-mobile-services,C#,Azure,Windows 8.1,Backend,Azure Mobile Services,我正在构建一个Windows 8.1 Metro应用程序,该应用程序连接到Azure上托管的服务器后端。现在,为了进行测试,当我点击应用程序屏幕上的按钮时,它会触发一个函数,向数据库中插入一个值 代码如下: private async void SubmitClick(object sender, RoutedEventArgs e) { Companies Quiblify = new Companies {Name = "CompanyX"}; await A

我正在构建一个Windows 8.1 Metro应用程序,该应用程序连接到Azure上托管的服务器后端。现在,为了进行测试,当我点击应用程序屏幕上的按钮时,它会触发一个函数,向数据库中插入一个值

代码如下:

private async void SubmitClick(object sender, RoutedEventArgs e)
    {
      Companies Quiblify = new Companies {Name = "CompanyX"};
      await App.MobileService.GetTable<Companies>().InsertAsync(Quiblify);
    }
}
我有什么问题

编辑:这是服务器端代码

// POST tables/Companies
public async Task<IHttpActionResult> PostCompany(Companies item)
{
    Companies current = await InsertAsync(item);
     return CreatedAtRoute("Tables", new { id = current.Id }, current);
}
//发布表格/公司
公共异步任务邮政公司(公司项目)
{
当前公司=等待插入同步(项目);
返回CreatedAtRoute(“Tables”,new{id=current.id},current);
}
以下是错误日志:

Exception=System.Data.SqlClient.SqlException (0x80131904): Cannot open database "master" requested by the login. The login failed.
Login failed for user 'dNDCkODBwDLogin_ModernPOSBackend'.
This session has been assigned a tracing ID of 'bafdb889-b1b9-42a1-ace5-101ed382c1d2'.  Provide this tracing ID to customer support when you need assistance.
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
   at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass34.<UsingConnection>b__32()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<>c__DisplayClass1.<Execute>b__0()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation)
   at System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action`1 act)
   at System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act)
   at System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable`1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript)
   at System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
   at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
   at System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()
   at System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection)
   at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
   at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
   at System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext)
   at System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState)
   at System.Data.Entity.Database.Create(DatabaseExistenceState existenceState)
   at System.Data.Entity.DropCreateDatabaseIfModelChanges`1.InitializeDatabase(TContext context)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
   at System.Data.Entity.DbSet`1.Add(TEntity entity)
   at Microsoft.WindowsAzure.Mobile.Service.EntityDomainManager`1.<InsertAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.WindowsAzure.Mobile.Service.TableController`1.<InsertAsync>d__3.MoveNext()
ClientConnectionId:8edddc79-b06c-4c06-8cd2-aedc688e2c99
Error Number:4060,State:1,Class:11, Id=d3a27e91-15b5-4cd3-a8a5-761434cc363b, Category='App.Controllers.Tables'
Exception=System.Data.SqlClient.SqlException(0x80131904):无法打开登录请求的数据库“master”。登录失败。
用户“dNDCkODBwDLogin_ModernPostBackend”登录失败。
已为该会话分配了一个跟踪ID“bafdb889-b1b9-42a1-ace5-101ed382c1d2”。当您需要帮助时,请向客户支持提供此跟踪ID。
位于System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject、UInt32 waitForMultipleObjectsTimeout、Boolean allowCreate、Boolean OnlyOnEckConnection、DbConnectionOptions userOptions、DbConnectionInternal和connection)
位于System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject、TaskCompletionSource`1重试、DbConnectionOptions用户选项、DbConnectionInternal和connection)
位于System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection、TaskCompletionSource`1重试、DbConnectionOptions用户选项、DbConnectionInternal oldConnection、DbConnectionInternal&connection)
位于System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection、DbConnectionFactory connectionFactory、TaskCompletionSource`1重试,DbConnectionOptions用户选项)
位于System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection、DbConnectionFactory connectionFactory、TaskCompletionSource`1重试、DbConnectionOptions用户选项)
位于System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1重试)
位于System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1重试)
在System.Data.SqlClient.SqlConnection.Open()处
在System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.b_u36(DbConnection t,DbConnectionInterceptionContext c)
在System.Data.Entity.Infrastructure.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget,Action`2 operation,TInterceptionContext interceptionContext,Action`3 executing,Action`3 executed)
位于System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection连接,DbInterceptionContext interceptionContext)
位于System.Data.Entity.SqlServer.SqlProviderServices.c__DisplayClass34.b__u32()
在System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.c__DisplayClass1.b__0()中
在System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1操作)中
位于System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(操作操作)
位于System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection-sqlConnection,Action`1-act)
位于System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection-sqlConnection,Action`1-act)
位于System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(可为null的`1 commandTimeout、DbConnection sqlConnection、String createDatabaseScript)
位于System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection连接,Nullable`1 commandTimeout,StoreItemCollection StoreItemCollection)
位于System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection连接,Nullable`1 commandTimeout,StoreItemCollection StoreItemCollection)
位于System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()处
位于System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(数据库连接)
位于System.Data.Entity.Migrations.Dbmigator.EnsureDatabaseExists(操作必须成功才能访问数据库)
位于System.Data.Entity.Migrations.DbMigrator.Update(字符串targetMigration)
位于System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext InternalContext,Func`3 createMigrator,ObjectContext ObjectContext)
位于System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext ObjectContext,DatabaseExistenceEstate ExistenceEstate)
位于System.Data.Entity.Database.Create(DatabaseExistenceEstate)
位于System.Data.Entity.DropCreateDatabaseIfModelChanges`1.InitializeDatabase(TContext上下文)
在System.Data.Entity.Internal.InternalContext.c__DisplayClassf`1.b__e()中
位于System.Data.Entity.Internal.InternalContext.PerforminizationAction(操作操作)
位于System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()处
位于System.Data.Entity.Internal.LazyInternalContext.b_uu4(InternalContext c)
在System.Data.Entity.Internal.RetryAction`1.PerformAction(输入)
位于System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 Action)
在System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()中
位于System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(类型entityType)
位于System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
位于System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
位于System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(操作操作,EntityState新闻状态,对象实体,字符串方法名)
位于System.Data.Entity.Internal.Linq.InternalSet`1.Add(对象实体)
at System.Data.Entity.DbSet`1.Add(TEntity实体)
在Microsoft.WindowsAzure.Mobile.Service.EntityDomainManager`1.d\u 0.MoveNext()上
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(T
Exception=System.Data.SqlClient.SqlException (0x80131904): Cannot open database "master" requested by the login. The login failed.
Login failed for user 'dNDCkODBwDLogin_ModernPOSBackend'.
This session has been assigned a tracing ID of 'bafdb889-b1b9-42a1-ace5-101ed382c1d2'.  Provide this tracing ID to customer support when you need assistance.
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
   at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass34.<UsingConnection>b__32()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<>c__DisplayClass1.<Execute>b__0()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation)
   at System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action`1 act)
   at System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act)
   at System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable`1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript)
   at System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
   at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
   at System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()
   at System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection)
   at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
   at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
   at System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext)
   at System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState)
   at System.Data.Entity.Database.Create(DatabaseExistenceState existenceState)
   at System.Data.Entity.DropCreateDatabaseIfModelChanges`1.InitializeDatabase(TContext context)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Internal.Linq.InternalSet`1.ActOnSet(Action action, EntityState newState, Object entity, String methodName)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Add(Object entity)
   at System.Data.Entity.DbSet`1.Add(TEntity entity)
   at Microsoft.WindowsAzure.Mobile.Service.EntityDomainManager`1.<InsertAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.WindowsAzure.Mobile.Service.TableController`1.<InsertAsync>d__3.MoveNext()
ClientConnectionId:8edddc79-b06c-4c06-8cd2-aedc688e2c99
Error Number:4060,State:1,Class:11, Id=d3a27e91-15b5-4cd3-a8a5-761434cc363b, Category='App.Controllers.Tables'