Skip to content

Commit 22e1ef7

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/azure-docs-pr into rolyon-landing-data-lake-store
2 parents cdfb1e6 + c44a75f commit 22e1ef7

12 files changed

+363
-170
lines changed

articles/active-directory-b2c/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@
182182
- name: Customize the UI
183183
href: custom-policy-ui-customization.md
184184
displayName: ux, input, cors, html, css
185+
- name: Customize language
186+
href: custom-policy-localization.md
185187
- name: Custom email
186188
href: custom-email.md
187189
displayName: verification

articles/active-directory-b2c/custom-policy-localization.md

Lines changed: 261 additions & 0 deletions
Large diffs are not rendered by default.

articles/active-directory-b2c/localization.md

Lines changed: 5 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: celestedg
88
ms.service: active-directory
99
ms.workload: identity
1010
ms.topic: reference
11-
ms.date: 03/09/2020
11+
ms.date: 03/11/2020
1212
ms.author: mimart
1313
ms.subservice: B2C
1414
---
@@ -203,160 +203,9 @@ Under the **BuildingBlocks** element, add the **Localization** element with the
203203
</Localization>
204204
```
205205

206-
### Provide language-specific strings and collections
206+
## Next steps
207207

208-
Add **LocalizedResources** elements inside the **Localization** element after the close of the **SupportedLanguages** element. You add **LocalizedResources** elements for each page (content definition) and any language you want to support. To customize the unified sign-up or sign-in page, sign-up and multi-factor authentication (MFA) pages for English, Spanish, and France, you add the following **LocalizedResources** elements.
208+
See the following articles for localization examples:
209209

210-
- Unified sign-up or sign-in page, English `<LocalizedResources Id="api.signuporsignin.en">`
211-
- Unified sign-up or sign-in page, Spanish `<LocalizedResources Id="api.signuporsignin.es">`
212-
- Unified sign-up or sign-in page, France `<LocalizedResources Id="api.signuporsignin.fr">`
213-
- Sign-Up, English `<LocalizedResources Id="api.localaccountsignup.en">`
214-
- Sign-Up, Spanish `<LocalizedResources Id="api.localaccountsignup.es">`
215-
- Sign-Up, France `<LocalizedResources Id="api.localaccountsignup.fr">`
216-
- MFA, English `<LocalizedResources Id="api.phonefactor.en">`
217-
- MFA, Spanish `<LocalizedResources Id="api.phonefactor.es">`
218-
- MFA, France `<LocalizedResources Id="api.phonefactor.fr">`
219-
220-
Each **LocalizedResources** element contains all of the required **LocalizedStrings** elements with multiple **LocalizedString** elements and **LocalizedCollections** elements with multiple **LocalizedCollection** elements. The following example adds the sign-up page English localization:
221-
222-
Note: This example makes a reference to `Gender` and `City` claim types. To use this example, make sure you define those claims. For more information, see [ClaimsSchema](claimsschema.md).
223-
224-
```XML
225-
<LocalizedResources Id="api.localaccountsignup.en">
226-
227-
<LocalizedCollections>
228-
<LocalizedCollection ElementType="ClaimType" ElementId="Gender" TargetCollection="Restriction">
229-
<Item Text="Female" Value="F" />
230-
<Item Text="Male" Value="M" />
231-
</LocalizedCollection>
232-
<LocalizedCollection ElementType="ClaimType" ElementId="City" TargetCollection="Restriction">
233-
<Item Text="New York" Value="NY" />
234-
<Item Text="Paris" Value="Paris" />
235-
<Item Text="London" Value="London" />
236-
</LocalizedCollection>
237-
</LocalizedCollections>
238-
239-
<LocalizedStrings>
240-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="DisplayName">Email</LocalizedString>
241-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="UserHelpText">Please enter your email</LocalizedString>
242-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="PatternHelpText">Please enter a valid email address</LocalizedString>
243-
<LocalizedString ElementType="UxElement" StringId="button_continue">Create new account</LocalizedString>
244-
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalAlreadyExists">The account you are trying to create already exists, please sign-in.</LocalizedString>
245-
</LocalizedStrings>
246-
</LocalizedResources>
247-
```
248-
249-
The sign-up page localization for Spanish.
250-
251-
```XML
252-
<LocalizedResources Id="api.localaccountsignup.es">
253-
254-
<LocalizedCollections>
255-
<LocalizedCollection ElementType="ClaimType" ElementId="Gender" TargetCollection="Restriction">
256-
<Item Text="Femenino" Value="F" />
257-
<Item Text="Masculino" Value="M" />
258-
</LocalizedCollection>
259-
<LocalizedCollection ElementType="ClaimType" ElementId="City" TargetCollection="Restriction">
260-
<Item Text="Nueva York" Value="NY" />
261-
<Item Text="París" Value="Paris" />
262-
<Item Text="Londres" Value="London" />
263-
</LocalizedCollection>
264-
</LocalizedCollections>
265-
266-
<LocalizedStrings>
267-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="DisplayName">Dirección de correo electrónico</LocalizedString>
268-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="UserHelpText">Dirección de correo electrónico que puede usarse para ponerse en contacto con usted.</LocalizedString>
269-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="PatternHelpText">Introduzca una dirección de correo electrónico.</LocalizedString>
270-
<LocalizedString ElementType="UxElement" StringId="button_continue">Crear</LocalizedString>
271-
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalAlreadyExists">Ya existe un usuario con el id. especificado. Elija otro diferente.</LocalizedString>
272-
</LocalizedStrings>
273-
</LocalizedResources>
274-
```
275-
276-
### Edit the ContentDefinition for the page
277-
278-
For each page that you want to localize, specify the language codes to look for in the **ContentDefinition**.
279-
280-
In the following example, English (en) and Spanish (es) custom strings are added to the sign-up page. The **LocalizedResourcesReferenceId** for each **LocalizedResourcesReference** is the same as their locale, but you could use any string as the identifier. For each language and page combination, you point to the corresponding **LocalizedResources** you previously created.
281-
282-
```XML
283-
<ContentDefinition Id="api.localaccountsignup">
284-
...
285-
<LocalizedResourcesReferences MergeBehavior="Prepend">
286-
<LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="api.localaccountsignup.en" />
287-
<LocalizedResourcesReference Language="es" LocalizedResourcesReferenceId="api.localaccountsignup.es" />
288-
</LocalizedResourcesReferences>
289-
</ContentDefinition>
290-
```
291-
292-
The following example shows the final XML:
293-
294-
```XML
295-
<BuildingBlocks>
296-
<ContentDefinitions>
297-
<ContentDefinition Id="api.localaccountsignup">
298-
<!-- Other content definitions elements... -->
299-
<LocalizedResourcesReferences MergeBehavior="Prepend">
300-
<LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="api.localaccountsignup.en" />
301-
<LocalizedResourcesReference Language="es" LocalizedResourcesReferenceId="api.localaccountsignup.es" />
302-
</LocalizedResourcesReferences>
303-
</ContentDefinition>
304-
<!-- More content definitions... -->
305-
</ContentDefinitions>
306-
307-
<Localization Enabled="true">
308-
309-
<SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">
310-
<SupportedLanguage>en</SupportedLanguage>
311-
<SupportedLanguage>es</SupportedLanguage>
312-
<!-- More supported language... -->
313-
</SupportedLanguages>
314-
315-
<LocalizedResources Id="api.localaccountsignup.en">
316-
<LocalizedCollections>
317-
<LocalizedCollection ElementType="ClaimType" ElementId="Gender" TargetCollection="Restriction">
318-
<Item Text="Female" Value="F" />
319-
<Item Text="Male" Value="M" />
320-
<!-- More items... -->
321-
</LocalizedCollection>
322-
<LocalizedCollection ElementType="ClaimType" ElementId="City" TargetCollection="Restriction">
323-
<Item Text="New York" Value="NY" />
324-
<Item Text="Paris" Value="Paris" />
325-
<Item Text="London" Value="London" />
326-
</LocalizedCollection>
327-
<!-- More localized collections... -->
328-
</LocalizedCollections>
329-
<LocalizedStrings>
330-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="DisplayName">Email</LocalizedString>
331-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="UserHelpText">Please enter your email</LocalizedString>
332-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="PatternHelpText">Please enter a valid email address</LocalizedString>
333-
<LocalizedString ElementType="UxElement" StringId="button_continue">Create new account</LocalizedString>
334-
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalAlreadyExists">The account you are trying to create already exists, please sign-in.</LocalizedString>
335-
<!-- More localized strings... -->
336-
</LocalizedStrings>
337-
</LocalizedResources>
338-
339-
<LocalizedResources Id="api.localaccountsignup.es">
340-
<LocalizedCollections>
341-
<LocalizedCollection ElementType="ClaimType" ElementId="Gender" TargetCollection="Restriction">
342-
<Item Text="Femenino" Value="F" />
343-
<Item Text="Masculino" Value="M" />
344-
</LocalizedCollection>
345-
<LocalizedCollection ElementType="ClaimType" ElementId="City" TargetCollection="Restriction">
346-
<Item Text="Nueva York" Value="NY" />
347-
<Item Text="París" Value="Paris" />
348-
<Item Text="Londres" Value="London" />
349-
</LocalizedCollection>
350-
</LocalizedCollections>
351-
<LocalizedStrings>
352-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="DisplayName">Dirección de correo electrónico</LocalizedString>
353-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="UserHelpText">Dirección de correo electrónico que puede usarse para ponerse en contacto con usted.</LocalizedString>
354-
<LocalizedString ElementType="ClaimType" ElementId="email" StringId="PatternHelpText">Introduzca una dirección de correo electrónico.</LocalizedString>
355-
<LocalizedString ElementType="UxElement" StringId="button_continue">Crear</LocalizedString>
356-
<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalAlreadyExists">Ya existe un usuario con el id. especificado. Elija otro diferente.</LocalizedString>
357-
</LocalizedStrings>
358-
</LocalizedResources>
359-
<!-- More localized resources... -->
360-
</Localization>
361-
</BuildingBlocks>
362-
```
210+
- [Language customization with custom policy in Azure Active Directory B2C](custom-policy-localization.md)
211+
- [Language customization with user flows in Azure Active Directory B2C](user-flow-language-customization.md)

articles/api-management/api-management-cross-domain-policies.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ This example demonstrates how to support pre-flight requests, such as those with
122122
|cors|Root element.|Yes|N/A|
123123
|allowed-origins|Contains `origin` elements that describe the allowed origins for cross-domain requests. `allowed-origins` can contain either a single `origin` element that specifies `*` to allow any origin, or one or more `origin` elements that contain a URI.|Yes|N/A|
124124
|origin|The value can be either `*` to allow all origins, or a URI that specifies a single origin. The URI must include a scheme, host, and port.|Yes|If the port is omitted in a URI, port 80 is used for HTTP and port 443 is used for HTTPS.|
125-
|allowed-methods|This element is required if methods other than GET or POST are allowed. Contains `method` elements that specify the supported HTTP verbs.|No|If this section is not present, GET and POST are supported.|
125+
|allowed-methods|This element is required if methods other than GET or POST are allowed. Contains `method` elements that specify the supported HTTP verbs. The value `*` indicates all methods.|No|If this section is not present, GET and POST are supported.|
126126
|method|Specifies an HTTP verb.|At least one `method` element is required if the `allowed-methods` section is present.|N/A|
127127
|allowed-headers|This element contains `header` elements specifying names of the headers that can be included in the request.|No|N/A|
128128
|expose-headers|This element contains `header` elements specifying names of the headers that will be accessible by the client.|No|N/A|
@@ -132,8 +132,8 @@ This example demonstrates how to support pre-flight requests, such as those with
132132

133133
|Name|Description|Required|Default|
134134
|----------|-----------------|--------------|-------------|
135-
|allow-credentials|The `Access-Control-Allow-Credentials` header in the preflight response will be set to the value of this attribute and affect the clients ability to submit credentials in cross-domain requests.|No|false|
136-
|preflight-result-max-age|The `Access-Control-Max-Age` header in the preflight response will be set to the value of this attribute and affect the user agents ability to cache pre-flight response.|No|0|
135+
|allow-credentials|The `Access-Control-Allow-Credentials` header in the preflight response will be set to the value of this attribute and affect the client's ability to submit credentials in cross-domain requests.|No|false|
136+
|preflight-result-max-age|The `Access-Control-Max-Age` header in the preflight response will be set to the value of this attribute and affect the user agent's ability to cache pre-flight response.|No|0|
137137

138138
### Usage
139139
This policy can be used in the following policy [sections](https://azure.microsoft.com/documentation/articles/api-management-howto-policies/#sections) and [scopes](https://azure.microsoft.com/documentation/articles/api-management-howto-policies/#scopes).

articles/api-management/api-management-howto-developer-portal.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,12 @@ Most configuration changes (for example, VNet, sign-in and product terms) requir
137137
The interactive console makes a client-side API request from the browser. You can resolve the CORS problem by adding [a CORS policy](api-management-cross-domain-policies.md#CORS) on your API(s). You can specify all the parameters manually or use wildcard `*` values. For example:
138138

139139
```XML
140-
<cors>
140+
<cors allow-credentials="true">
141141
<allowed-origins>
142-
<origin>*</origin>
142+
<origin>https://contoso.com</origin>
143143
</allowed-origins>
144-
<allowed-methods>
145-
<method>GET</method>
146-
<method>POST</method>
147-
<method>PUT</method>
148-
<method>DELETE</method>
149-
<method>HEAD</method>
150-
<method>OPTIONS</method>
151-
<method>PATCH</method>
152-
<method>TRACE</method>
144+
<allowed-methods preflight-result-max-age="300">
145+
<method>*</method>
153146
</allowed-methods>
154147
<allowed-headers>
155148
<header>*</header>
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
title: Use feature filters to enable a feature for a subset of users
3+
titleSuffix: Azure App Configuration
4+
description: Learn how to use feature filters to enable a feature for a subset of users
5+
ms.service: azure-app-configuration
6+
author: lisaguthrie
7+
8+
ms.service: azure-app-configuration
9+
ms.topic: conceptual
10+
ms.date: 3/9/2020
11+
ms.author: lcozzens
12+
13+
---
14+
# Use feature filters to enable a feature for a subset of users
15+
16+
Feature flags allow you to activate or deactivate functionality in your application. A simple feature flag is either on or off. The application always behaves the same way. For example, you could roll out a new feature behind a feature flag. When the feature flag is enabled, all users see the new feature. Disabling the feature flag hides the new feature.
17+
18+
In contrast, a _conditional feature flag_ allows the feature flag to be enabled or disabled dynamically. The application may behave differently, depending on the feature flag criteria. Suppose you want to show your new feature to a small subset of users at first. A conditional feature flag allows you to enable the feature flag for some users while disabling it for others. _Feature filters_ determine the state of the feature flag each time it's evaluated.
19+
20+
The `Microsoft.FeatureManagement` library includes two feature filters:
21+
22+
- `PercentageFilter` enables the feature flag based on a percentage.
23+
- `TimeWindowFilter` enables the feature flag during a specified window of time.
24+
25+
You can also create your own feature filter that implements the [Microsoft.FeatureManagement.IFeatureFilter interface](/dotnet/api/microsoft.featuremanagement.ifeaturefilter).
26+
27+
## Registering a feature filter
28+
29+
You register a feature filter by calling the `AddFeatureFilter` method, specifying the name of the feature filter. For example, the following code registers `PercentageFilter`:
30+
31+
```csharp
32+
public void ConfigureServices(IServiceCollection services)
33+
{
34+
services.AddControllersWithViews();
35+
services.AddFeatureManagement().AddFeatureFilter<PercentageFilter>();
36+
}
37+
```
38+
39+
## Configuring a feature filter in Azure App Configuration
40+
41+
Some feature filters have additional settings. For example, `PercentageFilter` activates a feature based on a percentage. It has a setting defining the percentage to use.
42+
43+
You can configure these settings for feature flags defined in Azure App Configuration. For example, follow these steps to use `PercentageFilter` to enable the feature flag for 50% of requests to a web app:
44+
45+
1. Follow the instructions in [Quickstart: Add feature flags to an ASP.NET Core app](./quickstart-feature-flag-aspnet-core.md) to create a web app with a feature flag.
46+
47+
1. In the Azure portal, go to your configuration store and click **Feature Manager**.
48+
49+
1. Click on the context menu for the *Beta* feature flag that you created in the quickstart. Click **Edit**.
50+
51+
> [!div class="mx-imgBorder"]
52+
> ![Edit Beta feature flag](./media/edit-beta-feature-flag.png)
53+
54+
1. In the **Edit** screen, select the **On** radio button if it isn't already selected. Then click the **Add Filter** button. (The **On** radio button's label will change to read **Conditional**.)
55+
56+
1. In the **Key** field, enter *Microsoft.Percentage*.
57+
58+
> [!div class="mx-imgBorder"]
59+
> ![Add feature filter](./media/feature-flag-add-filter.png)
60+
61+
1. Click the context menu next to the feature filter key. Click **Edit Parameters**.
62+
63+
> [!div class="mx-imgBorder"]
64+
> ![Edit feature filter parameters](./media/feature-flag-edit-filter-parameters.png)
65+
66+
1. Hover under the **Name** header so that text boxes appear in the grid. Enter a **Name** of *Value* and a **Value** of 50. The **Value** field indicates the percentage of requests for which to enable the feature filter.
67+
68+
> [!div class="mx-imgBorder"]
69+
> ![Set feature filter parameters](./media/feature-flag-set-filter-parameters.png)
70+
71+
1. Click **Apply** to return to the **Edit feature flag** screen. Then click **Apply** again to save the feature flag settings.
72+
73+
1. The **State** of the feature flag now appears as *Conditional*. This state indicates that the feature flag will be enabled or disabled on a per-request basis, based on the criteria enforced by the feature filter.
74+
75+
> [!div class="mx-imgBorder"]
76+
> ![Conditional feature flag](./media/feature-flag-filter-enabled.png)
77+
78+
## Feature filters in action
79+
80+
To see the effects of this feature flag, launch the application and hit the **Refresh** button in your browser multiple times. You'll see that the *Beta* item appears on the toolbar about 50% of the time. It's hidden the rest of the time, because the `PercentageFilter` deactivates the *Beta* feature for a subset of requests. The following video shows this behavior in action.
81+
82+
> [!div class="mx-imgBorder"]
83+
> ![PercentageFilter in action](./media/feature-flags-percentagefilter.gif)
84+
85+
## Next steps
86+
87+
> [!div class="nextstepaction"]
88+
> [Feature management overview](./concept-feature-management.md)
92.1 KB
Loading
57.6 KB
Loading
61.6 KB
Loading
61.5 KB
Loading

0 commit comments

Comments
 (0)