You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] New install with an Azure SQL Server database: get "No database provider has been configured for this DbContext" error #5933
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
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
Thanks - this is in a test (local) environment, so running the code locally (via running the Oqtane.Server project in debug mode), but pointing to database in SQL Azure.
Can you please open the /Content/Log/error.log file and share the full error message which is in the log file (related to not being able to find the DbContext).
In reality the "Azure SQL" database provider is the exact same provider as the SQL Server provider - the only difference is that it has a slightly different UI component for capturing the connection string details. You can verify this by looking in your appsettings.json and scrolling to the "Azure SQL" section:
Notice the DBType is SQL Server. My guess is that you are encountering permissions issues when your development environment attempts to connect to Azure - perhaps the log will confirm.
Thanks. The full error message from the log file is:
[2025-12-30 15:21:36+00:00] [Error] [Oqtane.Infrastructure.DatabaseManager] An Error Occurred Provisioning The Master Database. This Is Usually Related To The Master Database Not Being In A Supported State. System.InvalidOperationException: 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.
at Microsoft.EntityFrameworkCore.Internal.DbContextServices.Initialize(IServiceProvider scopedProvider, DbContextOptions contextOptions, DbContext context)
at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices()
at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.get_Instance()
at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.get_Instance()
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetRelationalService[TService](IInfrastructure`1 databaseFacade)
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
at Oqtane.Infrastructure.DatabaseManager.MigrateMaster(InstallConfig install) in C:\Users\patri\Dropbox\Devs\InQAGroup\oqtane.framework-10.0.3\Oqtane.Server\Infrastructure\DatabaseManager.cs:line 293
I have just deployed an Oqtane app (created with the application template) version 10.0.4 to an Azure Web App (Linux, dotnet 10), and when trying to install it with the Azure SQL Server I provisioned, I get the error that @patrickjlee mentions.
An Error Occurred Provisioning The Master Database. This Is Usually Related To The Master Database Not Being In A Supported State. System.InvalidOperationException: 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. at Microsoft.EntityFrameworkCore.Internal.DbContextServices.Initialize(IServiceProvider scopedProvider, DbContextOptions contextOptions, DbContext context) at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices() at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider() at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure.get_Instance() at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure.get_Instance() at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetRelationalService[TService](IInfrastructure`1 databaseFacade) at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade) at Oqtane.Infrastructure.DatabaseManager.MigrateMaster(InstallConfig install)
The logs in the content folder are the same as previously shown in this issue.
I have tried with both Azure SQL and SQL Server choices in the Oqtane database configuration, and both fail in the same way. I've also tried using the connection string or the fields, and both fail.
This is not a network issue, as when I type an incorrect password, it fails properly due to authentication, so the Azure SQL server actually is accessible by the web site.
An Error Occurred Creating The Database. This Is Usually Related To Your User Not Having Sufficient Rights To Perform This Operation. Please Note That You Can Also Create The Database Manually Prior To Initiating The Install Wizard. Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user 'USER' ...
@mdmontesinos can you please explain how you deployed the Oqtane app that you created from the app template. This error is sometimes related to DLLs which are missing from the deployment.
@sbwalker I used the Publish option in Visual Studio to publish to the Azure Linux Web App.
This is the publish profile:
<?xml version="1.0" encoding="utf-8"?>
<!--This file is used by the publish/package process of your Web project. You can customize the behavior of this processby editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. -->
<Project>
<PropertyGroup>
<WebPublishMethod>ZipDeploy</WebPublishMethod>
<IsLinux>true</IsLinux>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<ResourceId>REDACTED</ResourceId>
<ResourceGroup>REDACTED</ResourceGroup>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<SiteUrlToLaunchAfterPublish>REDACTED</SiteUrlToLaunchAfterPublish>
<PublishProvider>AzureWebSite</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<ProjectGuid>REDACTED</ProjectGuid>
<PublishUrl>REDACTED</PublishUrl>
<UserName />
<_SavePWD>false</_SavePWD>
</PropertyGroup>
</Project>
@mdmontesinos I would suggest that you compare the list of DLLs which were deployed to Azure to the list of DLLs which exist locally in the /bin where (I assume) the application is running successfully.
@mdmontesinos have you ever deployed Oqtane successfully to an Azure Linux Web App previously? I have not tried this myself... I use a Windows App Services.
@sbwalker I have not deployed to a linux version before, only to Windows. I wanted to use linux this time due to the lower cost. However, others have mentioned previously that Oqtane can work in linux.
@sbwalker I have compared the DLLs, and the only differences are slightly different file sizes. However, there's a huge difference in size in the Microsoft.Data.SqlClient.dll:
@mdmontesinos I have no experience in this area (and I am buried with other tasks at the moment), so please share any details you discover on the journey.
@sbwalker I have just tried to install a fresh Oqtane 10.0.4 (same version I have in my app) with the Installer.zip in an Azure Linux Web App, using another Azure SQL Database, and it works fine, so I can confirm that this seems to be an issue when publishing an Oqtane app (with Visual Studio).
I compared the site wwwroot between the Oqtane app and the traditional Oqtane install, and these are the differences I found:
The app version does not contain the "runtimes" folder, because I assume it was specifically compiled for the target platform, but this might be affecting something?
The ".runtimeconfig.json", ".pdb", ".deps.json" and ".staticwebassets.endpoints.json" are now prefixed by "MyApp.Server/Client.Oqtane" instead of "Oqtane.Server/Client", but that should be expected
@sbwalker I just did another test publishing the Oqtane app to a Windows Azure Web App, and it also failed with the same error, so the issue is not related to the OS.
It seems that the new Application Template is not properly deployed.
For reference, I'm using a standard publish profile:
<?xml version="1.0" encoding="utf-8"?>
<!--This file is used by the publish/package process of your Web project. You can customize the behavior of this processby editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. -->
<Project>
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<ResourceId>REDACTED</ResourceId>
<ResourceGroup>REDACTED</ResourceGroup>
<PublishProvider>AzureWebSite</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>REDACTED</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>REDACTED</ProjectGuid>
<MSDeployServiceURL>REDACTED</MSDeployServiceURL>
<DeployIisAppPath>oqtane-test-w</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>true</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>true</EnableMSDeployBackup>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
<UserName />
<_SavePWD>false</_SavePWD>
<_DestinationType>AzureWebSite</_DestinationType>
<InstallAspNetCoreSiteExtension>false</InstallAspNetCoreSiteExtension>
</PropertyGroup>
</Project>
And analyzing the wwwroot folder, the windows version does actually contain the "runtimes" folder, so that is not the issue.
@sbwalker I was able to create a set of steps to consistently reproduce the issue, for the latest version of the Oqtane Application Template, in an Windows Azure Web App, using an Azure SQL Server.
Create a fresh project using the latest application template, and run it locally (with a localdb)
dotnet new uninstall Oqtane.Application.Template
dotnet new install Oqtane.Application.Template
dotnet new oqtane-app -o MyCompany.MyProject
cd MyCompany.MyProject
dotnet build
cd Server
dotnet run
IMPORTANT! Use the Module Manager to scaffold a module using the default module template, which is added to the solution. The azure installation only fails when at least one custom module has been created.
Create an Azure SQL Server and DB (I used SQL Authentication)
Create an Azure Web App, for .NET 10 with Windows
Enable Web Sockets and Always On
Add an appsettings.Production.json fresh file to the Server project so that it doesn't try to use the local installation
In Visual Studio, Right-Click the Server project, and Click Publish.
Select publishing to Azure App Service (Windows)
Publish the app and wait for it to start
Use Azure SQL as the DB provider and set the Connection String with the password
Fill the other fields
Click Install Now
The error should appear now
This set of steps allows reproducing consistently the error, when using the new application template, for either windows or linux web apps. This basically prevents from deploying oqtane apps developed with custom modules directly into them, which I assume most of them will.
EDIT: This error is actually not related to Azure SQL db. I just tested with a PostgreSQL database, hosted outside of Azure, and I still got the same error. Therefore, it has nothing to do with the chosen database provider, but rather on how the master database is being initialized when custom modules are included when installing for the first time. Perhaps as the tradicional Oqtane installer first initializes the master database, and then custom modules are installed through the UI, it does not handle properly this case. Does this make sense?
@mdmontesinos thank you for your thorough investigation. If I understand correctly, there are 3 key aspects to reproducing this issue:
It appears to be related to scaffolding a new module into the Oqtane Application
Since the Oqtane Application runs fine locally even after scaffolding a module into the solution, the issue is also somehow related to deployment.
It happens in the Azure environment. It is unknown at this point if it is also an issue in other environments
The combination of these 3 factors would lead me to believe that scaffolding a module into the Oqtane Application introduces additional dependencies which are not recognized by the standard Publishing workflow when you deploy the application. And the missing dependency is what causes the strange database error in the installation wizard when you run the application.
The question is how to validate this hypothesis or identify the missing dependency.
it is also not clear if it is related to any modification to the Oqtane Application (ie. adding a single razor component to the Client project) or specific to the internal module template. This needs to be investigated further.
The other challenge is that an Oqtane Application is designed to be extended with additional functionality... and I know that a variety of developers are successfully using this approach to develop and deploy Oqtane Applications. So why is it working for some people and not others?
@sbwalker I just tested publishing the folder and deploying it to Azure and the same issue occurs.
Are you able to reproduce the error with the steps I provided?
Also, it seems that the issue is not entirely for Azure or deployed apps, as, although I can't reproduce it locally, errors have been reported previously in dev environments (the original issue described here and #6169). This suggests that there's still some obscure behavior for Oqtane applications' install process.
EDIT
I was able to reproduce locally, without any Azure dependency, or custom module. I've actually pinpointed the error to having an appsettings.Production.json file to separately manage the production environment.
These are the new steps to reproduce:
Create a fresh project using the latest application template, you don't need to even run it
dotnet new uninstall Oqtane.Application.Template
dotnet new install Oqtane.Application.Template
dotnet new oqtane-app -o MyCompany.MyProject
IMPORTANT: Copy the appsettings.json file into a appsettings.Production.json file to the Server project, which will cause the installation in a Production environment to fail
In Visual Studio, Right-Click the Server project, and Click Publish
Select publishing to a folder, in Release Mode, and publish the app
@mdmontesinos I do not use the appsettings.Production.json approach, so there is no way I would have been able to identify this issue - thank you for the additional investigation. Have you used appsettings.Production.json successfully in the past ie. with the "standard" release version (Oqtane.Framework.10.1.2.Install.zip) rather than using the Application template? I am trying to understand if this is related to the Application template or if it is an issue that has existed for a long time that nobody has noticed because it is not the default configuration.
@sbwalker No, I have not used the appsettings.Production.json approach previously, but I simply assumed it would work as the Oqtane application template includes the configuration for it in the Program.cs:
Yes, it has been in the framework for a long time... but the problem with any non-default configuration is that it does not always get fully regression tested as the framework evolves (because there are so many configuration variations)... so it is possible that although it worked originally, it now has an issue based on more recent enhancements or differences in .NET.
@mdmontesinos the ConfigManager class which contains methods for updating the appsettings.json file does not appear to contain any logic to support multiple versions of the file:
public void AddOrUpdateSetting<T>(string key, T value, bool reload)
{
AddOrUpdateSetting("appsettings.json", key, value, reload);
}
@mdmontesinos this appsettings.json issue led me down a rabbit hole today...
appsettings.json files override one another based on the order they are declared in program.cs
there is a parameter on AddJsonFile which defines if a config file needs to exist or not - the appsettings.production.json is specified to be optional currently
an appsettings.production.json only needs to contain the specific key/values which need to be overridden in the appsettings.json - not ALL key/values
a value in appsettings.production.json will override the same key in appsettings.json, even if the value is blank or null
although an appsettings.production.json file is in the source code repo, the "official" Oqtane release does NOT include an appsettings.production.json file in the final ZIP package (it is removed from the output folder by release.cmd before zipping)
the Oqtane Application template does NOT include an appsettings.production.json file
The ConfigManager contains methods for editing config files (as .NET does not support this capability) - however it currently only supports "appsettings.json" - not variations
Linux is case sensitive when handling file names - so if environment.EnvironmentName returns "Production" then the filename should be "appsettings.Production.json" - not "appsettings.production.json" - or else the app will not find the file when running on Linux (Windows is case insensitive so it would be fine on that platform)
I believe what is happening is that you manually created an appsettings.production.json file in your Oqtane Application. It contains all of the standard sections with blank values. You deployed the app, which included the appsettings.production.json file. You run the app and the Install Wizard allows you to enter information... however when you click Install, the values are written to appsettings.json... and since the app is configured that appsettings.production.json should override appsettings.json, the app is using a blank connection string to try to connect to the database. This is resulting in the database error.
I believe some logic similar to below could be added to ConfigManager so that it supports variations of appsettings.json. The file itself would need to be created manually and deployed with the app.
@sbwalker Great analysis of the underlying problem! The solution seems appropriate to allow different appsettings per environment.
As a workaround, I ended up adding this configuration to my publish profile, in which I rename the appsettings.Production.json as appsettings.json to replace it, and this works fine.
@sbwalker Yes, this fixes the issue everywhere, as it wasn't actually related to the OS (or even Azure) at all, but rather the environment being Production with the appsettings.Production.json present. Replacing it like I showed in my previous comment works like a charm.
Activity
sbwalker commentedon Dec 29, 2025
This will require further investigation. Is this in a local environment or production environment?
patrickjlee commentedon Dec 29, 2025
Thanks - this is in a test (local) environment, so running the code locally (via running the Oqtane.Server project in debug mode), but pointing to database in SQL Azure.
sbwalker commentedon Dec 30, 2025
Can you please open the /Content/Log/error.log file and share the full error message which is in the log file (related to not being able to find the DbContext).
In reality the "Azure SQL" database provider is the exact same provider as the SQL Server provider - the only difference is that it has a slightly different UI component for capturing the connection string details. You can verify this by looking in your appsettings.json and scrolling to the "Azure SQL" section:
Notice the DBType is SQL Server. My guess is that you are encountering permissions issues when your development environment attempts to connect to Azure - perhaps the log will confirm.
patrickjlee commentedon Dec 30, 2025
Thanks. The full error message from the log file is:
[2025-12-30 15:21:36+00:00] [Error] [Oqtane.Infrastructure.DatabaseManager] An Error Occurred Provisioning The Master Database. This Is Usually Related To The Master Database Not Being In A Supported State. System.InvalidOperationException: 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.
at Microsoft.EntityFrameworkCore.Internal.DbContextServices.Initialize(IServiceProvider scopedProvider, DbContextOptions contextOptions, DbContext context)
at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices()
at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.get_Instance()
at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.get_Instance()
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetRelationalService[TService](IInfrastructure`1 databaseFacade)
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
at Oqtane.Infrastructure.DatabaseManager.MigrateMaster(InstallConfig install) in C:\Users\patri\Dropbox\Devs\InQAGroup\oqtane.framework-10.0.3\Oqtane.Server\Infrastructure\DatabaseManager.cs:line 293
mdmontesinos commentedon Apr 15, 2026
@sbwalker I'm facing the exact same issue.
I have just deployed an Oqtane app (created with the application template) version 10.0.4 to an Azure Web App (Linux, dotnet 10), and when trying to install it with the Azure SQL Server I provisioned, I get the error that @patrickjlee mentions.
An Error Occurred Provisioning The Master Database. This Is Usually Related To The Master Database Not Being In A Supported State. System.InvalidOperationException: 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. at Microsoft.EntityFrameworkCore.Internal.DbContextServices.Initialize(IServiceProvider scopedProvider, DbContextOptions contextOptions, DbContext context) at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices() at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider() at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure.get_Instance() at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure.get_Instance() at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetRelationalService[TService](IInfrastructure`1 databaseFacade) at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade) at Oqtane.Infrastructure.DatabaseManager.MigrateMaster(InstallConfig install)
The logs in the content folder are the same as previously shown in this issue.
I have tried with both Azure SQL and SQL Server choices in the Oqtane database configuration, and both fail in the same way. I've also tried using the connection string or the fields, and both fail.
This is not a network issue, as when I type an incorrect password, it fails properly due to authentication, so the Azure SQL server actually is accessible by the web site.
An Error Occurred Creating The Database. This Is Usually Related To Your User Not Having Sufficient Rights To Perform This Operation. Please Note That You Can Also Create The Database Manually Prior To Initiating The Install Wizard. Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user 'USER' ...
sbwalker commentedon Apr 15, 2026
@mdmontesinos can you please explain how you deployed the Oqtane app that you created from the app template. This error is sometimes related to DLLs which are missing from the deployment.
mdmontesinos commentedon Apr 15, 2026
@sbwalker I used the Publish option in Visual Studio to publish to the Azure Linux Web App.
This is the publish profile:
And using a blank appsettings.Production.json:
{ "RenderMode": "Static", "Runtime": "Server", "Database": { "DefaultDBType": "Oqtane.Database.SqlServer.SqlServerDatabase, Oqtane.Server" }, "ConnectionStrings": { "DefaultConnection": "" }, "Installation": { "DefaultAlias": "", "HostPassword": "", "HostEmail": "", "SiteTemplate": "", "DefaultTheme": "", "DefaultContainer": "" }, "Localization": { "DefaultCulture": "en" }, "AvailableDatabases": [ { "Name": "LocalDB", "ControlType": "Oqtane.Installer.Controls.LocalDBConfig, Oqtane.Client", "DBType": "Oqtane.Database.SqlServer.SqlServerDatabase, Oqtane.Server" }, { "Name": "SQL Server", "ControlType": "Oqtane.Installer.Controls.SqlServerConfig, Oqtane.Client", "DBType": "Oqtane.Database.SqlServer.SqlServerDatabase, Oqtane.Server" }, { "Name": "SQLite", "ControlType": "Oqtane.Installer.Controls.SqliteConfig, Oqtane.Client", "DBType": "Oqtane.Database.Sqlite.SqliteDatabase, Oqtane.Server" }, { "Name": "MySQL", "ControlType": "Oqtane.Installer.Controls.MySQLConfig, Oqtane.Client", "DBType": "Oqtane.Database.MySQL.MySQLDatabase, Oqtane.Server" }, { "Name": "PostgreSQL", "ControlType": "Oqtane.Installer.Controls.PostgreSQLConfig, Oqtane.Client", "DBType": "Oqtane.Database.PostgreSQL.PostgreSQLDatabase, Oqtane.Server" }, { "Name": "Azure SQL", "ControlType": "Oqtane.Installer.Controls.AzureSqlConfig, Oqtane.Client", "DBType": "Oqtane.Database.SqlServer.SqlServerDatabase, Oqtane.Server" } ], "Logging": { "FileLogger": { "LogLevel": { "Default": "Error" } }, "LogLevel": { "Default": "Information" } } }sbwalker commentedon Apr 15, 2026
@mdmontesinos I would suggest that you compare the list of DLLs which were deployed to Azure to the list of DLLs which exist locally in the /bin where (I assume) the application is running successfully.
sbwalker commentedon Apr 15, 2026
@mdmontesinos have you ever deployed Oqtane successfully to an Azure Linux Web App previously? I have not tried this myself... I use a Windows App Services.
mdmontesinos commentedon Apr 15, 2026
@sbwalker I have not deployed to a linux version before, only to Windows. I wanted to use linux this time due to the lower cost. However, others have mentioned previously that Oqtane can work in linux.
mdmontesinos commentedon Apr 15, 2026
@sbwalker I have compared the DLLs, and the only differences are slightly different file sizes. However, there's a huge difference in size in the Microsoft.Data.SqlClient.dll:
sbwalker commentedon Apr 15, 2026
@mdmontesinos I have no experience in this area (and I am buried with other tasks at the moment), so please share any details you discover on the journey.
mdmontesinos commentedon Apr 16, 2026
@sbwalker I have just tried to install a fresh Oqtane 10.0.4 (same version I have in my app) with the Installer.zip in an Azure Linux Web App, using another Azure SQL Database, and it works fine, so I can confirm that this seems to be an issue when publishing an Oqtane app (with Visual Studio).
I compared the site wwwroot between the Oqtane app and the traditional Oqtane install, and these are the differences I found:
mdmontesinos commentedon Apr 16, 2026
@sbwalker I just did another test publishing the Oqtane app to a Windows Azure Web App, and it also failed with the same error, so the issue is not related to the OS.
It seems that the new Application Template is not properly deployed.
For reference, I'm using a standard publish profile:
And analyzing the wwwroot folder, the windows version does actually contain the "runtimes" folder, so that is not the issue.
mdmontesinos commentedon Apr 16, 2026
@sbwalker I was able to create a set of steps to consistently reproduce the issue, for the latest version of the Oqtane Application Template, in an Windows Azure Web App, using an Azure SQL Server.
This set of steps allows reproducing consistently the error, when using the new application template, for either windows or linux web apps. This basically prevents from deploying oqtane apps developed with custom modules directly into them, which I assume most of them will.
EDIT: This error is actually not related to Azure SQL db. I just tested with a PostgreSQL database, hosted outside of Azure, and I still got the same error. Therefore, it has nothing to do with the chosen database provider, but rather on how the master database is being initialized when custom modules are included when installing for the first time. Perhaps as the tradicional Oqtane installer first initializes the master database, and then custom modules are installed through the UI, it does not handle properly this case. Does this make sense?
sbwalker commentedon Apr 16, 2026
@mdmontesinos thank you for your thorough investigation. If I understand correctly, there are 3 key aspects to reproducing this issue:
It appears to be related to scaffolding a new module into the Oqtane Application
Since the Oqtane Application runs fine locally even after scaffolding a module into the solution, the issue is also somehow related to deployment.
It happens in the Azure environment. It is unknown at this point if it is also an issue in other environments
The combination of these 3 factors would lead me to believe that scaffolding a module into the Oqtane Application introduces additional dependencies which are not recognized by the standard Publishing workflow when you deploy the application. And the missing dependency is what causes the strange database error in the installation wizard when you run the application.
The question is how to validate this hypothesis or identify the missing dependency.
it is also not clear if it is related to any modification to the Oqtane Application (ie. adding a single razor component to the Client project) or specific to the internal module template. This needs to be investigated further.
The other challenge is that an Oqtane Application is designed to be extended with additional functionality... and I know that a variety of developers are successfully using this approach to develop and deploy Oqtane Applications. So why is it working for some people and not others?
sbwalker commentedon Apr 16, 2026
@mdmontesinos have you tried publishing to a folder and then deploying the assets from that folder to Azure?
mdmontesinos commentedon Apr 17, 2026
@sbwalker I just tested publishing the folder and deploying it to Azure and the same issue occurs.
Are you able to reproduce the error with the steps I provided?
Also, it seems that the issue is not entirely for Azure or deployed apps, as, although I can't reproduce it locally, errors have been reported previously in dev environments (the original issue described here and #6169). This suggests that there's still some obscure behavior for Oqtane applications' install process.
EDIT
I was able to reproduce locally, without any Azure dependency, or custom module. I've actually pinpointed the error to having an appsettings.Production.json file to separately manage the production environment.
These are the new steps to reproduce:
sbwalker commentedon Apr 17, 2026
@mdmontesinos I do not use the appsettings.Production.json approach, so there is no way I would have been able to identify this issue - thank you for the additional investigation. Have you used appsettings.Production.json successfully in the past ie. with the "standard" release version (Oqtane.Framework.10.1.2.Install.zip) rather than using the Application template? I am trying to understand if this is related to the Application template or if it is an issue that has existed for a long time that nobody has noticed because it is not the default configuration.
mdmontesinos commentedon Apr 17, 2026
@sbwalker No, I have not used the appsettings.Production.json approach previously, but I simply assumed it would work as the Oqtane application template includes the configuration for it in the Program.cs:
sbwalker commentedon Apr 17, 2026
Yes, it has been in the framework for a long time... but the problem with any non-default configuration is that it does not always get fully regression tested as the framework evolves (because there are so many configuration variations)... so it is possible that although it worked originally, it now has an issue based on more recent enhancements or differences in .NET.
sbwalker commentedon Apr 17, 2026
@mdmontesinos the ConfigManager class which contains methods for updating the appsettings.json file does not appear to contain any logic to support multiple versions of the file:
sbwalker commentedon Apr 17, 2026
@mdmontesinos this appsettings.json issue led me down a rabbit hole today...
I believe what is happening is that you manually created an appsettings.production.json file in your Oqtane Application. It contains all of the standard sections with blank values. You deployed the app, which included the appsettings.production.json file. You run the app and the Install Wizard allows you to enter information... however when you click Install, the values are written to appsettings.json... and since the app is configured that appsettings.production.json should override appsettings.json, the app is using a blank connection string to try to connect to the database. This is resulting in the database error.
I believe some logic similar to below could be added to ConfigManager so that it supports variations of appsettings.json. The file itself would need to be created manually and deployed with the app.
mdmontesinos commentedon Apr 20, 2026
@sbwalker Great analysis of the underlying problem! The solution seems appropriate to allow different appsettings per environment.
As a workaround, I ended up adding this configuration to my publish profile, in which I rename the appsettings.Production.json as appsettings.json to replace it, and this works fine.
sbwalker commentedon Apr 20, 2026
@mdmontesinos did this also address the issue with deploying Oqtane on Linux on Azure?
mdmontesinos commentedon Apr 20, 2026
@sbwalker Yes, this fixes the issue everywhere, as it wasn't actually related to the OS (or even Azure) at all, but rather the environment being Production with the appsettings.Production.json present. Replacing it like I showed in my previous comment works like a charm.
fix oqtane#5933 - provide support for environment-based appsettings.json
Merge pull request #6182 from sbwalker/dev