katie77
katie77

Reputation: 1811

Scaffold-DbContext using Azure Key vault

I am trying to use Scaffold-DbContext for an Azure SQL database. I tried these 2 methods and the errors

Scaffold-DbContext 'Server=tcp:testdb-sqldb-dev.database.windows.net,1433;Initial Catalog=dbname;Persist Security Info=False;User [email protected];MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Integrated";'  Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

Failed to authenticate the user [email protected] in Active Directory (Authentication=ActiveDirectoryIntegrated). Error code 0xintegrated_windows_auth_not_supported_managed_user Integrated Windows Auth is not supported for managed users. See https://aka.ms/msal-net-iwa for details.

Scaffold-DbContext 'Server=tcp:testdb-sqldb-dev.database.windows.net,1433;Initial Catalog=dbname;Persist Security Info=False;User [email protected];Password=P@ssw0rd;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Password";'  Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

Failed to authenticate the user [email protected] in Active Directory (Authentication=ActiveDirectoryPassword). Error code 0xinvalid_grant AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication

Upvotes: 0

Views: 33

Answers (0)

Related Questions