fcatae/Arda

secrets.template.json doesn't works on local environment

Closed this issue · 1 comments

The current secrets.template.json doesn't works for local environments (for development scenarios, for example). The following error is being returned by dotnet:

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: uriString
at System.Uri..ctor(String uriString)
at Arda.Common.Utils.Util.SetEnvironmentVariables(IConfiguration config) in /Users/fabricio/Documents/Microsoft/Projects/Arda/src/Arda.Main/Util.cs:line 299
at Arda.Main.Startup..ctor(IHostingEnvironment env) in /Users/fabricio/Documents/Microsoft/Projects/Arda/src/Arda.Main/Startup.cs:line 39
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
at Microsoft.AspNetCore.Hosting.Internal.StartupLoader.LoadMethods(IServiceProvider hostingServiceProvider, Type startupType, String environmentName)
at Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.<>c__DisplayClass1_0.b__1(IServiceProvider sp)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass16_0.b__0(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureStartup()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()

Solved!
The solution was the addition of the following lines inside secrets.json file:
"Endpoints_ardaapp": "",
"Endpoints_kanban_service": "",
"Endpoints_permissions_service": "",
"Endpoints_reports_service": ""

You can see the updated template following this link: https://github.com/DXBrazil/Arda/blob/master/templates/secrets.template.json