-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Labels
Azure.IdentityClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.feature-requestThis issue requires a new behavior in the product in order be resolved.This issue requires a new behavior in the product in order be resolved.
Milestone
Description
- Package Name: azure-identity
- Package Version: 1.5.0
- Operating System: Linux (Azure VM Standard_D11_v2)
- Python Version: 3.6.8
Describe the bug
ManagedIdentityCredential.get_token fails using azure-identity 1.5.0.
To Reproduce
Running this script in an AzureML experiment:
from azure.identity import ManagedIdentityCredential
credential = ManagedIdentityCredential(client_id='REDACTED')
scope = 'https://storage.azure.com/.default'
access_token = credential.get_token(scope)
print(access_token)
Yields this error:
Traceback (most recent call last):
File "azid.py", line 4, in <module>
access_token = credential.get_token(scope)
File "/azureml-envs/azureml_058b99fb4f93bed0f3577d17fc03a78e/lib/python3.6/site-packages/azure/identity/_internal/decorators.py", line 27, in wrapper
token = fn(*args, **kwargs)
File "/azureml-envs/azureml_058b99fb4f93bed0f3577d17fc03a78e/lib/python3.6/site-packages/azure/identity/_credentials/managed_identity.py", line 93, in get_token
return self._credential.get_token(*scopes, **kwargs)
File "/azureml-envs/azureml_058b99fb4f93bed0f3577d17fc03a78e/lib/python3.6/site-packages/azure/identity/_credentials/app_service.py", line 38, in get_token
return super(AppServiceCredential, self).get_token(*scopes, **kwargs)
File "/azureml-envs/azureml_058b99fb4f93bed0f3577d17fc03a78e/lib/python3.6/site-packages/azure/identity/_internal/get_token_mixin.py", line 70, in get_token
token = self._request_token(*scopes)
File "/azureml-envs/azureml_058b99fb4f93bed0f3577d17fc03a78e/lib/python3.6/site-packages/azure/identity/_credentials/app_service.py", line 46, in _request_token
return self._client.request_token(*scopes, **kwargs)
File "/azureml-envs/azureml_058b99fb4f93bed0f3577d17fc03a78e/lib/python3.6/site-packages/azure/identity/_internal/managed_identity_client.py", line 73, in request_token
token = self._process_response(response, request_time)
File "/azureml-envs/azureml_058b99fb4f93bed0f3577d17fc03a78e/lib/python3.6/site-packages/azure/identity/_internal/managed_identity_client.py", line 91, in _process_response
self._content_callback(content)
File "/azureml-envs/azureml_058b99fb4f93bed0f3577d17fc03a78e/lib/python3.6/site-packages/azure/identity/_credentials/app_service.py", line 93, in _parse_app_service_expires_on
if expires_on.endswith(" +00:00"):
AttributeError: 'int' object has no attribute 'endswith'
Expected behavior
Access token retrieved.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
shuyu42, kopytjuk and gdippolito
Metadata
Metadata
Assignees
Labels
Azure.IdentityClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.feature-requestThis issue requires a new behavior in the product in order be resolved.This issue requires a new behavior in the product in order be resolved.