I have built two test net core mvc test apps using Microsoft tutorials.
Build an app that uses a connection string for using Azure App Configuration
Quickstart: Create an ASP.NET Core app with Azure App Configuration
Build an app that uses managed identity for using Azure App Configuration (my app TestAppConfigMi)
The first test works running locally using a connection string. The second has errors that indicate the Azure App Configuration endpoint or clientid is null.
- the endpoints are the same for both apps
- the clientid may not be correct but is present in the second app
I don't have much experience. My troubleshooting process has been:
- TestAppConfigMi project builds locally in Visual Studio
- In Azure browser launches with HTTP 500.30
Azure diagnostics
Application: w3wp.exe
CoreCLR Version: 5.0.921.35908
.NET Version: 5.0.9
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException: Value cannot be null. (Parameter 'uriString')
at System.Uri..ctor(String uriString)
at TestAppConfigMi.Program.<>c__DisplayClass1_0.<CreateHostBuilder>b__2(AzureAppConfigurationOptions options) in D:\a\TestAppConfigMi\TestAppConfigMi\Program.cs:line 29
at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationSource.<>c__DisplayClass3_0.<.ctor>b__0()
at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationSource.Build(IConfigurationBuilder builder)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at TestAppConfigMi.Program.Main(String[] args) in D:\a\TestAppConfigMi\TestAppConfigMi\Program.cs:line 17
In Program.cs (line 29)
options.Connect(new Uri(settings["AppConfig:Endpoint"]), new ManagedIdentityCredential("26e962f7-1a26-4f11-84d4-3bfcdd9f7dcc"))
(line 17)
CreateHostBuilder(args).Build().Run();
In Visual Studio AppConfig:Endpoint in appsettings.json
"AppConfig": {
"Endpoint": "xxxx"
is the same as that of secrets.json in the first working app
{
"ConnectionStrings:AppConfig": "Endpoint=xxxxx"
}
There are two packages installed: Azure.Identity 1.5.0 Microsoft.Azure.AppConfiguration.AspNetCore 4.5.0
The debug reference is an identifier being null. Whichever way I look at it there is a value present. So I would expect a "not found" or "wrong credentials" type message. Not the app failing as it does.