App Config - Connection String testing#45859
Open
mrm9084 wants to merge 10 commits intoAzure:mainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Azure App Configuration Python test suite to reduce duplicated coverage between connection-string auth and Microsoft Entra ID auth, shifting most live tests to Entra ID and keeping connection-string validation primarily as unit tests.
Changes:
- Updated test case helpers to set up data using Entra ID clients and removed connection-string-specific helper paths.
- Removed large connection-string live test suites and added focused unit tests for
from_connection_stringbehavior (sync + async). - Updated perf stress tests and documentation to use an endpoint +
DefaultAzureCredentialinstead of a connection string.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/appconfiguration/azure-appconfiguration/tests/testcase.py | Simplifies setup to Entra ID, removes connection-string helper methods. |
| sdk/appconfiguration/azure-appconfiguration/tests/asynctestcase.py | Aligns async test helper creation/setup with Entra ID path. |
| sdk/appconfiguration/azure-appconfiguration/tests/test_consistency.py | Switches live consistency tests from connection string env var to endpoint env var. |
| sdk/appconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client.py | Removes connection-string live tests; adds unit tests for from_connection_string. |
| sdk/appconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client_async.py | Removes connection-string live tests; adds async unit tests for from_connection_string. |
| sdk/appconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client_aad.py | Updates live tests to use the unified client creation path and adds additional test coverage. |
| sdk/appconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client_aad_async.py | Updates live async tests similarly and adds coverage for additional behaviors. |
| sdk/appconfiguration/azure-appconfiguration/tests/test_audience_error_handling_live.py | Updates audience live tests to use the unified client creation path. |
| sdk/appconfiguration/azure-appconfiguration/tests/test_audience_error_handling_live_async.py | Updates async audience live tests to use the unified client creation path. |
| sdk/appconfiguration/azure-appconfiguration/tests/perfstress_tests/get.py | Switches perf test auth to Entra ID via endpoint + DefaultAzureCredential. |
| sdk/appconfiguration/azure-appconfiguration/tests/perfstress_tests/set.py | Switches perf test auth to Entra ID via endpoint + DefaultAzureCredential. |
| sdk/appconfiguration/azure-appconfiguration/tests/perfstress_tests/README.md | Updates perf test required env var from connection string to endpoint. |
| sdk/appconfiguration/azure-appconfiguration/assets.json | Updates recorded assets tag reference. |
...ppconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client_aad_async.py
Show resolved
Hide resolved
sdk/appconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client_aad.py
Show resolved
Hide resolved
sdk/appconfiguration/azure-appconfiguration/tests/perfstress_tests/set.py
Show resolved
Hide resolved
sdk/appconfiguration/azure-appconfiguration/tests/perfstress_tests/get.py
Show resolved
Hide resolved
avanigupta
reviewed
Mar 24, 2026
sdk/appconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client.py
Show resolved
Hide resolved
sdk/appconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client.py
Show resolved
Hide resolved
mrm9084
commented
Mar 24, 2026
sdk/appconfiguration/azure-appconfiguration/tests/perfstress_tests/get.py
Show resolved
Hide resolved
avanigupta
reviewed
Mar 24, 2026
Comment on lines
+1224
to
+1231
| class TestAppConfigurationClientAADUnitTest: | ||
| def test_type_error(self): | ||
| with pytest.raises(TypeError): | ||
| _ = FeatureFlagConfigurationSetting("blah", value="blah") | ||
| with pytest.raises(TypeError): | ||
| _ = SecretReferenceConfigurationSetting("blah", value="blah") # pylint: disable=no-value-for-parameter | ||
|
|
||
|
|
Member
There was a problem hiding this comment.
is this a duplicate of TestAppConfigurationClientUnitTest underneath this?
avanigupta
reviewed
Mar 24, 2026
Comment on lines
+1262
to
+1276
| class TestAppConfigurationClientAADAsyncUnitTest: | ||
| def test_type_error(self): | ||
| with pytest.raises(TypeError): | ||
| _ = FeatureFlagConfigurationSetting("blah", value="blah") | ||
| with pytest.raises(TypeError): | ||
| _ = SecretReferenceConfigurationSetting("blah", value="blah") # pylint: disable=no-value-for-parameter | ||
|
|
||
|
|
||
| class TestAppConfigurationClientUnitTest: | ||
| def test_type_error(self): | ||
| with pytest.raises(TypeError): | ||
| _ = FeatureFlagConfigurationSetting("blah", value="blah") | ||
| with pytest.raises(TypeError): | ||
| _ = SecretReferenceConfigurationSetting("blah", value="blah") # pylint: disable=no-value-for-parameter | ||
|
|
Member
There was a problem hiding this comment.
same here, why different aad class?
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.
Description
Currently the only difference between Entra ID and Connection string in python is this method:
azure-sdk-for-python/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py
Lines 113 to 138 in d5ce43f
which makes a token type that is then used the same as Entra ID tokens. We don't need duplicate tests everywhere for connection string.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines