Skip to content

Commit 376a6eb

Browse files
authored
Add Feature Diagnostics page for feature flag checks
1 parent 68c19db commit 376a6eb

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@page "/feature-diagnostics"
2+
@using Microsoft.FeatureManagement
3+
@inject IFeatureManager FeatureManager
4+
@inject IConfiguration Configuration
5+
@{
6+
ViewData["Title"] = "Feature Diagnostics";
7+
var salesWeekendEnabled = await FeatureManager.IsEnabledAsync("SalesWeekend");
8+
var useAppConfig = Configuration["UseAppConfig"];
9+
var appConfigEndpoint = Configuration["AppConfigEndpoint"];
10+
var featureFlagConfig = Configuration["FeatureManagement:SalesWeekend"];
11+
}
12+
13+
<h1>Feature Flag Diagnostics</h1>
14+
15+
<table class="table">
16+
<tr>
17+
<td><strong>UseAppConfig</strong></td>
18+
<td>@(useAppConfig ?? "(not set)")</td>
19+
</tr>
20+
<tr>
21+
<td><strong>AppConfigEndpoint</strong></td>
22+
<td>@(string.IsNullOrEmpty(appConfigEndpoint) ? "(not set)" : appConfigEndpoint)</td>
23+
</tr>
24+
<tr>
25+
<td><strong>SalesWeekend Feature Flag Enabled</strong></td>
26+
<td style="color: @(salesWeekendEnabled ? "green" : "red"); font-weight: bold;">
27+
@salesWeekendEnabled
28+
</td>
29+
</tr>
30+
<tr>
31+
<td><strong>FeatureManagement:SalesWeekend (from config)</strong></td>
32+
<td>@(featureFlagConfig ?? "(not found in config)")</td>
33+
</tr>
34+
<tr>
35+
<td><strong>ASPNETCORE_ENVIRONMENT</strong></td>
36+
<td>@(Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "(not set)")</td>
37+
</tr>
38+
</table>
39+
40+
<h2>What to check:</h2>
41+
<ul>
42+
<li>If <strong>SalesWeekend Feature Flag Enabled</strong> is <span style="color:green">True</span>, the banner should show.</li>
43+
<li>If it's <span style="color:red">False</span>, verify the feature flag in Azure App Configuration → Feature manager.</li>
44+
<li>Ensure the feature flag name is exactly <code>SalesWeekend</code> (case-sensitive).</li>
45+
<li>Ensure the feature flag has <strong>no label</strong>.</li>
46+
</ul>

0 commit comments

Comments
 (0)