-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team
Description
- Package Name: azure-identity
- Package Version: 1.7.0
- Operating System: Linux-5.4.0-1059-azure-x86_64-with-glibc2.28 (Debian slim Buster)
- Python Version: 3.9.7
Bug description
AzureCliCredential fails to get token. Scope was "https://database.windows.net//.default"
[2021-11-09 00:08:54,452] {subprocess.py:78} INFO - 2021-11-08 23:08:54.451818 (MainThread): AzureCliCredential.get_token failed: strptime() argument 1 must be str, not None
[2021-11-09 00:08:54,452] {subprocess.py:78} INFO - Traceback (most recent call last):
[2021-11-09 00:08:54,452] {subprocess.py:78} INFO - File "/home/airflow/.local/lib/python3.9/site-packages/azure/identity/_internal/decorators.py", line 30, in wrapper
[2021-11-09 00:08:54,452] {subprocess.py:78} INFO - token = fn(*args, **kwargs)
[2021-11-09 00:08:54,452] {subprocess.py:78} INFO - File "/home/airflow/.local/lib/python3.9/site-packages/azure/identity/_credentials/azure_cli.py", line 75, in get_token
[2021-11-09 00:08:54,453] {subprocess.py:78} INFO - token = parse_token(output)
[2021-11-09 00:08:54,453] {subprocess.py:78} INFO - File "/home/airflow/.local/lib/python3.9/site-packages/azure/identity/_credentials/azure_cli.py", line 94, in parse_token
[2021-11-09 00:08:54,453] {subprocess.py:78} INFO - dt = datetime.strptime(token["expiresOn"], "%Y-%m-%d %H:%M:%S.%f")
[2021-11-09 00:08:54,453] {subprocess.py:78} INFO - TypeError: strptime() argument 1 must be str, not None
Context
Azure CLI is logged in using MSI
Command: az login -i
Output:
[2021-11-09 00:08:47,407] {subprocess.py:74} INFO - Output:
[2021-11-09 00:08:48,852] {subprocess.py:78} INFO - [
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - {
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - "environmentName": "AzureCloud",
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - "homeTenantId": "xxx",
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - "id": "xxx",
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - "isDefault": true,
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - "managedByTenants": [
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - {
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - "tenantId": "xxx"
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - }
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - ],
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - "name": "xxx",
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - "state": "Enabled",
[2021-11-09 00:08:48,853] {subprocess.py:78} INFO - "tenantId": "xxx",
[2021-11-09 00:08:48,854] {subprocess.py:78} INFO - "user": {
[2021-11-09 00:08:48,854] {subprocess.py:78} INFO - "assignedIdentityInfo": "MSI",
[2021-11-09 00:08:48,854] {subprocess.py:78} INFO - "name": "systemAssignedIdentity",
[2021-11-09 00:08:48,854] {subprocess.py:78} INFO - "type": "servicePrincipal"
[2021-11-09 00:08:48,854] {subprocess.py:78} INFO - }
[2021-11-09 00:08:48,854] {subprocess.py:78} INFO - }
[2021-11-09 00:08:48,854] {subprocess.py:78} INFO - ]
When I use az account get-access-token --resource https://database.windows.net/ I get null for the expiresOn:
{
"accessToken": "ey...",
"expiresOn": null,
"subscription": "xxx",
"tenant": "xxx",
"tokenType": "Bearer"
}
Reactions are currently unavailable
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.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team