You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/feature-management-python-reference.md
+82-2Lines changed: 82 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -425,7 +425,8 @@ This strategy for rolling out a feature is built into the library through the in
425
425
426
426
### Targeting a user
427
427
428
-
Either a user can be specified directly in the `is_enabled` call or a `TargetingContext` can be used to specify the user and optional group.
428
+
A user can either be specified directly in the `is_enabled` call, or a `TargetingContext` can be used to specify the user and optional group. The `TargetingContext` can either be passed in when calling `is_enabled` or by providing a callback to `targeting_context_accessor` when creating the `FeatureManager`.
429
+
429
430
430
431
```python
431
432
# Directly specifying the user
@@ -435,6 +436,26 @@ result = is_enabled(feature_flags, "test_user")
435
436
result = is_enabled(feature_flags, TargetingContext(user_id="test_user", groups=["Ring1"]))
436
437
```
437
438
439
+
#### Targeting context accessor
440
+
441
+
Instead of passing a `TargetingContext` to each `is_enabled` call, you can register a callback function with the `FeatureManager` that automatically provides the targeting context. This approach is useful when the user identity and groups can be determined from a common source, such as HTTP request headers or session data, eliminating the need to manually construct and pass the context for every feature evaluation.
442
+
443
+
```python
444
+
from quart import request
445
+
from featuremanagement import FeatureManager, TargetingContext
446
+
447
+
# A callback for assigning a TargetingContext for Feature Flag evaluation in a Quart app
448
+
defmy_targeting_accessor() -> TargetingContext:
449
+
session_id =""
450
+
if"Session-ID"in request.headers:
451
+
session_id = request.headers["Session-ID"]
452
+
return TargetingContext(user_id=session_id)
453
+
454
+
455
+
# Load feature flags and set up targeting context accessor
When defining an audience, users and groups can be excluded from the audience. Exclusions are useful for when a feature is being rolled out to a group of users, but a few users or groups need to be excluded from the rollout. Exclusion is defined by adding a list of users and groups to the `Exclusion` property of the audience.
@@ -735,7 +756,11 @@ configure_azure_monitor(
735
756
)
736
757
```
737
758
738
-
### Custom telemetry publishing
759
+
### Logging telemetry events
760
+
761
+
The feature management library provides multiple ways to log telemetry events. You can use the built-in callback for feature flag evaluation events or manually track custom events for user interactions and application events.
762
+
763
+
#### Feature evaluation events
739
764
740
765
Because the telemetry callback is a function, it can be customized to publish telemetry to any desired destination. For example, telemetry could be published to a logging service, a database, or a custom telemetry service.
741
766
@@ -749,6 +774,61 @@ When a feature flag is evaluated and telemetry is enabled, the feature manager c
749
774
|`Variant`| The assigned variant. |
750
775
|`VariantAssignmentReason`| The reason why the variant is assigned. |
751
776
777
+
#### Tracking custom events
778
+
779
+
Beyond automatic feature flag evaluation telemetry, you can manually track custom events using the `track_event` function. This is useful for tracking user interactions, business events, or other custom telemetry that should be correlated with feature flag usage.
780
+
781
+
```python
782
+
from featuremanagement.azuremonitor import track_event
783
+
784
+
# Track a custom event with a user identifier
785
+
track_event("ButtonClicked", "user123")
786
+
787
+
# Track an event without a user identifier
788
+
track_event("ApplicationStarted")
789
+
```
790
+
791
+
The `track_event` function accepts two parameters:
792
+
793
+
| Parameter | Description |
794
+
|----------------|----------------|
795
+
|`event_name`| The name of the event to track. |
796
+
|`user`| Optional user identifier to associate with the event. |
797
+
798
+
Custom events are sent to the same Application Insights instance configured for feature flag telemetry, allowing you to correlate feature flag evaluations with user behavior and application events.
799
+
800
+
### Enriching telemetry with targeting context
801
+
802
+
Instead of manually passing user identifiers to each `track_event` call, you can use the `TargetingSpanProcessor` to automatically enrich all telemetry with targeting context information. The processor accepts a callback function that returns a `TargetingContext`, allowing telemetry to automatically include the user IDfor each request. This enrichment helps correlate telemetry data with specific users and groups, making it easier to analyze feature flag performance for targeted audiences without requiring explicit user parameters in your telemetry calls.
803
+
804
+
> [!NOTE]
805
+
> The `TargetingSpanProcessor`is specifically for telemetry enrichment. You still need to provide a `targeting_context_accessor` to the `FeatureManager`for feature flag evaluation, as described in the [Targeting context accessor](#targeting-context-accessor) section.
806
+
807
+
The following example demonstrates how to configure the processor in a Quart application, using a session IDfrom request headers as the user identifier. Call `configure_azure_monitor` before creating your application instance to ensure proper initialization.
808
+
809
+
```python
810
+
import os
811
+
from quart import request
812
+
from azure.monitor.opentelemetry import configure_azure_monitor
813
+
from featuremanagement import TargetingContext
814
+
from featuremanagement.azuremonitor import TargetingSpanProcessor
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/data-types.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Data types in Bicep
3
3
description: This article describes the data types that are available in Bicep.
4
4
ms.topic: reference
5
-
ms.date: 01/02/2026
5
+
ms.date: 01/27/2026
6
6
ms.custom: devx-track-bicep
7
7
---
8
8
@@ -355,14 +355,11 @@ var storageName = 'storage${uniqueString(resourceGroup().id)}'
355
355
356
356
### Multi-line strings
357
357
358
-
In Bicep, multi-line strings are defined between three single quotation marks (`'''`) followed optionally by a newline (the opening sequence) and three single quotation marks (`'''` is the closing sequence). Characters that are entered between the opening and closing sequence are read verbatim. Escaping isn't necessary or possible.
358
+
## Multi-line strings
359
359
360
-
> [!NOTE]
361
-
> The Bicep parser reads every character as it is. Depending on the line endings of your Bicep file, newlines are interpreted as either `\r\n` or `\n`.
362
-
>
363
-
> Interpolation isn't currently supported in multi-line strings. Because of this limitation, you might need to use the [`concat`](./bicep-functions-string.md#concat) function instead of using [interpolation](#strings).
364
-
>
365
-
> Multi-line strings that contain `'''` aren't supported.
360
+
You can define a multi-line string by enclosing it in three single quotation marks (`'''`). The string content is preserved exactly as written, so escape characters are not required. The delimiter `'''` cannot appear within the string.
361
+
362
+
The string may begin immediately after the opening delimiter or on the following line. In both cases, the resulting value does not include a leading newline. Line breaks are interpreted as `\r\n` or `\n`, depending on the line-ending format of the Bicep file.
366
363
367
364
```bicep
368
365
// evaluates to "hello!"
@@ -389,11 +386,26 @@ var myVar5 = '''
389
386
comments // are included
390
387
/* because everything is read as-is */
391
388
'''
389
+
```
390
+
391
+
With Bicep CLI version v0.40.2 or higher, string interpolation is supported. An optional `$` prefix can be added before the opening delimiter to enable string interpolation using standard Bicep `${...}` syntax. If you need to include `${...}` as a literal value without escaping, you can control interpolation by repeating the `$` prefix. Interpolation is only performed when the number of `$` characters preceding `${...}` matches the number of `$` characters used in the opening delimiter.
392
392
393
+
```bicep
393
394
// evaluates to "interpolation\nis ${blocked}"
394
395
// note ${blocked} is part of the string, and is not evaluated as an expression
395
396
var myVar6 = '''interpolation
396
397
is ${blocked}'''
398
+
399
+
// evaluates to "this is a test"
400
+
var interpolated = 'a test'
401
+
var myVar7 = $'''
402
+
this is ${interpolated}'''
403
+
404
+
// evaluates to "this is a test\nthis is not ${interpolated}"
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/file.md
+1-27Lines changed: 1 addition & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Bicep file structure and syntax
3
3
description: Understand how to use declarative syntax to understand the structure and properties of Bicep files.
4
4
ms.topic: article
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 07/25/2025
6
+
ms.date: 01/13/2026
7
7
---
8
8
9
9
# Bicep file structure and syntax
@@ -464,32 +464,6 @@ The following example shows a multiline comment.
464
464
param existingKeyVaultName string
465
465
```
466
466
467
-
## Multi-line strings
468
-
469
-
You can break a string into multiple lines. Use three single quotation marks `'''` to start and end the multi-line string.
470
-
471
-
Characters within the multi-line string are handled as is. Escape characters are unnecessary. You can't include `'''` in the multi-line string. String interpolation isn't currently supported.
472
-
473
-
You can start your string right after the opening `'''`, or include a new line. In either case, the resulting string doesn't include a new line. Depending on the line endings in your Bicep file, new lines are interpreted as `\r\n` or `\n`.
474
-
475
-
The following example shows a multi-line string.
476
-
477
-
```bicep
478
-
var stringVar = '''
479
-
this is multi-line
480
-
string with formatting
481
-
preserved.
482
-
'''
483
-
```
484
-
485
-
The preceding example is equivalent to the following JSON:
486
-
487
-
```json
488
-
"variables": {
489
-
"stringVar": "this is multi-line\r\n string with formatting\r\n preserved.\r\n"
490
-
}
491
-
```
492
-
493
467
## Multiple-line declarations
494
468
495
469
You can now use multiple lines in function, array, and object declarations. This feature requires [Bicep CLI version 0.7.X or higher](./install.md).
| VMware Live Site Recovery |[9.0.2.1](https://techdocs.broadcom.com/us/en/vmware-cis/live-recovery/live-site-recovery/9-0/release-notes/id-b55981c1-41e6-4ad3-b379-ce565212add3.html)| 24401761 |
0 commit comments