Skip to content

Commit 322c1fc

Browse files
Merge pull request #310965 from MicrosoftDocs/main
Auto Publish – main to live - 2026-01-27 23:00 UTC
2 parents 1d54674 + 8f01607 commit 322c1fc

24 files changed

Lines changed: 366 additions & 206 deletions

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

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ This strategy for rolling out a feature is built into the library through the in
425425

426426
### Targeting a user
427427

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+
429430

430431
```python
431432
# Directly specifying the user
@@ -435,6 +436,26 @@ result = is_enabled(feature_flags, "test_user")
435436
result = is_enabled(feature_flags, TargetingContext(user_id="test_user", groups=["Ring1"]))
436437
```
437438

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+
def my_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
456+
feature_manager = FeatureManager(config, targeting_context_accessor=my_targeting_accessor)
457+
```
458+
438459
### Targeting exclusion
439460

440461
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(
735756
)
736757
```
737758

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
739764

740765
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.
741766

@@ -749,6 +774,61 @@ When a feature flag is evaluated and telemetry is enabled, the feature manager c
749774
| `Variant` | The assigned variant. |
750775
| `VariantAssignmentReason` | The reason why the variant is assigned. |
751776

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 ID for 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 ID from 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
815+
816+
async def my_targeting_accessor() -> TargetingContext:
817+
session_id = ""
818+
if "Session-ID" in request.headers:
819+
session_id = request.headers["Session-ID"]
820+
return TargetingContext(user_id=session_id)
821+
822+
# Configure Azure Monitor with targeting context for telemetry
823+
configure_azure_monitor(
824+
connection_string=os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING"),
825+
span_processors=[TargetingSpanProcessor(targeting_context_accessor=my_targeting_accessor)],
826+
)
827+
828+
# You must also provide the targeting context accessor to FeatureManager for evaluation
829+
feature_manager = FeatureManager(config, targeting_context_accessor=my_targeting_accessor)
830+
```
831+
752832
## Next steps
753833

754834
To learn how to use feature flags in your applications, continue to the following quickstarts.

articles/azure-functions/breadcrumb/toc.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@ items:
44
topicHref: /azure/index
55
items:
66
- name: Azure Functions
7-
tocHref: /azure/azure-functions
7+
tocHref: /azure/azure-functions/
8+
topicHref: /azure/azure-functions/index
9+
- name: Azure Functions
10+
tocHref: /azure/developer/
11+
topicHref: /azure/azure-functions/index
12+
- name: Azure Functions
13+
tocHref: /azure/reliability/
814
topicHref: /azure/azure-functions/index

articles/azure-resource-manager/bicep/data-types.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Data types in Bicep
33
description: This article describes the data types that are available in Bicep.
44
ms.topic: reference
5-
ms.date: 01/02/2026
5+
ms.date: 01/27/2026
66
ms.custom: devx-track-bicep
77
---
88

@@ -355,14 +355,11 @@ var storageName = 'storage${uniqueString(resourceGroup().id)}'
355355

356356
### Multi-line strings
357357

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
359359

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.
366363

367364
```bicep
368365
// evaluates to "hello!"
@@ -389,11 +386,26 @@ var myVar5 = '''
389386
comments // are included
390387
/* because everything is read as-is */
391388
'''
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.
392392

393+
```bicep
393394
// evaluates to "interpolation\nis ${blocked}"
394395
// note ${blocked} is part of the string, and is not evaluated as an expression
395396
var myVar6 = '''interpolation
396397
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}"
405+
var interpolated = 'a test'
406+
var myVar8 = $$'''
407+
this is $${interpolated}
408+
this is not ${interpolated}'''
397409
```
398410

399411
### String-related operators

articles/azure-resource-manager/bicep/file.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Bicep file structure and syntax
33
description: Understand how to use declarative syntax to understand the structure and properties of Bicep files.
44
ms.topic: article
55
ms.custom: devx-track-bicep
6-
ms.date: 07/25/2025
6+
ms.date: 01/13/2026
77
---
88

99
# Bicep file structure and syntax
@@ -464,32 +464,6 @@ The following example shows a multiline comment.
464464
param existingKeyVaultName string
465465
```
466466

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-
493467
## Multiple-line declarations
494468

495469
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).

articles/azure-resource-manager/templates/syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Template structure and syntax
33
description: Describes the structure and properties of Azure Resource Manager templates (ARM templates) using declarative JSON syntax.
44
ms.topic: article
55
ms.custom: devx-track-arm-template
6-
ms.date: 04/28/2025
6+
ms.date: 01/13/2026
77
---
88

99
# Understand the structure and syntax of ARM templates
@@ -497,7 +497,7 @@ You can break a string into multiple lines. For example, see the `location` prop
497497
],
498498
```
499499

500-
In Bicep, see [multi-line strings](../bicep/file.md#multi-line-strings).
500+
In Bicep, see [multi-line strings](../bicep/data-types.md#multi-line-strings).
501501

502502
## languageVersion 2.0
503503

articles/azure-vmware/includes/vmware-software-versions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The following table lists the software versions that are used in new deployments
2323
| VMware vSAN on-disk format | [20](https://knowledge.broadcom.com/external/article?legacyId=2148493) | N/A |
2424
| VMware vSAN storage architecture | [Gen 1: OSA, Gen2: ESA](https://blogs.vmware.com/cloud-foundation/2022/08/31/comparing-the-original-storage-architecture-to-the-vsan-8-express-storage-architecture/) | N/A |
2525
| VMware NSX | [!INCLUDE [nsxt-version](nsxt-version.md)] | 22224317 |
26-
| VMware HCX | [4.11.1](https://techdocs.broadcom.com/us/en/vmware-cis/hcx/vmware-hcx/4-11/hcx-4-11-release-notes/vmware-hcx-4111-release-notes.html) | 24846706 |
26+
| VMware HCX | [4.11.3](https://techdocs.broadcom.com/us/en/vmware-cis/hcx/vmware-hcx/4-11/hcx-4-11-release-notes/vmware-hcx-4113-release-notes.html) | 24972695 |
2727
| 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 |
2828
| VMware vSphere Replication | [9.0.2.1](https://techdocs.broadcom.com/us/en/vmware-cis/live-recovery/vsphere-replication/9-0/release-notes/vsphere-replication-9021-release-notes.html) | 24383568 |
2929

0 commit comments

Comments
 (0)