Skip to content

Commit c974996

Browse files
add recurring time window doc for js provider
1 parent d3424e1 commit c974996

2 files changed

Lines changed: 139 additions & 1 deletion

File tree

articles/azure-app-configuration/feature-management-javascript-reference.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,144 @@ This filter provides the capability to enable a feature based on a time window.
360360
]
361361
```
362362

363+
364+
The time window can be configured to recur periodically. This can be useful for the scenarios where one may need to turn on a feature during a low or high traffic period of a day or certain days of a week. To expand the individual time window to recurring time windows, the recurrence rule should be specified in the `Recurrence` parameter.
365+
366+
> [!NOTE]
367+
> `Start` and `End` must be both specified to enable `Recurrence`.
368+
369+
``` JavaScript
370+
"client_filters": [
371+
{
372+
"name": "Microsoft.TimeWindow",
373+
"parameters": {
374+
"Start": "Fri, 22 Mar 2024 20:00:00 GMT",
375+
"End": "Sat, 23 Mar 2024 02:00:00 GMT",
376+
"Recurrence": {
377+
"Pattern": {
378+
"Type": "Daily",
379+
"Interval": 1
380+
},
381+
"Range": {
382+
"Type": "NoEnd"
383+
}
384+
}
385+
}
386+
}
387+
]
388+
```
389+
390+
The `Recurrence` settings are made up of two parts: `Pattern` (how often the time window repeats) and `Range` (for how long the recurrence pattern repeats).
391+
392+
#### Recurrence Pattern
393+
394+
There are two possible recurrence pattern types: `Daily` and `Weekly`. For example, a time window could repeat "every day", "every three days", "every Monday" or "every other Friday".
395+
396+
Depending on the type, certain fields of the `Pattern` are required, optional, or ignored.
397+
398+
- `Daily`
399+
400+
The daily recurrence pattern causes the time window to repeat based on a number of days between each occurrence.
401+
402+
| Property | Relevance | Description |
403+
|----------|-----------|-------------|
404+
| **Type** | Required | Must be set to `Daily`. |
405+
| **Interval** | Optional | Specifies the number of days between each occurrence. Default value is 1. |
406+
407+
- `Weekly`
408+
409+
The weekly recurrence pattern causes the time window to repeat on the same day or days of the week, based on the number of weeks between each set of occurrences.
410+
411+
| Property | Relevance | Description |
412+
|----------|-----------|-------------|
413+
| **Type** | Required | Must be set to `Weekly`. |
414+
| **DaysOfWeek** | Required | Specifies on which days of the week the event occurs. |
415+
| **Interval** | Optional | Specifies the number of weeks between each set of occurrences. Default value is 1. |
416+
| **FirstDayOfWeek** | Optional | Specifies which day is considered the first day of the week. Default value is `Sunday`. |
417+
418+
The following example repeats the time window every other Monday and Tuesday
419+
420+
``` javascript
421+
"Pattern": {
422+
"Type": "Weekly",
423+
"Interval": 2,
424+
"DaysOfWeek": ["Monday", "Tuesday"]
425+
}
426+
```
427+
428+
> [!NOTE]
429+
> `Start` must be a valid first occurrence that fits the recurrence pattern. Additionally, the duration of the time window can't be longer than how frequently it occurs. For example, it's invalid to have a 25-hour time window recur every day.
430+
431+
#### Recurrence Range
432+
433+
There are three possible recurrence range types: `NoEnd`, `EndDate` and `Numbered`.
434+
435+
- `NoEnd`
436+
437+
The `NoEnd` range causes the recurrence to occur indefinitely.
438+
439+
| Property | Relevance | Description |
440+
|----------|-----------|-------------|
441+
| **Type** | Required | Must be set to `NoEnd`. |
442+
443+
- `EndDate`
444+
445+
The `EndDate` range causes the time window to occur on all days that fit the applicable pattern until the end date.
446+
447+
| Property | Relevance | Description |
448+
|----------|-----------|-------------|
449+
| **Type** | Required | Must be set to `EndDate`. |
450+
| **EndDate** | Required | Specifies the date time to stop applying the pattern. As long as the start time of the last occurrence falls before the end date, the end time of that occurrence is allowed to extend beyond it. |
451+
452+
The following example will repeat the time window every day until the last occurrence happens on April 1, 2024.
453+
454+
``` javascript
455+
"Start": "Fri, 22 Mar 2024 18:00:00 GMT",
456+
"End": "Fri, 22 Mar 2024 20:00:00 GMT",
457+
"Recurrence":{
458+
"Pattern": {
459+
"Type": "Daily",
460+
"Interval": 1
461+
},
462+
"Range": {
463+
"Type": "EndDate",
464+
"EndDate": "Mon, 1 Apr 2024 20:00:00 GMT"
465+
}
466+
}
467+
```
468+
469+
- `Numbered`
470+
471+
The `Numbered` range causes the time window to occur a fixed number of times (based on the pattern).
472+
473+
| Property | Relevance | Description |
474+
|----------|-----------|-------------|
475+
| **Type** | Required | Must be set to `Numbered`. |
476+
| **NumberOfOccurrences** | Required | Specifies the number of occurrences. |
477+
478+
The following example will repeat the time window on Monday and Tuesday until there are three occurrences, which respectively happen on April 1(Mon), April 2(Tue) and April 8(Mon).
479+
480+
``` javascript
481+
"Start": "Mon, 1 Apr 2024 18:00:00 GMT",
482+
"End": "Mon, 1 Apr 2024 20:00:00 GMT",
483+
"Recurrence":{
484+
"Pattern": {
485+
"Type": "Weekly",
486+
"Interval": 1,
487+
"DaysOfWeek": ["Monday", "Tuesday"]
488+
},
489+
"Range": {
490+
"Type": "Numbered",
491+
"NumberOfOccurrences": 3
492+
}
493+
}
494+
```
495+
496+
To create a recurrence rule, you must specify both `Pattern` and `Range`. Any pattern type can work with any range type.
497+
498+
**Advanced:** The time zone offset of the `Start` property is applied to the recurrence settings.
499+
500+
363501
### Microsoft.Targeting
364502

365503
This filter provides the capability to enable a feature for a target audience. An in-depth explanation of targeting is explained in the [targeting](#targeting) section below. The filter parameters include an `Audience` object that describes users, groups, excluded users/groups, and a default percentage of the user base that should have access to the feature. Each group object that is listed in the `Groups` section must also specify what percentage of the group's members should have access. If a user is specified in the `Exclusion` section, either directly or if the user is in an excluded group, the feature is disabled. Otherwise, if a user is specified in the `Users` section directly, or if the user is in the included percentage of any of the group rollouts, or if the user falls into the default rollout percentage then that user will have the feature enabled.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Targeting Filter | [GA](./feature-management-dotnet-reference.md#targeting) | GA
4444
Targeting Exclusion | [GA](./feature-management-dotnet-reference.md#targeting-exclusion) | GA | [GA](./feature-management-python-reference.md#targeting-exclusion) | [GA](./feature-management-javascript-reference.md#targeting-exclusion) | GA
4545
Ambient Targeting | [GA](./feature-management-dotnet-reference.md#targeting-in-a-web-application) | WIP | WIP | [GA](./feature-management-javascript-reference.md#targeting-in-a-web-application) | WIP
4646
Time Window Filter | [GA](./feature-management-dotnet-reference.md#microsofttimewindow) | GA | [GA](./feature-management-python-reference.md#microsofttimewindow) | [GA](./feature-management-javascript-reference.md#microsofttimewindow) | GA
47-
Recurring Time Window | [GA](./feature-management-dotnet-reference.md#microsofttimewindow) | GA | WIP | WIP | WIP
47+
Recurring Time Window | [GA](./feature-management-dotnet-reference.md#microsofttimewindow) | GA | GA | [GA](./feature-management-javascript-reference.md#microsofttimewindow) | WIP
4848
Custom Feature Filter | [GA](./feature-management-dotnet-reference.md#implementing-a-feature-filter) | GA | [GA](./feature-management-python-reference.md#implementing-a-feature-filter) | [GA](./feature-management-javascript-reference.md#implementing-a-feature-filter) | GA
4949
Feature Filter Requirement Type (AND/OR) | [GA](./feature-management-dotnet-reference.md#requirement-type) | GA | [GA](./feature-management-python-reference.md#requirement-type) | [GA](./feature-management-javascript-reference.md#requirement-type) | GA
5050
Variant Feature Flag | [GA](./feature-management-dotnet-reference.md#variants) | GA | [GA](./feature-management-python-reference.md#variants) | [GA](./feature-management-javascript-reference.md#variants) | WIP

0 commit comments

Comments
 (0)