Shaunebu.Azure.AppConfiguration 1.0.1

dotnet add package Shaunebu.Azure.AppConfiguration --version 1.0.1
                    
NuGet\Install-Package Shaunebu.Azure.AppConfiguration -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Shaunebu.Azure.AppConfiguration" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shaunebu.Azure.AppConfiguration" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Shaunebu.Azure.AppConfiguration" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Shaunebu.Azure.AppConfiguration --version 1.0.1
                    
#r "nuget: Shaunebu.Azure.AppConfiguration, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Shaunebu.Azure.AppConfiguration@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Shaunebu.Azure.AppConfiguration&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Shaunebu.Azure.AppConfiguration&version=1.0.1
                    
Install as a Cake Tool

Shaunebu.Azure.AppConfiguration 🌐✨

NuGet Version NET Support NET Support NET Support

A flexible library for interacting with Azure App Configuration. Supports CRUD operations, key searches, multiple environments, and file serialization in JSON/XML.


🚀 Installation

Add the library to your project via NuGet:

dotnet add package Shaunebu.Azure.AppConfiguration

Reference: Azure App Configuration Documentation


⚡ Initialization

Initialize the service with your environment configurations (ConfigurationDto) and optionally set a default environment:

using Shaunebu.Azure.AppConfiguration.Models;
using Shaunebu.Azure.AppConfiguration.Services;

var configurations = new List<ConfigurationDto>()
{
    new ConfigurationDto
    {
        Environment = "DEV",
        AzureAppConfigConnectionString = "Endpoint=DEV_URL;Id=...;Secret=...",
        JsonFileName = "Config-DEV.json",
        XmlFileName = "Config-DEV.xml",
        AllJsonFileName = "Config-All.json",
        AllXmlFileName = "Config-All.xml"
    },
    new ConfigurationDto
    {
        Environment = "PROD",
        AzureAppConfigConnectionString = "Endpoint=PROD_URL;Id=...;Secret=...",
        JsonFileName = "Config-PROD.json",
        XmlFileName = "Config-PROD.xml",
        AllJsonFileName = "Config-All.json",
        AllXmlFileName = "Config-All.xml"
    }
};

// Initialize service
AppConfigurationService.Instance.Initialize(configurations, defaultEnvironment: "DEV");

🔑 Main Properties

Property Type Description
CurrentEnvironment string Default environment used if environment parameter is not passed
_environments Dictionary<string, ConfigurationDto> Stores all initialized environments for the service

🛠 CRUD Operations

📥 Get Configurations

Method Description Default Behavior
GetAllConfigurationByEnvironment() Get all settings for a single environment Uses CurrentEnvironment
GetAllConfigurations() Get all settings from all environments Loops through _environments.Values
var devConfigs = AppConfigurationService.Instance.GetAllConfigurationByEnvironment();
var allConfigs = AppConfigurationService.Instance.GetAllConfigurations();

🔍 Search Keys

Method Description
SearchKeyByEnvironment(string key) Search for a key in a specific environment
SearchKeyOnAllEnvironments(string key) Search for a key across all initialized environments
var featureToggle = AppConfigurationService.Instance.SearchKeyOnAllEnvironments("FeatureToggle");

➕ Add Configurations

// Single key in CurrentEnvironment
AppConfigurationService.Instance.AddConfiguration("FeatureXEnabled", "true", "Features");

// Single key in PROD
AppConfigurationService.Instance.AddConfiguration("FeatureXEnabled", "true", "Features", environment: "PROD");

// Multiple keys
var keyValues = new Dictionary<string, object>
{
    { "Key1", "Value1" },
    { "Key2", "Value2" }
};
AppConfigurationService.Instance.AddConfigurations("MyLabel", keyValues, environment: "DEV");

✏️ Update Configurations

AppConfigurationService.Instance.UpdateConfiguration("FeatureXEnabled", "false", "Features");
AppConfigurationService.Instance.UpdateConfigurations("MyLabel", keyValues, environment: "PROD");

🗑 Delete Configurations

// Single key
AppConfigurationService.Instance.DeleteConfiguration("FeatureXEnabled", "Features");

// Multiple keys
AppConfigurationService.Instance.DeleteConfigurations("MyLabel", keyValues);

// Delete a section
AppConfigurationService.Instance.DeleteEntireConfigurationSection("Features", "FeatureX", environment: "PROD");

💾 Serialization & File Saving

Both GetAllConfigurationByEnvironment and GetAllConfigurations support JSON and XML output, optionally saving to disk:

var serialized = AppConfigurationService.Instance.GetAllConfigurationByEnvironment(
    saveFile: true, 
    label: "MyLabel", 
    serialization: SerializationTypes.Json
);
Option Output
SerializationTypes.Json .json file
SerializationTypes.Xml .xml file

File paths are configured per ConfigurationDto.


⚖️ Feature Comparison: Shaunebu.Azure.AppConfiguration vs Azure SDK

Feature Shaunebu.Azure.AppConfiguration 🌐 Azure SDK Official ⚡
Multiple environments support ✅ Dynamically manage multiple environments via ConfigurationDto ❌ Requires manual connection string management
CRUD operations ✅ Add, Update, Delete, Get, Search, Delete Section ✅ Basic CRUD
Key search across environments SearchKeyOnAllEnvironments() ❌ Must loop manually
Section deletion DeleteEntireConfigurationSection() ❌ Not provided natively
Serialization to files ✅ JSON & XML ❌ No built-in support
Lazy Singleton instance AppConfigurationService.Instance ❌ Must instantiate manually
Default/current environment CurrentEnvironment property ❌ No built-in default tracking
Multi-label queries ✅ Supports label filtering easily ✅ Supported but requires manual coding
File saving ✅ Automatic saving to configured paths ❌ Manual file operations needed
Decoupled from enums ✅ Fully string-based environment keys ❌ May require custom enums or constants

Tip: Shaunebu.Azure.AppConfiguration is designed for multi-environment enterprise scenarios and simplifies working with Azure App Configuration without writing repetitive boilerplate code.


📌 Example Usage

// Initialize
AppConfigurationService.Instance.Initialize(configurations, "DEV");

// Get all settings for default environment
var devConfigs = AppConfigurationService.Instance.GetAllConfigurationByEnvironment();

// Search key across all environments
var keyResults = AppConfigurationService.Instance.SearchKeyOnAllEnvironments("FeatureToggle");

// Add a new key in PROD
AppConfigurationService.Instance.AddConfiguration("FeatureXEnabled", "true", "Features", "PROD");

// Update key in DEV
AppConfigurationService.Instance.UpdateConfiguration("FeatureXEnabled", "false", "Features");

// Delete key in CurrentEnvironment
AppConfigurationService.Instance.DeleteConfiguration("FeatureXEnabled", "Features");

🚀 Platform Support

Your library is compatible with multiple platforms thanks to .NET 6+ and the Azure.Data.AppConfiguration SDK:

Platform Support Notes
🖥 Windows ✅ Full Console, WPF, WinForms, MAUI
🐧 Linux ✅ Full Console apps, APIs, microservices
🍏 macOS ✅ Full Console apps, MAUI, Blazor
📱 iOS ✅ Full MAUI apps, via backend proxy for connection strings
🤖 Android ✅ Full MAUI apps, via backend proxy for connection strings
🌐 Blazor Server ✅ Full Safe to use with secret keys
🌐 Blazor WebAssembly ⚠️ Partial Avoid storing connection strings on client-side; use backend proxy
🌐 ASP.NET / ASP.NET Core ✅ Full APIs, web apps, microservices

✅ Advantages

  • Fully decoupled from enums like EnvironmentTypes

  • Manage multiple environments dynamically

  • Full CRUD support, including key searches and section deletion

  • Supports serialization to JSON/XML and saving to disk

  • Designed for multi-environment enterprise scenarios

References:

  • Azure App Configuration Official Docs

  • Azure App Configuration SDK for .NET

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 196 9/23/2025
1.0.0 190 9/23/2025

Initial release with multi-environment support and CRUD operations for Azure App Configuration.