1.31.0 (2024-09-12)
Features Added
- Added azure.core.AzureClouds enum to represent the different Azure clouds.
- Added two new credential protocol classes,
SupportsTokenInfo
andAsyncSupportsTokenInfo
, to offer more extensibility in supporting various token acquisition scenarios. #36565- Each new protocol class defines a
get_token_info
method that returns anAccessTokenInfo
object.
- Each new protocol class defines a
- Added a new
TokenRequestOptions
class, which is aTypedDict
with optional parameters, that can be used to define options for token requests through theget_token_info
method. #36565 - Added a new
AccessTokenInfo
class, which is returned byget_token_info
implementations. This class contains the token, its expiration time, and optional additional information like when a token should be refreshed. #36565 BearerTokenCredentialPolicy
andAsyncBearerTokenCredentialPolicy
now first check if a credential has theget_token_info
method defined. If so, theget_token_info
method is used to acquire a token. Otherwise, theget_token
method is used. #36565- These policies now also check the
refresh_on
attribute when determining if a new token request should be made.
- These policies now also check the
Other Changes
- The Azure Core OpenTelemetry tracing plugin will now be the preferred tracing plugin over the OpenCensus plugin. If both plugins are installed and
opentelemetry
is imported, then OpenTelemetry will be used to trace Azure SDK operations. #35050