[App Config] Sanitize resource group name in data-plane test recordings - #33906
Open
Christine Wanjau (ChristineWanjau) wants to merge 2 commits into
Open
[App Config] Sanitize resource group name in data-plane test recordings#33906Christine Wanjau (ChristineWanjau) wants to merge 2 commits into
Christine Wanjau (ChristineWanjau) wants to merge 2 commits into
Conversation
Register a recording processor that rewrites the reused live resource group (AZURE_CLI_TEST_DEV_RESOURCE_GROUP_NAME) to a neutral stub, and default get_test_resource_group() to that stub during playback, so environment-specific resource group names are kept out of checked-in cassettes.
|
Hi Christine Wanjau (@ChristineWanjau), |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
Avani Gupta (avanigupta),
Yu Chen (jsntcy),
Julie Zhu (yanzhudd) and
Yong Zhang (yonzhan)
August 17, 2026 12:19
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Matthew Metcalf (mrm9084)
approved these changes
Aug 17, 2026
Christine Wanjau (ChristineWanjau)
marked this pull request as ready for review
August 17, 2026 18:22
Christine Wanjau (ChristineWanjau)
requested a review
from a team
as a code owner
August 17, 2026 18:22
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Christine Wanjau (ChristineWanjau)
August 17, 2026 18:24
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the az appconfig test infrastructure to prevent environment-specific resource group names from being persisted into App Configuration data-plane test recordings, enabling stable playback across environments.
Changes:
- Introduces a
ResourceGroupNameReplacerrecording processor (and registers it on data-plane test classes) to scrub the live dev resource group name into a deterministic stub in recordings. - Updates
get_test_resource_group()to useAZURE_CLI_TEST_DEV_RESOURCE_GROUP_NAMEfor live runs, fall back to a sanitized stub in playback, and fail fast in live mode when not configured. - Sanitizes existing App Configuration data-plane cassette YAML recordings to replace the previously recorded resource group name with the stub.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/_test_utils.py | Adds sanitized RG stub constant, live/playback RG selection logic, and ResourceGroupNameReplacer processor registration. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_kv_import_export_commands.py | Registers AppConfig-specific recording processors on scenario tests. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_kv_commands.py | Registers AppConfig-specific recording processors on scenario tests; updates one live-run guidance comment. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_key_validation.py | Registers AppConfig-specific recording processors on scenario tests. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_json_content_type.py | Registers AppConfig-specific recording processors on scenario tests. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_feature_commands.py | Registers AppConfig-specific recording processors on scenario tests. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_strict_import.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_snapshot_mgmt.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_snapshot_filtering.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_kv.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_kv_set_snapshot_reference.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_kv_revision_list.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_kv_list_resolve_snapshot_references.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_key_validation.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_json_content_type.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_import_export.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_import_export_respect_both_schemas_naming_conventions.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_import_export_new_fm_schema.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_import_export_naming_conventions.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_import_export_kvset.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_feature.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_feature_telemetry.yaml | Sanitizes resource group name in recorded ARM interactions (including telemetry resource IDs). |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_feature_namespacing.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_azconfig_feature_filter.yaml | Sanitizes resource group name in recorded ARM interactions. |
| src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/recordings/test_appconfig_to_appconfig_import_export.yaml | Sanitizes resource group name in recorded ARM interactions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 PR Validation — ️✔️ All clear
Description
App Configuration data-plane tests use Microsoft Entra ID (
--auth-mode login) against stores created with local authentication disabled, which requires the recording principal to hold App Configuration Data Owner on a resource group. Recording against such a group caused the environment-specific resource group name to be baked into the checked-in cassettes.This change:
ResourceGroupNameReplacer) that rewrites the reused live resource group (from the standardAZURE_CLI_TEST_DEV_RESOURCE_GROUP_NAME) to a neutral stub in the recordings, and registers it on the data-plane test classes.get_test_resource_group()to that same stub during playback so requests match the sanitized cassettes, and fails fast (only in live mode) when no resource group is provided.Management-plane test recordings are intentionally left untouched.
Testing Guide
Data-plane suite: 20 passed / 3 skipped (live-only). Management suite: 10 passed / 5 skipped. No regressions.
History Notes
[Component Name]
az appconfig: Keep environment-specific resource group names out of data-plane test recordings (test-only change).