Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
//
using Azure.Core;
using Microsoft.Extensions.Configuration.AzureAppConfiguration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
Expand Down Expand Up @@ -63,6 +64,44 @@ public static IConfigurationBuilder AddAzureAppConfiguration(
return configurationBuilder.AddAzureAppConfiguration(options => options.Connect(connectionStrings), optional);
}

/// <summary>
/// Adds key-value data from an Azure App Configuration store to a configuration builder.
/// </summary>
/// <param name="configurationBuilder">The configuration builder to add key-values to.</param>
/// <param name="endpoint">The endpoint used to connect to the configuration store.</param>
/// <param name="credential">The token credential used to authenticate requests to the configuration store.</param>
/// <param name="optional">Determines the behavior of the App Configuration provider when an exception occurs while loading data from server. If false, the exception is thrown. If true, the exception is suppressed and no settings are populated from Azure App Configuration.
/// <exception cref="ArgumentException"/> will always be thrown when the caller gives an invalid input configuration (connection strings, endpoints, key/label filters...etc).
/// </param>
/// <returns>The provided configuration builder.</returns>
public static IConfigurationBuilder AddAzureAppConfiguration(
this IConfigurationBuilder configurationBuilder,
Uri endpoint,
TokenCredential credential,
bool optional = false)
{
return configurationBuilder.AddAzureAppConfiguration(options => options.Connect(endpoint, credential), optional);
}

/// <summary>
/// Adds key-value data from an Azure App Configuration store to a configuration builder.
/// </summary>
/// <param name="configurationBuilder">The configuration builder to add key-values to.</param>
/// <param name="endpoints">The list of endpoints used to connect to the configuration store and its replicas.</param>
/// <param name="credential">The token credential used to authenticate requests to the configuration store.</param>
/// <param name="optional">Determines the behavior of the App Configuration provider when an exception occurs while loading data from server. If false, the exception is thrown. If true, the exception is suppressed and no settings are populated from Azure App Configuration.
/// <exception cref="ArgumentException"/> will always be thrown when the caller gives an invalid input configuration (connection strings, endpoints, key/label filters...etc).
/// </param>
/// <returns>The provided configuration builder.</returns>
public static IConfigurationBuilder AddAzureAppConfiguration(
this IConfigurationBuilder configurationBuilder,
IEnumerable<Uri> endpoints,
TokenCredential credential,
bool optional = false)
{
return configurationBuilder.AddAzureAppConfiguration(options => options.Connect(endpoints, credential), optional);
}

/// <summary>
/// Adds key-value data from an Azure App Configuration store to a configuration builder.
/// </summary>
Expand Down
Loading