Skip to content

auto fallback when loading settings from env#46668

Merged
kashifkhan merged 4 commits intomainfrom
core_setting_fallback
May 5, 2026
Merged

auto fallback when loading settings from env#46668
kashifkhan merged 4 commits intomainfrom
core_setting_fallback

Conversation

@xiangyan99
Copy link
Copy Markdown
Member

Invalid values for the AZURE_LOG_LEVEL, AZURE_TRACING_ENABLED, and AZURE_SDK_TRACING_IMPLEMENTATION environment variables no longer raise errors.

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

…d `AZURE_SDK_TRACING_IMPLEMENTATION` environment variables no longer raise errors.
@xiangyan99 xiangyan99 marked this pull request as ready for review May 4, 2026 18:31
Copilot AI review requested due to automatic review settings May 4, 2026 18:31
Copy link
Copy Markdown
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

Note

Copilot was unable to run its full agentic suite in this review.

This PR changes azure-core settings parsing so invalid environment variable values no longer raise exceptions; instead they fall back to defaults and emit warnings.

Changes:

  • Added warning-and-fallback behavior for invalid AZURE_LOG_LEVEL, AZURE_TRACING_ENABLED, and AZURE_SDK_TRACING_IMPLEMENTATION values.
  • Added VERBOSE as an alias for DEBUG for AZURE_LOG_LEVEL.
  • Updated docs and tests to reflect the new fallback behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sdk/core/azure-core/azure/core/settings.py Implements warning logs + fallback defaults; adds VERBOSE alias and updates docstrings.
sdk/core/azure-core/tests/test_settings.py Updates tests to expect fallback return values; adds VERBOSE alias coverage.
sdk/core/azure-core/ENVIRONMENT_VARIABLES.md Documents fallback behavior and VERBOSE alias.
sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md Updates env var table to mention fallback behavior and VERBOSE.
sdk/core/azure-core/CHANGELOG.md Notes behavior change (no error on invalid env vars) and the new VERBOSE alias.

Comment thread sdk/core/azure-core/azure/core/settings.py
Comment thread sdk/core/azure-core/tests/test_settings.py
Comment thread sdk/core/azure-core/tests/test_settings.py
Comment thread sdk/core/azure-core/CHANGELOG.md Outdated
Copy link
Copy Markdown
Member

@pvaneck pvaneck left a comment

Choose a reason for hiding this comment

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

Seems reasonable and LGTM.

Comment thread sdk/core/azure-core/CHANGELOG.md Outdated
Comment thread sdk/core/azure-core/CHANGELOG.md Outdated
xiangyan99 and others added 2 commits May 4, 2026 12:39
Co-authored-by: Paul Van Eck <paulvaneck@microsoft.com>
Co-authored-by: Paul Van Eck <paulvaneck@microsoft.com>
@kashifkhan kashifkhan merged commit 34539ef into main May 5, 2026
46 of 55 checks passed
@kashifkhan kashifkhan deleted the core_setting_fallback branch May 5, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants