[App Configuration] - Head request support#45858
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a HEAD-based “check” API to Azure App Configuration’s Python client to support efficient change detection via page-level ETags (mirroring the JS SDK behavior).
Changes:
- Introduces
check_configuration_settings()on sync and async clients, backed by new generated HEAD operations. - Refactors generated paging/request preparation helpers and adds
check_key_values_in_one_pageimplementations. - Adds new sync/async AAD tests plus a new usage sample; updates changelog and test recordings assets tag.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_azure_appconfiguration_client.py | Adds sync check_configuration_settings() surface. |
| sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/aio/_azure_appconfiguration_client_async.py | Adds async check_configuration_settings() surface. |
| sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_generated/_operations/_patch.py | Adds sync generated HEAD operation + shared request/error-map helpers. |
| sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_generated/aio/_operations/_patch.py | Adds async generated HEAD operation + shared request/error-map helpers. |
| sdk/appconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client_aad.py | Adds sync AAD test covering page-level ETag monitoring via HEAD. |
| sdk/appconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client_aad_async.py | Adds async AAD test covering page-level ETag monitoring via HEAD. |
| sdk/appconfiguration/azure-appconfiguration/samples/check_configuration_settings_sample.py | New sample demonstrating HEAD-based change checks via ETags. |
| sdk/appconfiguration/azure-appconfiguration/CHANGELOG.md | Documents the new check_configuration_settings() feature. |
| sdk/appconfiguration/azure-appconfiguration/assets.json | Updates assets tag for new recordings. |
...configuration/azure-appconfiguration/azure/appconfiguration/_generated/_operations/_patch.py
Outdated
Show resolved
Hide resolved
| """Check configuration settings using a HEAD request, returning only headers without the | ||
| response body. This is useful for efficiently checking if settings have changed by comparing ETags. | ||
|
|
||
| :keyword key_filter: Filter results based on their keys. '*' can be used as wildcard in the beginning or end | ||
| of the filter. | ||
| :paramtype key_filter: str or None | ||
| :keyword label_filter: Filter results based on their label. '*' can be used as wildcard in the beginning or end | ||
| of the filter. | ||
| :paramtype label_filter: str or None | ||
| :keyword tags_filter: Filter results based on their tags. | ||
| :paramtype tags_filter: list[str] or None | ||
| :keyword accept_datetime: Retrieve ConfigurationSetting that existed at this datetime | ||
| :paramtype accept_datetime: ~datetime.datetime or str or None | ||
| :keyword fields: Specify which fields to include in the results. If not specified, will include all fields. | ||
| Available fields see :class:`~azure.appconfiguration.ConfigurationSettingFields`. | ||
| :paramtype fields: list[str] or list[~azure.appconfiguration.ConfigurationSettingFields] or None | ||
| :return: An iterator of :class:`~azure.appconfiguration.ConfigurationSetting` | ||
| :rtype: ~azure.appconfiguration.ConfigurationSettingPaged | ||
| :raises: :class:`~azure.core.exceptions.HttpResponseError`, \ |
There was a problem hiding this comment.
The docstring for check_configuration_settings says it returns an iterator of ConfigurationSetting, but this API uses HEAD requests and (by design) does not return configuration setting bodies. As a result, iterating the returned pager for settings is misleading (and likely yields no items); only by_page()/page metadata (e.g., etag) is meaningful. Please update the return/usage docs to reflect that this is for page-level ETag monitoring rather than returning settings.
...on/azure-appconfiguration/azure/appconfiguration/aio/_azure_appconfiguration_client_async.py
Outdated
Show resolved
Hide resolved
...ppconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client_aad_async.py
Outdated
Show resolved
Hide resolved
sdk/appconfiguration/azure-appconfiguration/tests/test_azure_appconfiguration_client_aad.py
Outdated
Show resolved
Hide resolved
...iguration/azure-appconfiguration/azure/appconfiguration/_generated/aio/_operations/_patch.py
Outdated
Show resolved
Hide resolved
...iguration/azure-appconfiguration/azure/appconfiguration/_generated/aio/_operations/_patch.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description
Adds a way to check for app config changes via head request.
See JS version: Azure/azure-sdk-for-js#36959
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines