Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
update field name
  • Loading branch information
yugangw-msft committed Nov 7, 2018
commit ce9202496c8255cbb6e577ccd0d94097a62f3f34
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

_SYSTEM_ASSIGNED_IDENTITY = 'systemAssignedIdentity'
_USER_ASSIGNED_IDENTITY = 'userAssignedIdentity'
_ASSIGNED_IDENTITY_INFO = 'assignedIdentityId'
_ASSIGNED_IDENTITY_INFO = 'assignedIdentityInfo'


def load_subscriptions(cli_ctx, all_clouds=False, refresh=False):
Expand Down
8 changes: 4 additions & 4 deletions src/azure-cli-core/azure/cli/core/tests/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ def __init__(self, *args, **kwargs):
s = subscriptions[0]
self.assertEqual(s['user']['name'], 'systemAssignedIdentity')
self.assertEqual(s['user']['type'], 'servicePrincipal')
self.assertEqual(s['user']['assignedIdentityId'], 'MSI')
self.assertEqual(s['user']['assignedIdentityInfo'], 'MSI')
self.assertEqual(s['name'], self.display_name1)
self.assertEqual(s['id'], self.id1.split('/')[-1])
self.assertEqual(s['tenantId'], '54826b22-38d6-4fb2-bad9-b7b93a3e9c5a')
Expand Down Expand Up @@ -906,7 +906,7 @@ def __init__(self, *args, **kwargs):
self.assertEqual(s['user']['name'], 'userAssignedIdentity')
self.assertEqual(s['user']['type'], 'servicePrincipal')
self.assertEqual(s['name'], self.display_name1)
self.assertEqual(s['user']['assignedIdentityId'], 'MSIClient-{}'.format(test_client_id))
self.assertEqual(s['user']['assignedIdentityInfo'], 'MSIClient-{}'.format(test_client_id))
self.assertEqual(s['id'], self.id1.split('/')[-1])
self.assertEqual(s['tenantId'], '54826b22-38d6-4fb2-bad9-b7b93a3e9c5a')

Expand Down Expand Up @@ -956,7 +956,7 @@ def set_token(self):
subscriptions = profile.find_subscriptions_in_vm_with_msi(identity_id=test_object_id)

# assert
self.assertEqual(subscriptions[0]['user']['assignedIdentityId'], 'MSIObject-{}'.format(test_object_id))
self.assertEqual(subscriptions[0]['user']['assignedIdentityInfo'], 'MSIObject-{}'.format(test_object_id))

@mock.patch('requests.get', autospec=True)
@mock.patch('azure.cli.core.profiles._shared.get_client_class', autospec=True)
Expand Down Expand Up @@ -989,7 +989,7 @@ def __init__(self, *args, **kwargs):
subscriptions = profile.find_subscriptions_in_vm_with_msi(identity_id=test_res_id)

# assert
self.assertEqual(subscriptions[0]['user']['assignedIdentityId'], 'MSIResource-{}'.format(test_res_id))
self.assertEqual(subscriptions[0]['user']['assignedIdentityInfo'], 'MSIResource-{}'.format(test_res_id))

@mock.patch('adal.AuthenticationContext.acquire_token_with_username_password', autospec=True)
@mock.patch('adal.AuthenticationContext.acquire_token', autospec=True)
Expand Down