From e880749ca87dab611038503a679a6ac010475c9f Mon Sep 17 00:00:00 2001 From: Jorge Burgos Date: Wed, 5 Feb 2025 21:54:18 -0500 Subject: [PATCH] Adjust settings for connecting to multiple databases --- ef-migration/src/Strata.Code.Web/Program.cs | 2 +- .../Properties/launchSettings.json | 84 +++++++++++-------- .../appsettings.Development.json | 13 +-- .../Strata.Code.Web/appsettings.Staging.json | 11 +++ .../src/Strata.Code.Web/appsettings.json | 5 +- 5 files changed, 68 insertions(+), 47 deletions(-) create mode 100644 ef-migration/src/Strata.Code.Web/appsettings.Staging.json diff --git a/ef-migration/src/Strata.Code.Web/Program.cs b/ef-migration/src/Strata.Code.Web/Program.cs index f51801c..e64eb79 100644 --- a/ef-migration/src/Strata.Code.Web/Program.cs +++ b/ef-migration/src/Strata.Code.Web/Program.cs @@ -35,7 +35,7 @@ builder.Services.AddScoped diff --git a/ef-migration/src/Strata.Code.Web/Properties/launchSettings.json b/ef-migration/src/Strata.Code.Web/Properties/launchSettings.json index d53f34a..3539547 100644 --- a/ef-migration/src/Strata.Code.Web/Properties/launchSettings.json +++ b/ef-migration/src/Strata.Code.Web/Properties/launchSettings.json @@ -1,41 +1,51 @@ { - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:27409", - "sslPort": 44329 - } - }, - "profiles": { - "http": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "http://localhost:5247", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:27409", + "sslPort": 44329 + } }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:7241;http://localhost:5247", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "profiles": { + "http_Development": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5247", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "http_Staging": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5247", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Staging" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7241;http://localhost:5247", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } } - } } diff --git a/ef-migration/src/Strata.Code.Web/appsettings.Development.json b/ef-migration/src/Strata.Code.Web/appsettings.Development.json index 0c208ae..445bd44 100644 --- a/ef-migration/src/Strata.Code.Web/appsettings.Development.json +++ b/ef-migration/src/Strata.Code.Web/appsettings.Development.json @@ -1,8 +1,11 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "ConnectionStrings": { + "DefaultConnection": "Server=54.71.217.228,1433;Database=st_dev_database;User=sa;Password=YourStrong@Passw0rd;TrustServerCertificate=True;" } - } } diff --git a/ef-migration/src/Strata.Code.Web/appsettings.Staging.json b/ef-migration/src/Strata.Code.Web/appsettings.Staging.json new file mode 100644 index 0000000..4b2d0ce --- /dev/null +++ b/ef-migration/src/Strata.Code.Web/appsettings.Staging.json @@ -0,0 +1,11 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "ConnectionStrings": { + "DefaultConnection": "Server=54.71.217.228,1433;Database=st-database;User=sa;Password=YourStrong@Passw0rd;TrustServerCertificate=True;" + } +} diff --git a/ef-migration/src/Strata.Code.Web/appsettings.json b/ef-migration/src/Strata.Code.Web/appsettings.json index f37fe5f..23160a4 100644 --- a/ef-migration/src/Strata.Code.Web/appsettings.json +++ b/ef-migration/src/Strata.Code.Web/appsettings.json @@ -5,8 +5,5 @@ "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "*", - "ConnectionStrings": { - "DefaultConnection": "Server=54.71.217.228,1433;Database=st-database;User=sa;Password=YourStrong@Passw0rd;TrustServerCertificate=True;" - } + "AllowedHosts": "*" }