Skip to content

[BUG] New install with an Azure SQL Server database: get "No database provider has been configured for this DbContext" error #5933

@patrickjlee

Description

@patrickjlee

Oqtane Info

Version - 10.0.3
Render Mode - Static
Interactivity - Server
Database - Azure SQL Server

Describe the bug

After creating the database in Azure Sql Server, TestOqtane3 and adding an admin user for that database, and running the Oqtane server project (after rebuilding it), the initial set up form appears. After completing it with Azure SQL as Database and Clicking the connection string button and entering a connection string of the form

Server=myservername.database.windows.net;Initial Catalog=TestOqtane3;Persist Security Info=False;User=myusername;password=mypassword;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

and also completing the other fields and clicking "Install Now" I get this error message (which from using breakpoints seems to happen during database migration):

No database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method or by using 'AddDbContext' on the application service provider. If 'AddDbContext' is used, then also ensure that your DbContext type accepts a DbContextOptions object in its constructor and passes it to the base constructor for DbContext.'

Expected Behavior

I expected the database to have its tables populated and the site home page to appear

Steps To Reproduce

See above.

Anything else?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions