After configuring the Azure Key Vault and publishing my app, the application is working properly from the website. However, when i tried to run it on my local machine using VS2019 debugger, I am getting the following error. However, if I comment out the "ConfigureAppConfiguration()" method, I am able to run the application on my local machine.
I am guessing that i am supposed to maybe save the "vaultUri" somewhere in my code. Any pointers is greatly appreciated.
Thanks in advance,
Samuel
=====================================================================================
ArgumentNullException: Value cannot be null. (Parameter 'uriString')
System.Uri..ctor(string uriString)
ArgumentNullException: Value cannot be null. (Parameter 'uriString')
System.Uri..ctor(string uriString)
RogersSalesPortal1.Program+<>c.<CreateHostBuilder>b__1_0(HostBuilderContext context, IConfigurationBuilder config) in Program.cs
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((context, config) =>
{
var keyVaultEndpoint = new Uri(Environment.GetEnvironmentVariable("VaultUri"));
config.AddAzureKeyVault(
keyVaultEndpoint,
new DefaultAzureCredential());
})
.ConfigureWebHostDefaults(webBuilder =>
{
Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
Microsoft.Extensions.Hosting.HostBuilder.Build()
RogersSalesPortal1.Program.Main(string[] args) in Program.cs
+
CreateHostBuilder(args).Build().Run();
=====================================================================================
