Verwaltete Identitäten in einem ASP.NET-Kern-Web-API- und Entity Framework-Core-Code-First-AnsatzfehlerC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Verwaltete Identitäten in einem ASP.NET-Kern-Web-API- und Entity Framework-Core-Code-First-Ansatzfehler

Post by Anonymous »

Ich habe meine System-verwaltete Identität und meine Web-API sowie meinen Azure SQL-Server eingerichtet und ich dachte, ich würde Entity Framework Core mit einem Code-First-Ansatz einen Versuch geben, aber ich bin nicht in der Lage, die erste zu überwinden: < /p>
dotnet ef database update
< /code>
Ich erhalte den folgenden Fehler: < /p>
Build started...
Build succeeded.
Acquiring an exclusive lock for migration application. See https://aka.ms/efcore-docs-migrations-lock for more information if this takes too long.
Failed executing DbCommand (16ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
IF OBJECT_ID(N'[__EFMigrationsHistory]') IS NULL
BEGIN
CREATE TABLE [__EFMigrationsHistory] (
[MigrationId] nvarchar(150) NOT NULL,
[ProductVersion] nvarchar(32) NOT NULL,
CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY ([MigrationId])
);
END;
Microsoft.Data.SqlClient.SqlException (0x80131904): The specified schema name "f9f46a1d-ae9a-452b-8e33-980405668579@474b0611-4c5f-4051-975d-ff2965db0f6b" either does not exist or you do not have permission to use it.
at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.Execute(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean beginTransaction, Boolean commitTransaction, Nullable`1 isolationLevel)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.c.b__3_1(DbContext _, ValueTuple`6 s)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IReadOnlyList`1 migrationCommands, IRelationalConnection connection, MigrationExecutionState executionState, Boolean commitTransaction, Nullable`1 isolationLevel)
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Microsoft.EntityFrameworkCore.Migrations.IHistoryRepository.CreateIfNotExists()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.c.b__20_0(DbContext _, Migrator migrator)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String connectionString, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.c__DisplayClass0_0.b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
ClientConnectionId:ad1109bc-3bee-426a-a921-9e7c71cfc709
Error Number:2760,State:1,Class:16
The specified schema name "f9f46a1d-ae9a-452b-8e33-980405668579@474b0611-4c5f-4051-975d-ff2965db0f6b" either does not exist or you do not have permission to use it.
< /code>
Meine verwaltete Identität hat sowohl dbAccessAdmin als auch schreibt. Gibt es noch etwas, das ich tun muss, um dies in Gang zu bringen? Ich bin neu im Entity Framework und das einzige, was ich dabei gefunden habe>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post