Home > Software design >  Identity Micro-services unable connect to SQL Server database
Identity Micro-services unable connect to SQL Server database

Time:01-03

A micro-services architecture based solution developed in .NET Core 3.1 / EF Core 3.1 / OpenIddict 2.1, works fine in development environment.

But in the client environment (Windows Server 2012 R2, with Server Hardening), Identity micro service couldn't able to connect to the SQL Server 2014 database server, and LINQ code which fetches data from the database does not throw any exception.

Startup.cs, database connection code

services.AddDbContext<IdentityDbContext>(options =>
        {
            options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"));
            options.UseOpenIddict();
        });

Using a sample console app (developed in .NET Core 3.1 / EF Core 3.1) able to connect to the client database, this is to verify whether server hardening causes any problem on Windows Server 2012 R2/.NET Core 3.1/EF Core 3.1.

What is causing the database connect problem in Identity micro services? Any help would be greatly appreciated, thanks.

CodePudding user response:

Basically, a named instance caused the problem, had to uninstall and reinstall the named instance.

  • Related