Skip to content

kyleoettle/feature_flags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feature Flags Demo (.NET 9.0)

Created as part of this blog post: https://www.oettle.me/blog/targeted-feature-flags

This project demonstrates feature flag management in a .NET 9.0 Web API using Azure App Configuration and Microsoft.FeatureManagement. It supports user targeting and dynamic feature control.

Prerequisites

Quickstart: Deploy with azd

This project uses Azure Developer CLI (azd) to provision all required Azure resources—including App Configuration—automatically.

1. Clone the repository

git clone https://github.com/<your-org>/feature_flags.git
cd feature_flags

2. Login to Azure

az login

3. Provision resources and deploy

azd up

This command will:

  • Provision all required Azure resources (App Configuration, etc.)
  • Deploy the application
  • Output endpoints and connection info

4. Run the API locally

cd src/FeatureFlagApi
pwsh
 dotnet restore
 dotnet run

The API will start on https://localhost:5001 (or as configured).

API Endpoints

  • GET /feature-flag — Returns if the Demo feature is enabled for the current user.
  • GET /enabled-flags — Lists all enabled feature flags for the current user.

Feature Targeting

User targeting is implemented via DemoTargetingContextAccessor and UserService. You can customize user/group logic in these files.

Troubleshooting

Resources

About

.net feature flag demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors