Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/identity/azure-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
### Other Changes

- Update typing of async credentials to match the `AsyncTokenCredential` protocol.
- If within `DefaultAzureCredential`, `EnvironmentCredential` will now use log level INFO instead of WARNING to inform users of an incomplete environment configuration. ([#31814](https://github.com/Azure/azure-sdk-for-python/pull/31814))

## 1.14.0 (2023-08-08)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def __init__(self, **kwargs: Any) -> None: # pylint: disable=too-many-statement

credentials: List["TokenCredential"] = []
if not exclude_environment_credential:
credentials.append(EnvironmentCredential(authority=authority, **kwargs))
credentials.append(EnvironmentCredential(authority=authority, _within_dac=True, **kwargs))
if not exclude_workload_identity_credential:
if all(os.environ.get(var) for var in EnvironmentVariables.WORKLOAD_IDENTITY_VARS):
client_id = workload_identity_client_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ def __init__(self, **kwargs: Any) -> None:
)
set_variables = [v for v in expected_variables if v in os.environ]
if set_variables:
_LOGGER.warning(
"Incomplete environment configuration. These variables are set: %s", ", ".join(set_variables)
_LOGGER.log(
logging.INFO if kwargs.get("_within_dac") else logging.WARNING,
"Incomplete environment configuration for EnvironmentCredential. These variables are set: %s",
", ".join(set_variables),
)
else:
_LOGGER.info("No environment configuration found.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __init__(self, **kwargs: Any) -> None:

credentials = [] # type: List[AsyncTokenCredential]
if not exclude_environment_credential:
credentials.append(EnvironmentCredential(authority=authority, **kwargs))
credentials.append(EnvironmentCredential(authority=authority, _within_dac=True, **kwargs))
if not exclude_workload_identity_credential:
if all(os.environ.get(var) for var in EnvironmentVariables.WORKLOAD_IDENTITY_VARS):
client_id = workload_identity_client_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ def __init__(self, **kwargs: Any) -> None:
expected_variables = set(EnvironmentVariables.CERT_VARS + EnvironmentVariables.CLIENT_SECRET_VARS)
set_variables = [v for v in expected_variables if v in os.environ]
if set_variables:
_LOGGER.warning(
"Incomplete environment configuration. These variables are set: %s", ", ".join(set_variables)
_LOGGER.log(
logging.INFO if kwargs.get("_within_dac") else logging.WARNING,
Comment thread
xiangyan99 marked this conversation as resolved.
"Incomplete environment configuration for EnvironmentCredential. These variables are set: %s",
", ".join(set_variables),
)
else:
_LOGGER.info("No environment configuration found.")
Expand Down