Skip to content

Commit d4e4a16

Browse files
committed
Resolves comments for use-variant-feature-flags-aspnet-core
1 parent 36b0794 commit d4e4a16

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed
30.2 KB
Loading
25.5 KB
Loading

articles/azure-app-configuration/use-variant-feature-flags-aspnet-core.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ In this tutorial, you'll use a variant feature flag to manage experiences for di
2424
* An [App Configuration store](./quickstart-azure-app-configuration-create.md).
2525
* [Use variant feature flags](./use-variant-feature-flags.md)
2626

27-
### Create an ASP.NET Core web app
27+
## Create an ASP.NET Core web app
2828

2929
1. Open a command prompt and run the following code. This creates a new Razor Pages application in ASP.NET Core, using Individual account auth, and places it in an output folder named *QuoteOfTheDay*.
3030

@@ -89,12 +89,6 @@ In this tutorial, you'll use a variant feature flag to manage experiences for di
8989
9090
## Use the variant feature flag
9191
92-
1. In *QuoteOfTheDay* > *Pages* > *Shared* > *_Layout.cshtml*, under where `QuoteOfTheDay.styles.css` is added, add the following reference to the font-awesome CSS library.
93-
94-
```css
95-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
96-
```
97-
9892
1. Open *QuoteOfTheDay* > *Pages* > *Index.cshtml.cs* and replace the content with the following code.
9993
10094
```csharp
@@ -158,7 +152,13 @@ In this tutorial, you'll use a variant feature flag to manage experiences for di
158152
}
159153
```
160154
161-
This `PageModel` picks a random quote, uses `GetVariantAsync` to get the variant for the current user, and sets a variable called "GreetingMessage" to the variant's value. The `PageModel` also handles likes, which are sent as post requests.
155+
You call `GetVariantAsync` to retrieve the variant of the *Greeting* feature flag for the current user and assign its value to the `GreetingMessage` property of the page model. This page model also includes a handler for POST requests, which are triggered when users like the quote and click the heart button.
156+
157+
1. In *QuoteOfTheDay* > *Pages* > *Shared* > *_Layout.cshtml*, under where `QuoteOfTheDay.styles.css` is added, add the following reference to the font-awesome CSS library.
158+
159+
```css
160+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
161+
```
162162
163163
1. Open *index.cshtml* and replace its content with the following code.
164164
@@ -265,7 +265,7 @@ In this tutorial, you'll use a variant feature flag to manage experiences for di
265265
</script>
266266
```
267267
268-
This code corresponds to the UI to show the QuoteOfTheDay and handle using the heart action on a quote. It uses the previously mentioned `Model.GreetingMessage` value to show different things to different users, depending on their variant.
268+
This code displays the UI of the *Quote of the Day* application and shows the `GreetingMessage` from the page model. The JavaScript handler `heartClicked` is triggered when the heart button is clicked.
269269
270270
### Build and run the app
271271
@@ -289,21 +289,20 @@ In this tutorial, you'll use a variant feature flag to manage experiences for di
289289
290290
> [!NOTE]
291291
> It's important for the purpose of this tutorial to use these names exactly. As long as the feature has been configured as expected, the two users should see different variants.
292-
@
292+
293293
1. Select **Login** at the top right to sign in as [email protected].
294294
295295
:::image type="content" source="media/use-variant-feature-flags-aspnet-core/login.png" alt-text="Screenshot of the Quote of the day app, showing **Login**.":::
296296
297-
1. Once logged in, you should see that [email protected] sees the long message when viewing the app, and userb@contoso.com sees the simple message.
297+
1. Once logged in, you see a long greeting message for **usera@contoso.com**
298298
299-
:::image type="content" source="media/use-variant-feature-flags-aspnet-core/special-message.png" alt-text="Screenshot of the Quote of the day app, showing a special message for the user.":::
299+
:::image type="content" source="media/use-variant-feature-flags-aspnet-core/long-variant.png" alt-text="Screenshot of the Quote of the day app, showing a long message for the user.":::
300300
301-
## Next steps
301+
1. Click *Logout* and login as **[email protected]**, you see the simple greeting message.
302302
303-
To learn more about the experimentation concepts, refer to the following document.
303+
:::image type="content" source="media/use-variant-feature-flags-aspnet-core/simple-variant.png" alt-text="Screenshot of the Quote of the day app, showing a simple message for the user.":::
304304
305-
> [!div class="nextstepaction"]
306-
> [Experimentation](./concept-experimentation.md)
305+
## Next steps
307306
308307
For the full feature rundown of the .NET feature management library, refer to the following document.
309308

0 commit comments

Comments
 (0)