Skip to content

Commit 752849b

Browse files
roshan-syRoshan Soni
and
Roshan Soni
authored
Fix broken az devops auth (#1226)
* Service.py runstyle changes * Removed unused variables * Added White space * minCliCoreVersion changed Co-authored-by: Roshan Soni <[email protected]>
1 parent 3c90fbf commit 752849b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"azext.minCliCoreVersion": "2.2.0"
2+
"azext.minCliCoreVersion": "2.30.0"
33
}

azure-devops/azext_devops/dev/common/services.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def get_token_from_az_logins(organization, pat_token_present):
135135
for key, dummy_value in tenantsDict.items():
136136
try:
137137
logger.debug('trying to get token (temp) for tenant %s and user %s ', key[0], key[1])
138-
token = get_token_from_az_login(profile, key[1], key[0])
138+
token = get_token_from_az_login(profile, key[0])
139139
credentials = BasicAuthentication('', token)
140140

141141
if skipValidateToken is True:
@@ -152,9 +152,12 @@ def get_token_from_az_logins(organization, pat_token_present):
152152
return ''
153153

154154

155-
def get_token_from_az_login(profile, user, tenant):
155+
def get_token_from_az_login(profile, tenant):
156156
try:
157-
auth_token = profile.get_access_token_for_resource(user, tenant, '499b84ac-1321-427f-aa17-267ca6975798')
157+
raw = profile.get_raw_token(
158+
resource='499b84ac-1321-427f-aa17-267ca6975798', tenant=tenant)
159+
creds = raw[0]
160+
auth_token = creds[1]
158161
return auth_token
159162
except BaseException as ex: # pylint: disable=broad-except
160163
logger.debug('not able to get token from az login')

0 commit comments

Comments
 (0)