Skip to content

Commit 4469f27

Browse files
authored
Merge pull request #105063 from jpconnock/ac-freshness-2
Continuing freshness work on App Configuration
2 parents 1ab0f00 + d620b9d commit 4469f27

File tree

5 files changed

+86
-71
lines changed

5 files changed

+86
-71
lines changed

articles/azure-app-configuration/concept-app-configuration-event.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
title: Reacting to Azure App Configuration key-value events | Microsoft Docs
2+
title: Reacting to Azure App Configuration key-value events
33
description: Use Azure Event Grid to subscribe to App Configuration events.
44
services: azure-app-configuration,event-grid
55
author: jimmyca
66

77
ms.author: jimmyca
8-
ms.date: 05/30/2019
8+
ms.date: 02/20/2020
99
ms.topic: article
1010
ms.service: azure-app-configuration
1111

1212
---
1313

1414
# Reacting to Azure App Configuration events
1515

16-
Azure App Configuration events enable applications to react to changes in key-values. This is done without the need for complicated code or expensive and inefficient polling services. Instead, events are pushed through [Azure Event Grid](https://azure.microsoft.com/services/event-grid/) to subscribers such as [Azure Functions](https://azure.microsoft.com/services/functions/), [Azure Logic Apps](https://azure.microsoft.com/services/logic-apps/), or even to your own custom http listener, and you only pay for what you use.
16+
Azure App Configuration events enable applications to react to changes in key-values. This is done without the need for complicated code or expensive and inefficient polling services. Instead, events are pushed through [Azure Event Grid](https://azure.microsoft.com/services/event-grid/) to subscribers such as [Azure Functions](https://azure.microsoft.com/services/functions/), [Azure Logic Apps](https://azure.microsoft.com/services/logic-apps/), or even to your own custom http listener. Critically, you only pay for what you use.
1717

1818
Azure App Configuration events are sent to the Azure Event Grid which provides reliable delivery services to your applications through rich retry policies and dead-letter delivery. To learn more, see [Event Grid message delivery and retry](https://docs.microsoft.com/azure/event-grid/delivery-and-retry).
1919

@@ -70,11 +70,12 @@ Here is an example of a KeyValueModified event:
7070
For more information, see [Azure App Configuration events schema](../event-grid/event-schema-app-configuration.md).
7171

7272
## Practices for consuming events
73-
Applications that handle App Configuration events should follow a few recommended practices:
73+
Applications that handle App Configuration events should follow these recommended practices:
7474
> [!div class="checklist"]
75-
> * As multiple subscriptions can be configured to route events to the same event handler, it is important not to assume events are from a particular source, but to check the topic of the message to ensure that it comes from the App Configuration you are expecting.
76-
> * Similarly, check that the eventType is one you are prepared to process, and do not assume that all events you receive will be the types you expect.
77-
> * As messages can arrive out of order and after some delay, use the etag fields to understand if your information about objects is still up-to-date. Also, use the sequencer fields to understand the order of events on any particular object.
75+
> * Multiple subscriptions can be configured to route events to the same event handler, so do not assume events are from a particular source. Instead, check the topic of the message to ensure the App Configuration instance sending the event.
76+
> * Check the eventType and do not assume that all events you receive will be the types you expect.
77+
> * Use the etag fields to understand if your information about objects is still up-to-date.
78+
> * Use the sequencer fields to understand the order of events on any particular object.
7879
> * Use the subject field to access the key-value that was modified.
7980
8081

articles/azure-app-configuration/concept-disaster-recovery.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: lisaguthrie
55
ms.author: lcozzens
66
ms.service: azure-app-configuration
77
ms.topic: conceptual
8-
ms.date: 05/29/2019
8+
ms.date: 02/20/2020
99
---
1010

1111
# Resiliency and disaster recovery
@@ -22,7 +22,7 @@ Your application loads its configuration from both the primary and secondary sto
2222

2323
## Failover between configuration stores
2424

25-
Technically, your application isn't executing a failover. It's attempting to retrieve the same set of configuration data from two App Configuration stores simultaneously. Arrange your code so that it loads from the secondary store first and then the primary store. This approach ensures that the configuration data in the primary store takes precedence whenever it's available. The following code snippet shows how you can implement this arrangement in the .NET Core CLI:
25+
Technically, your application isn't executing a failover. It's attempting to retrieve the same set of configuration data from two App Configuration stores simultaneously. Arrange your code so that it loads from the secondary store first and then the primary store. This approach ensures that the configuration data in the primary store takes precedence whenever it's available. The following code snippet shows how you can implement this arrangement in .NET Core:
2626

2727
#### [.NET Core 2.x](#tab/core2x)
2828

@@ -65,17 +65,18 @@ From the Azure portal, you can push a change to another configuration store by f
6565

6666
1. Go to the **Import/Export** tab, and select **Export** > **App Configuration** > **Target** > **Select a resource**.
6767

68-
2. In the new blade that opens, specify the subscription, resource group, and resource name of your secondary store, and then select **Apply**.
68+
1. In the new blade that opens, specify the subscription, resource group, and resource name of your secondary store, then select **Apply**.
6969

70-
3. The UI is updated so that you can choose what configuration data you want to export to your secondary store. You can leave the default time value as is and set both **From label** and **To label** to the same value. Select **Apply**.
70+
1. The UI is updated so that you can choose what configuration data you want to export to your secondary store. You can leave the default time value as is and set both **From label** and **To label** to the same value. Select **Apply**.
7171

72-
4. Repeat the previous steps for all configuration changes.
72+
1. Repeat the previous steps for all configuration changes.
7373

7474
To automate this export process, use the Azure CLI. The following command shows how to export a single configuration change from the primary store to the secondary:
7575

76+
```azurecli
7677
az appconfig kv export --destination appconfig --name {PrimaryStore} --label {Label} --dest-name {SecondaryStore} --dest-label {Label}
78+
```
7779

7880
## Next steps
7981

8082
In this article, you learned how to augment your application to achieve geo-resiliency during runtime for App Configuration. You also can embed configuration data from App Configuration at build or deployment time. For more information, see [Integrate with a CI/CD pipeline](./integrate-ci-cd-pipeline.md).
81-

articles/azure-app-configuration/concept-feature-management.md

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,63 @@
11
---
2-
title: Azure App Configuration feature management
3-
description: An overview of how Azure App Configuration can be used to turn on and off application features on demand.
2+
title: Understand feature management using Azure App Configuration
3+
description: Turn features on and off using Azure App Configuration
44
author: lisaguthrie
55
ms.author: lcozzens
66
ms.service: azure-app-configuration
77
ms.topic: conceptual
8-
ms.date: 04/19/2019
8+
ms.date: 02/20/2020
99
---
1010

1111
# Feature management overview
1212

13-
Traditionally, shipping a new application feature requires a complete redeployment of the application itself. To test a feature, you likely must deploy your application many times to control when the feature becomes visible or who gets to see it.
13+
Traditionally, shipping a new application feature requires a complete redeployment of the application itself. Testing a feature often requires multiple deployments of the application. Each deployment may change the feature or expose the feature to different customers for testing.
1414

1515
Feature management is a modern software-development practice that decouples feature release from code deployment and enables quick changes to feature availability on demand. It uses a technique called *feature flags* (also known as *feature toggles*, *feature switches*, and so on) to dynamically administer a feature's lifecycle.
1616

17-
Feature management helps developers deal with the following problems:
17+
Feature management helps developers address the following problems:
1818

19-
* **Code branch management**: Feature flags are frequently used to wrap new application functionality that's under development. Such functionality is "hidden" by default. You can safely ship the feature, even though it's unfinished, and it will stay dormant in production. By using this approach, called *dark deployment*, you can release all your code at the end of each development cycle. You no longer need to maintain any code branch across multiple cycles because of a feature taking more than one cycle to be completed.
20-
* **Test in production**: You can use feature flags to grant early access to new functionality in production. For example, you can limit this access to only your team members or to internal beta testers. These users will get the full-fidelity production experience, instead of a simulated or partial experience in a test environment.
21-
* **Flighting**: You can also use feature flags to incrementally roll out new functionality to end users. You can target a small percentage of your user population first and increase that percentage gradually over time, after you have gained more confidence in the implementation.
22-
* **Instant kill switch**: Feature flags provide an inherent safety net for releasing new functionality. With them, you can readily turn application features on and off. If necessary, you can quickly disable a feature without rebuilding and redeploying your application.
23-
* **Selective activation**: While most feature flags exist only until their associated functionalities have been released successfully, some can last for a long time. You can use feature flags to segment your users and deliver a specific set of features to each group. For example, you may have a feature that works only on a certain web browser. You can define a feature flag so that only users of that browser can see and use the feature. With this approach, you can easily expand the supported browser list later without having to make any code changes.
19+
* **Code branch management**: Use feature flags to wrap new application functionality currently under development. Such functionality is "hidden" by default. You can safely ship the feature, even though it's unfinished, and it will stay dormant in production. Using this approach, called *dark deployment*, you can release all your code at the end of each development cycle. You no longer need to maintain code branches across multiple development cycles because a given feature requires more than one cycle to complete.
20+
* **Test in production**: Use feature flags to grant early access to new functionality in production. For example, you can limit access to team members or to internal beta testers. These users will experience the full-fidelity production experience instead of a simulated or partial experience in a test environment.
21+
* **Flighting**: Use feature flags to incrementally roll out new functionality to end users. You can target a small percentage of your user population first and increase that percentage gradually over time.
22+
* **Instant kill switch**: Feature flags provide an inherent safety net for releasing new functionality. You can turn application features on and off without redeploying any code. If necessary, you can quickly disable a feature without rebuilding and redeploying your application.
23+
* **Selective activation**: Use feature flags to segment your users and deliver a specific set of features to each group. You may have a feature that works only on a certain web browser. You can define a feature flag so that only users of that browser can see and use the feature. With this approach, you can easily expand the supported browser list later without having to make any code changes.
2424

2525
## Basic concepts
2626

2727
Here are several new terms related to feature management:
2828

29-
* **Feature flag**: A feature flag is a variable with a binary state of *on* or *off*. The feature flag also has an associated code block. The state of the feature flag triggers whether the code block runs or not.
30-
* **Feature manager**: A feature manager is an application package that handles the lifecycle of all the feature flags in an application. The feature manager typically provides additional functionality, such as caching feature flags and updating their states.
31-
* **Filter**: A filter is a rule for evaluating the state of a feature flag. A user group, a device or browser type, a geographic location, and a time window are all examples of what a filter can represent.
29+
* **Feature flag**: A feature flag is a variable with a binary state of *on* or *off*. The feature flag also has an associated code block. The feature flag's state triggers whether the code block runs.
30+
* **Feature manager**: A feature manager is an application package that handles the life cycle of all the feature flags in an application. The feature manager also provides additional functionality, including caching feature flags and updating their states.
31+
* **Filter**: A filter is a rule for evaluating the state of a feature flag. Potential filters include user groups, device or browser types, geographic locations, and time windows.
3232

3333
An effective implementation of feature management consists of at least two components working in concert:
3434

3535
* An application that makes use of feature flags.
3636
* A separate repository that stores the feature flags and their current states.
3737

38-
How these components interact is illustrated in the following examples.
38+
## Using feature flags in your code
3939

40-
## Feature flag usage in code
41-
42-
The basic pattern for implementing feature flags in an application is simple. You can think of a feature flag as a Boolean state variable used with an `if` conditional statement in your code:
40+
The basic pattern for implementing feature flags in an application is simple. A feature flag is a Boolean state variable controlling a conditional statement in your code:
4341

4442
```csharp
4543
if (featureFlag) {
4644
// Run the following code
4745
}
4846
```
4947

50-
In this case, if `featureFlag` is set to `True`, the enclosed code block is executed; otherwise, it's skipped. You can set the value of `featureFlag` statically, as in the following code example:
48+
You can set the value of `featureFlag` statically.
5149

5250
```csharp
5351
bool featureFlag = true;
5452
```
5553

56-
You can also evaluate the flag's state based on certain rules:
54+
You can evaluate the flag's state based on certain rules:
5755

5856
```csharp
5957
bool featureFlag = isBetaUser();
6058
```
6159

62-
A slightly more complicated feature flag pattern includes an `else` statement as well:
60+
You can extend the conditional to set application behavior for either state:
6361

6462
```csharp
6563
if (featureFlag) {
@@ -69,23 +67,11 @@ if (featureFlag) {
6967
}
7068
```
7169

72-
You can rewrite this behavior in the basic pattern, however. [Use feature flags in an ASP.NET Core app](./use-feature-flags-dotnet-core.md) shows the advantages of standardizing on a simple code pattern. For example:
73-
74-
```csharp
75-
if (featureFlag) {
76-
// This following code will run if the featureFlag value is true
77-
}
78-
79-
if (!featureFlag) {
80-
// This following code will run if the featureFlag value is false
81-
}
82-
```
83-
8470
## Feature flag repository
8571

86-
To use feature flags effectively, you need to externalize all the feature flags used in an application. This approach allows you to change feature flag states without modifying and redeploying the application itself.
72+
To use feature flags effectively, you need to externalize all the feature flags used in an application. This allows you to change feature flag states without modifying and redeploying the application itself.
8773

88-
Azure App Configuration is designed to be a centralized repository for feature flags. You can use it to define different kinds of feature flags and manipulate their states quickly and confidently. You can then use the App Configuration libraries for various programming language frameworks to easily access these feature flags from your application.
74+
Azure App Configuration provides a centralized repository for feature flags. You can use it to define different kinds of feature flags and manipulate their states quickly and confidently. You can then use the App Configuration libraries for various programming language frameworks to easily access these feature flags from your application.
8975

9076
[Use feature flags in an ASP.NET Core app](./use-feature-flags-dotnet-core.md) shows how the .NET Core App Configuration provider and Feature Management libraries are used together to implement feature flags for your ASP.NET web application.
9177

0 commit comments

Comments
 (0)