惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
B
Blog
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Jina AI
Jina AI
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
L
LangChain Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
F
Fortinet All Blogs
H
Help Net Security
B
Blog RSS Feed
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
S
SegmentFault 最新的问题

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Dynamic Configuration with Azure App Configuration
Martyn Coupl · 2026-04-22 · via DEV Community

Azure App Configuration provides a service to centrally manage application settings and feature flags. Modern programs, especially programs running in a cloud, generally have many components that are distributed in nature.


In this post, we are going to take a look at not just dynamic configuration with Azure App Configuration, but we are going to look at using labels to further increase the level of dynamic configuration.

Using labels allows you, for example to provision environment specific settings in one place, while using environment variables to easily retrieve per-environment configuration values. You could also create different profiles using labels, it’s the same concept, just using a different key instead of the environment name.

First of all, let’s look at two samples of retrieving label specific configurations with both .NET and TypeScript.

Calling label specific configurations with .NET

First of all, in .NET you will require the package Microsoft.Extensions.Configuration.AzureAppConfiguration. Using the dotnet CLI, you can do this with the following. Other Package Managers are also available!

dotnet add package Microsoft.Extensions.Configuration.AzureAppConfiguration

Enter fullscreen mode Exit fullscreen mode

Configuring the connection to Azure App Configuration can be done using an environment variable with the connection string.

var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddAzureAppConfiguration(options => {
options.Connect(builder.Configuration.GetConnectionString("APPCONFIG_CONNECTION_STRING"))
    .Select(KeyFilter.Any, LabelFilter.Null)
    .Select(KeyFilter.Any, "<filter label>");
});

Enter fullscreen mode Exit fullscreen mode

The first Select method loads all labels which have a null filter, this means any configurations which are not specifically labelled, will be loaded. The second Select filter, will load any configurations which have the specified label defined.

For an environment based approach to loading configurations, you can use the environment manager to load the current environment, using the following property builder.Environment.EnvironmentName.

Your configuration settings are then accessed through the normal _IConfiguration _interface.

For other approaches, you would simply enter the value of the filter label name in the Select method and load in that specific profile. That could come from another dynamic source, maybe a database, or even Redis cache for example.

Calling label specific configurations with TypeScript

The same principles as above can be achieved using the JavaScript SDK as well. This allows you to work with React or even Angular based applications. First of all, just like in .NET, you will need to load in the package, the following will achieve this using NPM.

npm install @azure/app-configuration

Enter fullscreen mode Exit fullscreen mode

The next step is to include a reference to this package in your TypeScript file, you can do this using the following line.

import { AppConfigurationClient } from "@azure/app-configuration";

Enter fullscreen mode Exit fullscreen mode

Let’s now set some variables to allow us to connect to Azure App Configuration, and set our key to retrieve.

const connectionString = process.env["APPCONFIG_CONNECTION_STRING"] || "<connection string>";
const client = new AppConfigurationClient(connectionString);

const configKey = "Samples:Endpoint:Url";
const labelKey = process.env["ENVIRONMENT"] || "Development";

Enter fullscreen mode Exit fullscreen mode

As before with .NET, these lines set the connection string, either from an environment variable or by passing in the string manually. We are also setting the label key we are looking for as well. This is used in combination with the configKey.

const betaEndpoint = await client.getConfigurationSetting({ key: configKey, label: labelKey, label: labelKey });

Enter fullscreen mode Exit fullscreen mode