Skip to content

[App Config] az appconfig create/update/feature set: Add support to enable telemetry#32831

Merged
yanzhudd merged 8 commits intoAzure:devfrom
ChristineWanjau:cwanjau/enableTelemetryFeature
Mar 5, 2026
Merged

[App Config] az appconfig create/update/feature set: Add support to enable telemetry#32831
yanzhudd merged 8 commits intoAzure:devfrom
ChristineWanjau:cwanjau/enableTelemetryFeature

Conversation

@ChristineWanjau
Copy link
Contributor

@ChristineWanjau ChristineWanjau commented Feb 23, 2026

Related command

Description

This PR adds support to link an app insight resource to an app configuration store and enable telemetry to a feature flag.

Testing Guide

History Notes

[AppConfig] az appconfig create/update: Enable linking app insights resource to an app configuration store
[AppConfig] az appconfig feature set: Enable telemetry for a feature flag


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Feb 23, 2026

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link

Hi @ChristineWanjau,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Feb 23, 2026

⚠️AzureCLI-BreakingChangeTest
⚠️appconfig
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd appconfig create cmd appconfig create added parameter appinsights_resource
⚠️ 1006 - ParaAdd appconfig feature set cmd appconfig feature set added parameter telemetry_enabled
⚠️ 1006 - ParaAdd appconfig update cmd appconfig update added parameter appinsights_resource

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 23, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@ChristineWanjau ChristineWanjau marked this pull request as ready for review February 23, 2026 15:15
Copilot AI review requested due to automatic review settings February 23, 2026 15:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for linking Application Insights resources to Azure App Configuration stores and enables telemetry collection for feature flags. The changes introduce the ability to track and monitor feature flag usage through Application Insights.

Changes:

  • Updated azure-mgmt-appconfiguration dependency from 5.0.0 to 6.0.0b1 to support new telemetry features
  • Added --appinsights-resource parameter to appconfig create and appconfig update commands for linking/unlinking Application Insights
  • Added --telemetry-enabled parameter to appconfig feature set command to enable/disable telemetry on feature flags
  • Implemented warning system to notify users when telemetry is enabled without Application Insights linked
  • Added comprehensive test coverage for both management plane (App Insights linking) and data plane (feature telemetry) operations

Reviewed changes

Copilot reviewed 11 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/azure-cli/setup.py Updated azure-mgmt-appconfiguration dependency to 6.0.0b1
src/azure-cli/requirements.py3.windows.txt Updated azure-mgmt-appconfiguration dependency to 6.0.0b1 for Windows
src/azure-cli/requirements.py3.Linux.txt Updated azure-mgmt-appconfiguration dependency to 6.0.0b1 for Linux
src/azure-cli/requirements.py3.Darwin.txt Updated azure-mgmt-appconfiguration dependency to 6.0.0b1 for macOS
src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_mgmt_commands.py Added test for linking/unlinking Application Insights to App Configuration store
src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_feature_commands.py Added test for feature flag telemetry functionality with warning validation
src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_appinsights.yaml Test recording file for App Insights linking scenario
src/azure-cli/azure/cli/command_modules/appconfig/feature.py Implemented telemetry support in feature set command with App Insights linkage warning
src/azure-cli/azure/cli/command_modules/appconfig/custom.py Added appinsights_resource parameter handling in create and update store operations
src/azure-cli/azure/cli/command_modules/appconfig/_params.py Added appinsights_resource and telemetry_enabled parameter definitions
src/azure-cli/azure/cli/command_modules/appconfig/_help.py Added help documentation and examples for telemetry features

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

is_linked = bool(getattr(telemetry, "resource_id", None)) if telemetry else False

if not is_linked:
logger.warning(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the logic behind this being a warning? This is actually something not supported by our portal UI.

Also, the warning is a bit wrong. If we do allow this, assuming the customer setup there application correctly, it will generate telemetry. It will just not be visible via the App Configuration Azure Portal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Portal, we show this warning and we disable enabling the flag's telemetry if app insights is not set.
image

The idea is just to show a warning if app insight is not linked to the store but allow users to enable telemetry for their flags. Just to confirm we support other avenues to collect telemetry other than app insights?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We support other methods, they are just not built into the libraries.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we still allow enabling telemetry even though an app insights resource is not linked. would it be more accurate to say that telemetry will not be visible from the App Configuration portal if an app insights resource is not linked?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also remember from the email thread Christine had with us and some other folks that Zhenlan suggested we keep the portal warning but allow folks to enable/disable the telemetry toggle. We just won't show a graph if there is no linked app insights. I think this would unblock customers who might be using the other methods @mrm9084 is talking about in the event where they need to enable telemetry on portal/cli


except Exception as ex: # pylint: disable=broad-except
logger.warning(
"Unable to verify App Insights resource for the App Configuration store: %s", str(ex)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also links to my comment on line 62. What is the actual failure case her in the verify? They have a linked store that was deleted, but still linked? Are we able to give a more helpful error message on our part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception catches failures from resolve_metadata, which can fail if the logged-in user lacks sufficient permissions to list stores in the subscription or if the store name doesn't match any existing store. The specific error message from resolve_metadata should propagate and be caught by this exception.

feature_flag_value.telemetry.enabled = telemetry_enabled

if telemetry_enabled:
warn_if_app_insights_not_set(cmd, name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing something, but this check will run twice if this is hit as it will have already been checked on line 121.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it will run twice. Updated to just have line 121. Thanks

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 3, 2026

Please fix CI issues

@yanzhudd yanzhudd changed the title [AppConfig] az appconfig create/update/feature set: Add support to enable telemetry [App Config] az appconfig create/update/feature set: Add support to enable telemetry Mar 5, 2026
@yanzhudd yanzhudd merged commit c1a3a92 into Azure:dev Mar 5, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants