Skip to content

System.ArgumentOutOfRangeException List of configured name servers must not be empty. Parameter name: servers #669

Open

Description

I have upgraded the Microsoft.Extensions.Configuration.AzureAppConfiguration nuget package from 6.0.0 to 8.0.0 now I am getting the below crash from our clients.

`async Task<IDnsQueryResponse> LookupClient.QueryInternalAsync(DnsQuestion question, DnsQuerySettings queryOptions, IReadOnlyCollection<NameServer> servers, CancellationToken cancellationToken)
In App
Assembly:DnsClient Version:1.7.0.0 PublicKeyToken:4574bb5573c51424`
Called from: async Task<IEnumerable<SrvRecord>> SrvLookupClient.InternalQueryAsync(string srvDns, CancellationToken cancellationToken)
async Task<IEnumerable<SrvRecord>> SrvLookupClient.QueryAsync(string host, CancellationToken cancellationToken)
async Task ConfigurationClientManager.RefreshFallbackClients(CancellationToken cancellationToken)
async Task ConfigurationClientManager.DiscoverFallbackClients()

System.ArgumentOutOfRangeException: List of configured name servers must not be empty.
Parameter name: servers
Exception fatal 08:56:28.941 PM
A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.

Below is the CDN configuration, we are connecting the feature flag via CDN link

private const string DefaultConnectionString = "Endpoint=https://xxxxxx-edge.azureedge.net;Id=0;Secret=MA==";

configurationBuilder.AddAzureAppConfiguration(options =>
{
    // To connect with feature flag CDN edge.
    options.Connect(this.connectionString);
    options.UseFeatureFlags(config => config.SetRefreshInterval(this.Configuration.ConfigurationRefreshInterval));
    this.configurationRefresher = options.GetRefresher();
}, true);

var serviceCollection = new ServiceCollection();
serviceCollection.Configure<FeatureManagementOptions>(options =>
{
    options.IgnoreMissingFeatures = false;
    // The 'IgnoreMissingFeatureFilters' flag cannot be used in combination with a feature of requirement type 'All'.
    options.IgnoreMissingFeatureFilters = false;                
});

serviceCollection.AddSingleton<IConfiguration>(configuration)
    .AddFeatureManagement()
    .AddFeatureFilter<ContextualTargetingFilter>()
    .AddFeatureFilter<DeviceFilter>();

var seviceProvider = serviceCollection.BuildServiceProvider();
this.featuremanager = seviceProvider.GetService<IFeatureManager>();

During the initialization of SDK throws the above exception.

Could you please let me know how do I fix this issue? I also see the latest version 8.2.0, is it fixed in the latest version?

Thanks,
Sathishkumar

Activity

  1. sathishkumarkaliavaradhan commented on May 26, 2025

    @sathishkumarkaliavaradhan
    Author
  2. RichardChen820 commented on May 27, 2025

    @RichardChen820
    Member

    This is a new feature introduced in v7.1.0 — auto replica discovery. From the error, it appears that your server is likely not configured with a name server. The .NET provider should handle this case, if no name servers can be found, replica discovery should be skipped.

    As a workaround at this moment, you can set options.ReplicaDiscoveryEnabled = false to disable this feature.
    For more details, see:
    https://learn.microsoft.com/en-us/azure/azure-app-configuration/howto-geo-replication?tabs=dotnet#automatic-replica-discovery

  3. zhiyuanliang-ms commented on May 27, 2025

    @zhiyuanliang-ms
    Member
    private const string DefaultConnectionString = "Endpoint=https://xxxxxx-edge.azureedge.net;Id=0;Secret=MA==";
    
    configurationBuilder.AddAzureAppConfiguration(options =>
    {
        // To connect with feature flag CDN edge.
        options.Connect(this.connectionString);
        options.UseFeatureFlags(config => config.SetRefreshInterval(this.Configuration.ConfigurationRefreshInterval));
        this.configurationRefresher = options.GetRefresher();
    }, true);

    Your code snippet is interesting, I believe that the format: "Endpoint=xxx;Id=xxx;Secret=xxx" is only accepted by App Config SDK. Here is the code implementation. We are using HMAC authentication when using connection string. I am curious what is the Id and Secret part in your connection string with endpoint pointed to your CDN.

    Did you just copy the id and secret from your original connection string of your App Config store?

    How do you implement/configure your "Azure Edge" cdn?

  4. sathishkumarkaliavaradhan commented on May 27, 2025

    @sathishkumarkaliavaradhan
    Author

    Thanks Richard chen (@RichardChen820) for your response. I will try to disable this feature.

    Zhiyuan Liang (@zhiyuanliang-ms) We have followed the Microsoft recommendation from below document and worked fine before upgrading the SDK version to 8.0.0

    Edge delivery setup for Azure AppConfiguration (1).docx

    Did you just copy the id and secret from your original connection string of your App Config store?
    No, I just used the string ";Id=0;Secret=MA==" which mentioned on the above document.

    Should i use only CDN endpoint Url only without Id and Secret parameter in connection string?
    "Endpoint=https://xxxxxx-edge.azureedge.net"

    How do you implement/configure your "Azure Edge" cdn?
    I have followed the attached MS recommendation to configure the CDN.

    Please let me know if there is any change in the original recommendation.

    Thanks,
    Sathishkumar

  5. sathishkumarkaliavaradhan commented on May 28, 2025

    @sathishkumarkaliavaradhan
    Author

    Zhiyuan Liang (@zhiyuanliang-ms) could you please let me know the recommended way to connect/configure your "Azure Edge" cdn?

  6. zhiyuanliang-ms commented on May 29, 2025

    @zhiyuanliang-ms
    Member

    Hi, Sathishkumar Kaliavaradhan (@sathishkumarkaliavaradhan)

    Azure Front Door recently made authentication with managed identity public preview. We are working on our CDN solution. We have PR #601. I believe the solution will be out in one month.

    For now, you can reference the implementation in #601 where we used an empty token credential. CDN should work as a proxy between client and App Config service. When client talks with CDN, I suppose there is no authentication, but it depends on how you implement your CDN.

  7. avanigupta commented on May 29, 2025

    @avanigupta
    Member

    Sathishkumar Kaliavaradhan (@sathishkumarkaliavaradhan) did the workaround to disable replica discovery fix your issue?
    If yes, I think you can continue using the CDN setup with dummy connection string like you have today. Our original recommendation from the doc you linked has not changed.

    Additionally, as Zhiyuan Liang (@zhiyuanliang-ms) pointed out, we are working on officially supporting a more seamless integration with CDN where you wouldn't need to worry about dummy credentials or a gateway like Azure Functions for authentication. When that is released, we will provide new documentation on how to set it up.

  8. sathishkumarkaliavaradhan commented on Jun 2, 2025

    @sathishkumarkaliavaradhan
    Author

    Avani Gupta (@avanigupta) Thanks for your reply.

    I couldn't reproduce this issue locally on my machine but we are getting the telemetry from customer machine. For now I disabling disable replica discovery and monitoring it. I will update you if it's still happening in our customer environment.

    Let me know once the documentation gets updated for CDN edge connectivity, I will upgrade the NuGet package to connect the CDN using the different methods.

  9. avanigupta commented on Nov 25, 2025

    @avanigupta
    Member

    Hello Sathishkumar Kaliavaradhan (@sathishkumarkaliavaradhan), we’re excited to announce that Azure Front Door is now supported with Azure App Configuration!
    You can find detailed setup instructions in our announcement post here: Azure/AppConfiguration-Announcements#46

    We’d love your feedback and any suggestions to help us improve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions