I have installed and configured Azure Key Vault in my appsettings.json and my appsettings.staging.json have the connection strings absent as these JSON files I assumed would be used when publishing my application to Azure AppService. My appsettings.development.json contains the local connection strings so that I can continue agile development on my local system. When Creating or Updating a Database Connection in Radzen Blazor Studio, I find a peculiar error. See below:
Format of the initialization string does not conform to specification starting at index 0.
at Microsoft.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
at Microsoft.Data.Common.DbConnectionOptions.ParseInternal(Dictionary2 parsetable, String connectionString, Boolean buildChain, Dictionary
2 synonyms, Boolean firstKey)
at Microsoft.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
at Microsoft.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at Microsoft.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
at Microsoft.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
at Microsoft.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at Microsoft.EntityFrameworkCore.SqlServer.Scaffolding.Internal.SqlServerDatabaseModelFactory.Create(String connectionString, DatabaseModelFactoryOptions options)
at Radzen.Server.DatabaseService.Infer(InferDatabaseRequest request)
at Radzen.Server.SolutionFacade.InferDatabase(DatabaseService databaseService, InferDatabaseRequest request)
at Radzen.Server.ProgramController.InferDatabase(InferDatabaseRequest request)
at lambda_method274(Closure, Object, Object[])
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
In my appsettings.json and my appsettings.staging.json I have listed the connection strings and azure key vault URI as follows:
{
"AzureKeyVaultUrl": "https://visionsuiteaccounting-kv.vault.azure.net/",
"ConnectionStrings": {
"ApexDbConnection": "",
"VisionDbConnection": ""
},
and in my appsettings.development.json as:
"AzureKeyVaultUrl": "",
"ConnectionStrings": {
"ApexDbConnection": "Server=FASTTRAKMOBILE;Connection Timeout=30;Persist Security Info=False;TrustServerCertificate=True;Integrated Security=True;Encrypt=True;Initial Catalog=Apex;",
"VisionDbConnection": "Server=FASTTRAKMOBILE;Connection Timeout=30;Persist Security Info=False;TrustServerCertificate=True;Integrated Security=True;Encrypt=True;Initial Catalog=Vision;"
},
I assumed that since I use debug mode in Radzen Blazor Studio predominantly, only the appsettings.development.json was important. Is this not the case? Do I need to mimic the local connection strings in all the files? Please advise.