diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/__init__.py b/src/azure-cli-testsdk/azure/cli/testsdk/__init__.py index fa6db78d5cf..9a4cdc01e5c 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/__init__.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/__init__.py @@ -7,17 +7,19 @@ from .base import ScenarioTest, LiveScenarioTest from .preparers import (StorageAccountPreparer, ResourceGroupPreparer, RoleBasedServicePrincipalPreparer, - KeyVaultPreparer) + KeyVaultPreparer, AADGraphUserReplacer) from .exceptions import CliTestError from .checkers import (JMESPathCheck, JMESPathCheckExists, JMESPathCheckGreaterThan, NoneCheck, StringCheck, StringContainCheck) from .decorators import api_version_constraint from .utilities import create_random_name +from .patches import MOCKED_USER_NAME __all__ = ['ScenarioTest', 'LiveScenarioTest', 'ResourceGroupPreparer', 'StorageAccountPreparer', 'RoleBasedServicePrincipalPreparer', 'CliTestError', 'JMESPathCheck', 'JMESPathCheckExists', 'NoneCheck', 'live_only', 'record_only', 'StringCheck', 'StringContainCheck', 'get_sha1_hash', 'KeyVaultPreparer', - 'JMESPathCheckGreaterThan', 'api_version_constraint', 'create_random_name'] + 'JMESPathCheckGreaterThan', 'api_version_constraint', 'create_random_name', 'MOCKED_USER_NAME', + 'AADGraphUserReplacer'] __version__ = '0.1.0' diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/patches.py b/src/azure-cli-testsdk/azure/cli/testsdk/patches.py index a2a5612580d..f18e31b1ec0 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/patches.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/patches.py @@ -8,6 +8,8 @@ from .exceptions import CliExecutionError +MOCKED_USER_NAME = 'example@example.com' + def patch_progress_controller(unit_test): def _mock_pass(*args, **kwargs): # pylint: disable=unused-argument @@ -41,7 +43,7 @@ def _handle_load_cached_subscription(*args, **kwargs): # pylint: disable=unused return [{ "id": MOCKED_SUBSCRIPTION_ID, "user": { - "name": "example@example.com", + "name": MOCKED_USER_NAME, "type": "user" }, "state": "Enabled", diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py b/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py index 88357d81265..f9b4957545c 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py @@ -174,6 +174,29 @@ def remove_resource(self, name, **kwargs): execute(self.cli_ctx, 'az ad sp delete --id {}'.format(self.result['appId'])) +class AADGraphUserReplacer: + def __init__(self, test_user, mock_user): + self.test_user = test_user + self.mock_user = mock_user + + def process_request(self, request): + test_user_encoded = self.test_user.replace('@', '%40') + if test_user_encoded in request.uri: + request.uri = request.uri.replace(test_user_encoded, self.mock_user.replace('@', '%40')) + + if request.body: + body = str(request.body) + if self.test_user in body: + request.body = body.replace(self.test_user, self.mock_user) + + return request + + def process_response(self, response): + if response['body']['string']: + response['body']['string'] = response['body']['string'].replace(self.test_user, + self.mock_user) + + return response # Utility diff --git a/src/command_modules/azure-cli-acs/HISTORY.rst b/src/command_modules/azure-cli-acs/HISTORY.rst index 1ce3616d599..0805ac00777 100644 --- a/src/command_modules/azure-cli-acs/HISTORY.rst +++ b/src/command_modules/azure-cli-acs/HISTORY.rst @@ -2,7 +2,6 @@ Release History =============== - 2.3.8 +++++ * Minor fixes. diff --git a/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py b/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py index b75dc0aa7ad..a405cd3100c 100644 --- a/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py +++ b/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/custom.py @@ -1165,9 +1165,9 @@ def create_application(client, display_name, homepage, identifier_uris, password_creds, key_creds = _build_application_creds(password, key_value, key_type, key_usage, start_date, end_date) - app_create_param = ApplicationCreateParameters(available_to_other_tenants, - display_name, - identifier_uris, + app_create_param = ApplicationCreateParameters(available_to_other_tenants=available_to_other_tenants, + display_name=display_name, + identifier_uris=identifier_uris, homepage=homepage, reply_urls=reply_urls, key_credentials=key_creds, @@ -1230,7 +1230,7 @@ def create_service_principal(cli_ctx, identifier, resolve_app=True, rbac_client= else: app_id = identifier - return rbac_client.service_principals.create(ServicePrincipalCreateParameters(app_id, True)) + return rbac_client.service_principals.create(ServicePrincipalCreateParameters(app_id=app_id, account_enabled=True)) def create_role_assignment(cli_ctx, role, assignee, resource_group_name=None, scope=None): diff --git a/src/command_modules/azure-cli-acs/setup.py b/src/command_modules/azure-cli-acs/setup.py index 42cd3dc8e13..7bfd2654dfa 100644 --- a/src/command_modules/azure-cli-acs/setup.py +++ b/src/command_modules/azure-cli-acs/setup.py @@ -33,7 +33,7 @@ 'azure-mgmt-authorization==0.50.0', 'azure-mgmt-compute==4.3.1', 'azure-mgmt-containerservice==4.2.2', - 'azure-graphrbac==0.40.0', + 'azure-graphrbac==0.51.1', 'azure-cli-core', 'paramiko>=2.0.8', 'pyyaml>=3.13', diff --git a/src/command_modules/azure-cli-ams/HISTORY.rst b/src/command_modules/azure-cli-ams/HISTORY.rst index 891e698ec7f..7149646e544 100644 --- a/src/command_modules/azure-cli-ams/HISTORY.rst +++ b/src/command_modules/azure-cli-ams/HISTORY.rst @@ -2,6 +2,9 @@ Release History =============== +0.2.4 ++++++ +* Minor changes 0.2.3 +++++ diff --git a/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/operations/sp.py b/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/operations/sp.py index 4357fab5fef..b80e6320164 100644 --- a/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/operations/sp.py +++ b/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/operations/sp.py @@ -98,9 +98,9 @@ def _update_password_credentials(client, app_object_id, sp_password, years): def _get_displayable_name(graph_object): - if graph_object.user_principal_name: + if getattr(graph_object, 'user_principal_name', None): return graph_object.user_principal_name - elif graph_object.service_principal_names: + elif getattr(graph_object, 'service_principal_names', None): return graph_object.service_principal_names[0] return graph_object.display_name or '' @@ -217,7 +217,8 @@ def _create_service_principal( # retry till server replication is done for l in range(0, _RETRY_TIMES): try: - aad_sp = graph_client.service_principals.create(ServicePrincipalCreateParameters(app_id, True)) + aad_sp = graph_client.service_principals.create(ServicePrincipalCreateParameters(app_id=app_id, + account_enabled=True)) break except Exception as ex: # pylint: disable=broad-except if l < _RETRY_TIMES and ( @@ -237,9 +238,9 @@ def create_application(client, display_name, homepage, years, password, identifi available_to_other_tenants=False, reply_urls=None): password_credential = _build_password_credential(password, years) - app_create_param = ApplicationCreateParameters(available_to_other_tenants, - display_name, - identifier_uris, + app_create_param = ApplicationCreateParameters(available_to_other_tenants=available_to_other_tenants, + display_name=display_name, + identifier_uris=identifier_uris, homepage=homepage, reply_urls=reply_urls, password_credentials=[password_credential]) diff --git a/src/command_modules/azure-cli-ams/setup.py b/src/command_modules/azure-cli-ams/setup.py index 233f025d689..8de2355a4cd 100644 --- a/src/command_modules/azure-cli-ams/setup.py +++ b/src/command_modules/azure-cli-ams/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.3" +VERSION = "0.2.4" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -34,7 +34,7 @@ DEPENDENCIES = [ 'azure-cli-core', 'azure-mgmt-media==1.0.0rc1', - 'azure-graphrbac==0.40.0' + 'azure-graphrbac==0.51.1' ] with open('README.rst', 'r', encoding='utf-8') as f: diff --git a/src/command_modules/azure-cli-keyvault/HISTORY.rst b/src/command_modules/azure-cli-keyvault/HISTORY.rst index 135e9e42bea..01335856c72 100644 --- a/src/command_modules/azure-cli-keyvault/HISTORY.rst +++ b/src/command_modules/azure-cli-keyvault/HISTORY.rst @@ -2,6 +2,9 @@ Release History =============== +2.2.5 ++++++ +* Minor changes 2.2.4 +++++ diff --git a/src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/custom.py b/src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/custom.py index 3359df26cdf..0fd2445cca1 100644 --- a/src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/custom.py +++ b/src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/custom.py @@ -161,7 +161,7 @@ def list_keyvault(client, resource_group_name=None): def _get_current_user_object_id(graph_client): from msrestazure.azure_exceptions import CloudError try: - current_user = graph_client.objects.get_current_user() + current_user = graph_client.signed_in_user.get() if current_user and current_user.object_id: # pylint:disable=no-member return current_user.object_id # pylint:disable=no-member except CloudError: diff --git a/src/command_modules/azure-cli-keyvault/setup.py b/src/command_modules/azure-cli-keyvault/setup.py index 90ac234bd5f..9875981f91a 100644 --- a/src/command_modules/azure-cli-keyvault/setup.py +++ b/src/command_modules/azure-cli-keyvault/setup.py @@ -15,7 +15,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.2.4" +VERSION = "2.2.5" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -36,7 +36,7 @@ DEPENDENCIES = [ 'azure-mgmt-keyvault==1.1.0', 'azure-keyvault==1.1.0', - 'azure-graphrbac==0.40.0', + 'azure-graphrbac==0.51.1', 'azure-cli-core', 'pyOpenSSL' ] diff --git a/src/command_modules/azure-cli-lab/HISTORY.rst b/src/command_modules/azure-cli-lab/HISTORY.rst index d355cbf0343..294c5e785a2 100644 --- a/src/command_modules/azure-cli-lab/HISTORY.rst +++ b/src/command_modules/azure-cli-lab/HISTORY.rst @@ -2,6 +2,9 @@ Release History =============== +0.1.2 ++++++ +* Minor changes 0.1.1 +++++ diff --git a/src/command_modules/azure-cli-lab/setup.py b/src/command_modules/azure-cli-lab/setup.py index 5d88cd171b4..1429a565660 100644 --- a/src/command_modules/azure-cli-lab/setup.py +++ b/src/command_modules/azure-cli-lab/setup.py @@ -12,7 +12,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.1" +VERSION = "0.1.2" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', @@ -29,7 +29,7 @@ DEPENDENCIES = [ 'azure-cli-core', - 'azure-graphrbac==0.40.0', + 'azure-graphrbac==0.51.1', 'azure-mgmt-devtestlabs==2.2.0' ] diff --git a/src/command_modules/azure-cli-role/HISTORY.rst b/src/command_modules/azure-cli-role/HISTORY.rst index 9d6d2b2496d..76d680dedbf 100644 --- a/src/command_modules/azure-cli-role/HISTORY.rst +++ b/src/command_modules/azure-cli-role/HISTORY.rst @@ -2,6 +2,9 @@ Release History =============== +2.1.8 +++++++ +* support add/remove/list owner on AAD Applciation and Group objects 2.1.7 ++++++ diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/_help.py b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/_help.py index 7dbdb73e49f..31a74b8d04e 100644 --- a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/_help.py +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/_help.py @@ -167,6 +167,14 @@ type: command short-summary: List application owners. """ +helps['ad app owner add'] = """ + type: command + short-summary: add an application owner. +""" +helps['ad app owner remove'] = """ + type: command + short-summary: remove an application owner. +""" helps['ad user list'] = """ type: command short-summary: List Azure Active Directory users. @@ -300,6 +308,22 @@ type: command short-summary: Check if a member is in a group. """ +helps['ad group owner'] = """ + type: group + short-summary: Manage Azure Active Directory group owners. +""" +helps['ad group owner list'] = """ + type: command + short-summary: List group owners. +""" +helps['ad group owner add'] = """ + type: command + short-summary: add a group owner. +""" +helps['ad group owner remove'] = """ + type: command + short-summary: remove a group owner. +""" helps['ad sp'] = """ type: group short-summary: Manage Azure Active Directory service principals for automation authentication. diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/_params.py b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/_params.py index e86110a3dca..3f7b5ec308d 100644 --- a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/_params.py +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/_params.py @@ -20,6 +20,7 @@ def load_arguments(self, _): with self.argument_context('ad') as c: c.argument('_subscription') # hide global subscription param + c.argument('owner_object_id', help="owner's object id") with self.argument_context('ad app') as c: c.argument('app_id', help='application id') diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/commands.py b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/commands.py index 99b968e7b61..8f5b3eacb55 100644 --- a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/commands.py +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/commands.py @@ -24,7 +24,7 @@ def transform_assignment_list(result): def graph_err_handler(ex): - from azure.graphrbac.models.graph_error import GraphErrorException + from azure.graphrbac.models import GraphErrorException if isinstance(ex, GraphErrorException): from knack.util import CLIError raise CLIError(ex.message) @@ -89,8 +89,9 @@ def load_command_table(self, _): custom_func_name='update_application', custom_func_type=role_custom) with self.command_group('ad app owner', exception_handler=graph_err_handler) as g: - g.custom_command('list', 'list_application_owners', client_factory=get_graph_client_applications) - # TODO: Add support for 'add' and 'remove' + g.custom_command('list', 'list_application_owners') + g.custom_command('add', 'add_application_owner') + g.custom_command('remove', 'remove_application_owner') with self.command_group('ad sp', resource_type=PROFILE_TYPE, exception_handler=graph_err_handler) as g: g.custom_command('create', 'create_service_principal') @@ -100,7 +101,6 @@ def load_command_table(self, _): with self.command_group('ad sp owner', exception_handler=graph_err_handler) as g: g.custom_command('list', 'list_service_principal_owners') - # TODO: Add support for 'add' and 'remove' # RBAC related with self.command_group('ad sp', exception_handler=graph_err_handler) as g: @@ -123,6 +123,11 @@ def load_command_table(self, _): g.command('get-member-groups', 'get_member_groups') g.custom_command('list', 'list_groups', client_factory=get_graph_client_groups) + with self.command_group('ad group owner', exception_handler=graph_err_handler) as g: + g.custom_command('list', 'list_group_owners') + g.custom_command('add', 'add_group_owner') + g.custom_command('remove', 'remove_group_owner') + with self.command_group('ad group member', role_group_sdk, exception_handler=graph_err_handler) as g: g.command('list', 'get_group_members') g.command('add', 'add_member') diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py index f25d140047b..7b1d8cd2b7f 100644 --- a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py @@ -19,7 +19,7 @@ from msrest.serialization import TZ_UTC from msrestazure.azure_exceptions import CloudError from azure.cli.core.profiles import ResourceType, get_api_version -from azure.graphrbac.models.graph_error import GraphErrorException +from azure.graphrbac.models import GraphErrorException from azure.cli.core.util import get_file_json, shell_safe_json_parse @@ -386,9 +386,9 @@ def _backfill_assignments_for_co_admins(cli_ctx, auth_client, assignee=None): def _get_displayable_name(graph_object): - if graph_object.user_principal_name: + if getattr(graph_object, 'user_principal_name', None): return graph_object.user_principal_name - elif graph_object.service_principal_names: + elif getattr(graph_object, 'service_principal_names', None): return graph_object.service_principal_names[0] return graph_object.display_name or '' @@ -501,9 +501,19 @@ def list_apps(client, app_id=None, display_name=None, identifier_uri=None, query def list_application_owners(cmd, identifier): - client = _graph_client_factory(cmd.cli_ctx) - object_id = _resolve_application(client.applications, identifier) - return client.applications.list_owners(object_id) + client = _graph_client_factory(cmd.cli_ctx).applications + return client.list_owners(_resolve_application(client, identifier)) + + +def add_application_owner(cmd, owner_object_id, identifier): + graph_client = _graph_client_factory(cmd.cli_ctx) + owner_url = _get_owner_url(cmd, owner_object_id) + return graph_client.applications.add_owner(_resolve_application(graph_client.applications, identifier), owner_url) + + +def remove_application_owner(cmd, owner_object_id, identifier): + client = _graph_client_factory(cmd.cli_ctx).applications + return client.remove_owner(_resolve_application(client, identifier), owner_object_id) def list_sps(client, spn=None, display_name=None, query_filter=None): @@ -581,6 +591,33 @@ def list_groups(client, display_name=None, query_filter=None): return client.list(filter=(' and ').join(sub_filters)) +def list_group_owners(cmd, group_id): + client = _graph_client_factory(cmd.cli_ctx).groups + return client.list_owners(_resolve_group(client, group_id)) + + +def add_group_owner(cmd, owner_object_id, group_id): + graph_client = _graph_client_factory(cmd.cli_ctx) + owner_url = _get_owner_url(cmd, owner_object_id) + return graph_client.groups.add_owner(_resolve_group(graph_client.groups, group_id), owner_url) + + +def remove_group_owner(cmd, owner_object_id, group_id): + client = _graph_client_factory(cmd.cli_ctx).groups + return client.remove_owner(_resolve_group(client, group_id), owner_object_id) + + +def _resolve_group(client, identifier): + if not _is_guid(identifier): + res = list(list_groups(client, display_name=identifier)) + if not res: + raise CLIError('Group {} is not found in Graph '.format(identifier)) + if len(res) != 1: + raise CLIError('More than 1 group objects has the display name of ' + identifier) + identifier = res[0].object_id + return identifier + + def create_application(client, display_name, homepage=None, identifier_uris=None, available_to_other_tenants=False, password=None, reply_urls=None, key_value=None, key_type=None, key_usage=None, start_date=None, end_date=None, @@ -757,7 +794,7 @@ def _create_service_principal(cli_ctx, identifier, resolve_app=True): except GraphErrorException: pass # fallback to appid (maybe from an external tenant?) - return client.service_principals.create(ServicePrincipalCreateParameters(app_id, True)) + return client.service_principals.create(ServicePrincipalCreateParameters(app_id=app_id, account_enabled=True)) def show_service_principal(client, identifier): @@ -1311,6 +1348,16 @@ def _get_object_stubs(graph_client, assignees): return result +def _get_owner_url(cmd, owner_object_id): + if '://' in owner_object_id: + return owner_object_id + graph_url = cmd.cli_ctx.cloud.endpoints.active_directory_graph_resource_id + from azure.cli.core._profile import Profile + profile = Profile(cli_ctx=cmd.cli_ctx) + _, _2, tenant_id = profile.get_login_credentials() + return graph_url + tenant_id + '/directoryObjects/' + owner_object_id + + # for injecting test seams to produce predicatable role assignment id for playback def _gen_guid(): return uuid.uuid4() diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/tests/latest/recordings/test_graph_ownership.yaml b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/tests/latest/recordings/test_graph_ownership.yaml new file mode 100644 index 00000000000..3e93c7780a2 --- /dev/null +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/tests/latest/recordings/test_graph_ownership.yaml @@ -0,0 +1,746 @@ +interactions: +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad user show] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/users/example%40example.com?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"e7e158d3-7cdc-47cd-8825-5859d7ab2b55","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[],"assignedPlans":[],"city":null,"companyName":null,"consentProvidedForMinor":null,"country":null,"createdDateTime":"2016-01-21T22:10:16Z","creationType":null,"department":null,"dirSyncEnabled":null,"displayName":"admin3","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"admin3","immutableId":null,"isCompromised":null,"jobTitle":null,"lastDirSyncTime":null,"legalAgeGroupClassification":null,"mail":null,"mailNickname":"admin3","mobile":null,"onPremisesDistinguishedName":null,"onPremisesSecurityIdentifier":null,"otherMails":["yugangw@microsoft.com"],"passwordPolicies":"None","passwordProfile":null,"physicalDeliveryOfficeName":null,"postalCode":null,"preferredLanguage":"en-US","provisionedPlans":[],"provisioningErrors":[],"proxyAddresses":[],"refreshTokensValidFromDateTime":"2018-09-11T22:32:04Z","showInAddressList":null,"signInNames":[],"sipProxyAddress":null,"state":null,"streetAddress":null,"surname":"sdk","telephoneNumber":null,"thumbnailPhoto@odata.mediaEditLink":"directoryObjects/e7e158d3-7cdc-47cd-8825-5859d7ab2b55/Microsoft.DirectoryServices.User/thumbnailPhoto","usageLocation":null,"userIdentities":[],"userPrincipalName":"example@example.com","userState":null,"userStateChangedOn":null,"userType":"Member"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['1579'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:22 GMT'] + duration: ['346720'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [pMP8f8RT8BuYgTu1dfMWey3W85KBh0EioUNuKG1c8Zw=] + ocp-aad-session-key: [2MAahiQR0D3UMZ0_PvY_OnQ_hB1b74FxfymM6w9JePFlamhBDZrUuJ7zgkAG1ZwVhhrbUxXiSQbn1-rNlOkAtYwC67jo948n6-Ufvvv7zvVEM6csZBF9NQ6SOTVzlhnzalxQCse1yMKYU9gIkOdSiw.uk4CVO5Hq6r59mWsxERvmaLDo_WJxtW-1ueL73wGnfA] + pragma: [no-cache] + request-id: [36ff9e91-c22b-4f9e-851f-1fb6ddd78cc9] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"homepage": "https://azure-cli-2018-10-16-00-28-22", "identifierUris": + ["http://azure-cli-2018-10-16-00-28-22"], "displayName": "azure-cli-2018-10-16-00-28-22", + "availableToOtherTenants": false, "passwordCredentials": [{"startDate": "2018-10-16T00:28:22.791385Z", + "endDate": "2019-10-16T00:28:22.791385Z", "keyId": "221ca85d-ad52-4634-9431-98ccb1812b22", + "value": "3c95ec58-8f19-4d4e-81d5-b67b1fcef3d5"}]}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad sp create-for-rbac] + Connection: [keep-alive] + Content-Length: ['406'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: POST + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.Application/@Element","odata.type":"Microsoft.DirectoryServices.Application","objectType":"Application","objectId":"2537562f-3f2a-40b2-ba3a-f05ed017bd12","deletionTimestamp":null,"acceptMappedClaims":null,"addIns":[],"appId":"1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","appRoles":[],"availableToOtherTenants":false,"displayName":"azure-cli-2018-10-16-00-28-22","errorUrl":null,"groupMembershipClaims":null,"homepage":"https://azure-cli-2018-10-16-00-28-22","identifierUris":["http://azure-cli-2018-10-16-00-28-22"],"informationalUrls":{"termsOfService":null,"support":null,"privacy":null,"marketing":null},"isDeviceOnlyAuthSupported":null,"keyCredentials":[],"knownClientApplications":[],"logoutUrl":null,"logo@odata.mediaContentType":"application/json;odata=minimalmetadata; + charset=utf-8","logoUrl":null,"oauth2AllowIdTokenImplicitFlow":true,"oauth2AllowImplicitFlow":false,"oauth2AllowUrlPathMatching":false,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on behalf of the signed-in + user.","adminConsentDisplayName":"Access azure-cli-2018-10-16-00-28-22","id":"62fd8d99-6626-490b-80d0-20ee17ae9bb3","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on your behalf.","userConsentDisplayName":"Access + azure-cli-2018-10-16-00-28-22","value":"user_impersonation"}],"oauth2RequirePostResponse":false,"optionalClaims":null,"orgRestrictions":[],"parentalControlSettings":{"countriesBlockedForMinors":[],"legalAgeGroupRule":"Allow"},"passwordCredentials":[{"customKeyIdentifier":null,"endDate":"2019-10-16T00:28:22.791385Z","keyId":"221ca85d-ad52-4634-9431-98ccb1812b22","startDate":"2018-10-16T00:28:22.791385Z","value":null}],"publicClient":null,"publisherDomain":null,"recordConsentConditions":null,"replyUrls":[],"requiredResourceAccess":[],"samlMetadataUrl":null,"signInAudience":"AzureADMyOrg","tokenEncryptionKeyId":null}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['2087'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:23 GMT'] + duration: ['6095495'] + expires: ['-1'] + location: ['https://graph.windows.net/00000000-0000-0000-0000-000000000000/directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application'] + ocp-aad-diagnostics-server-name: [sddddXJCDv27jmu91AjCY4cjIA04nWQAsEkxbrysAOg=] + ocp-aad-session-key: [8KZDRvraHXIOmri6z3MQviNl0rY_kJ3gsUK42PSoYhZfU8CZTWNbtPiozUyPRgmRl93FS76ieDDGdSXQoC-8SKk7nwfrcQ9h-YdT32uvjlx5Ijj17Zqa93pRmNITMCLfjoiC01eXL2l-lcTYlix4rw.Czyy2IkQj-N2wrS87PRTpZ8EYVgDLpz4re2tZMnibpM] + pragma: [no-cache] + request-id: [a803f174-9ba4-4169-ac20-d2d2635459da] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 201, message: Created} +- request: + body: '{"accountEnabled": true, "appId": "1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad sp create-for-rbac] + Connection: [keep-alive] + Content-Length: ['73'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: POST + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/servicePrincipals?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.ServicePrincipal/@Element","odata.type":"Microsoft.DirectoryServices.ServicePrincipal","objectType":"ServicePrincipal","objectId":"3435b2ef-82ac-493c-b8c8-297cbc5435e8","deletionTimestamp":null,"accountEnabled":true,"addIns":[],"alternativeNames":[],"appDisplayName":"azure-cli-2018-10-16-00-28-22","appId":"1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","appOwnerTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","appRoleAssignmentRequired":false,"appRoles":[],"displayName":"azure-cli-2018-10-16-00-28-22","errorUrl":null,"homepage":"https://azure-cli-2018-10-16-00-28-22","keyCredentials":[],"logoutUrl":null,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on behalf of the signed-in + user.","adminConsentDisplayName":"Access azure-cli-2018-10-16-00-28-22","id":"62fd8d99-6626-490b-80d0-20ee17ae9bb3","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on your behalf.","userConsentDisplayName":"Access + azure-cli-2018-10-16-00-28-22","value":"user_impersonation"}],"passwordCredentials":[],"preferredTokenSigningKeyThumbprint":null,"publisherName":"AzureSDKTeam","replyUrls":[],"samlMetadataUrl":null,"servicePrincipalNames":["1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","http://azure-cli-2018-10-16-00-28-22"],"servicePrincipalType":"Application","signInAudience":"AzureADMyOrg","tags":[],"tokenEncryptionKeyId":null}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['1571'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:24 GMT'] + duration: ['2349395'] + expires: ['-1'] + location: ['https://graph.windows.net/00000000-0000-0000-0000-000000000000/directoryObjects/3435b2ef-82ac-493c-b8c8-297cbc5435e8/Microsoft.DirectoryServices.ServicePrincipal'] + ocp-aad-diagnostics-server-name: [J4iPke7YPfBuYA4E3b307ck09pRqAOuzQKQ03+b041M=] + ocp-aad-session-key: [LesYZNqGd2qI4tRE4hohjEiuzNt3JsQVKjLtwkHXAn3cfi3Q27TAvCOUeM0JXRkSAEcQPORzvFvXDvdxzKqVEwFwpn3Pab5GDebJP92Rv7BwRhOtGHILWST13B3fn4ecfpDsgTIlAECV4103i_06ow.s6K8gSlwifq_cEO82BrF6R8f7feMxNgcXklhXHyc99Y] + pragma: [no-cache] + request-id: [67cd3f29-a5fc-481d-b404-b0fe8479617a] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner add] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=identifierUris%2Fany%28s%3As%20eq%20%271b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c%27%29&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['121'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:25 GMT'] + duration: ['250322'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [EvOfLP9PQAD26fpwk0dE/RFcscWviL1fU6DjjzXB7dc=] + ocp-aad-session-key: [W0Are5dNQyGuOr9zDkLLlZUXEVTOwXiDghQnIhX0dHGZU3eeV8fY-EKNBl1H64jWCIG7YvY7Am6ULswabYp_Kr6u2FxCT55KANfA7FUbaFxVUHQqHFDl2PzRXg6NI0fQGfS8xbGfrdXQRry1I1w81w.ayhBP8uOx0k-kAH8Kvs18jDh-OgyiRMlAelfBRwe4wo] + pragma: [no-cache] + request-id: [b98a8dc7-4256-4699-b132-0b9fbafb0665] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner add] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=appId%20eq%20%271b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c%27&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[{"odata.type":"Microsoft.DirectoryServices.Application","objectType":"Application","objectId":"2537562f-3f2a-40b2-ba3a-f05ed017bd12","deletionTimestamp":null,"acceptMappedClaims":null,"addIns":[],"appId":"1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","appRoles":[],"availableToOtherTenants":false,"displayName":"azure-cli-2018-10-16-00-28-22","errorUrl":null,"groupMembershipClaims":null,"homepage":"https://azure-cli-2018-10-16-00-28-22","identifierUris":["http://azure-cli-2018-10-16-00-28-22"],"informationalUrls":{"termsOfService":null,"support":null,"privacy":null,"marketing":null},"isDeviceOnlyAuthSupported":null,"keyCredentials":[],"knownClientApplications":[],"logoutUrl":null,"logo@odata.mediaEditLink":"directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application/logo","logoUrl":null,"mainLogo@odata.mediaEditLink":"directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application/mainLogo","oauth2AllowIdTokenImplicitFlow":true,"oauth2AllowImplicitFlow":false,"oauth2AllowUrlPathMatching":false,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on behalf of the signed-in + user.","adminConsentDisplayName":"Access azure-cli-2018-10-16-00-28-22","id":"62fd8d99-6626-490b-80d0-20ee17ae9bb3","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on your behalf.","userConsentDisplayName":"Access + azure-cli-2018-10-16-00-28-22","value":"user_impersonation"}],"oauth2RequirePostResponse":false,"optionalClaims":null,"orgRestrictions":[],"parentalControlSettings":{"countriesBlockedForMinors":[],"legalAgeGroupRule":"Allow"},"passwordCredentials":[{"customKeyIdentifier":null,"endDate":"2019-10-16T00:28:22.791385Z","keyId":"221ca85d-ad52-4634-9431-98ccb1812b22","startDate":"2018-10-16T00:28:22.791385Z","value":null}],"publicClient":null,"publisherDomain":null,"recordConsentConditions":null,"replyUrls":[],"requiredResourceAccess":[],"samlMetadataUrl":null,"signInAudience":"AzureADMyOrg","tokenEncryptionKeyId":null}]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['2228'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:25 GMT'] + duration: ['423388'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [k+a8loBjbxraN1otxCzpa/lm7sS3uSMfCmXQCJ5UeOg=] + ocp-aad-session-key: [nEzb33u0SsElakT1uu8v3sCVAMAJcx4q175qYmhjm6MWM5Loer8IbCk-jxe_1rjISqbGm2A0I9Sc_sOdEvS8jzzy794W_YZUs88CnhwdzxryFSSRg2C3e_ra-mJF55zxOm_iuLYfiwMQgbFD6sqvMg.Pq8fzXECYPb0kl-TzHEDCGrwwEHE_VzA9oyocB5O8Kw] + pragma: [no-cache] + request-id: [58f1c9fc-5b51-4f15-b7ad-77b13ef35035] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"url": "https://graph.windows.net/00000000-0000-0000-0000-000000000000/directoryObjects/e7e158d3-7cdc-47cd-8825-5859d7ab2b55"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner add] + Connection: [keep-alive] + Content-Length: ['127'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: POST + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications/2537562f-3f2a-40b2-ba3a-f05ed017bd12/$links/owners?api-version=1.6 + response: + body: {string: ''} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + dataserviceversion: [1.0;] + date: ['Tue, 16 Oct 2018 00:28:27 GMT'] + duration: ['2050359'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [DAEEhUUzhQ8pu+4OxvItbpuvqegmLWoSgzWL1kkCnyk=] + ocp-aad-session-key: [OM6HF1QhePLfEH2ggIHKKe7MWLgny-JSAefuUl5oMIpeuga3WbKMTuih7tY0ol_lRfTMhMFHyRIGm_7M04L0x1SKa60Vp3AubK6bNCWZQKF0l62Boxa3Ar2YaVNDN8gU6THaH7sZwpj-kb_4rJlm5g.57LFOHO7eiINC42Fr9eM3AQA_YlOegaVzZY6rPRKR0g] + pragma: [no-cache] + request-id: [0a1bd67f-3662-483e-81d2-1853de7c21b8] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 204, message: No Content} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner list] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=identifierUris%2Fany%28s%3As%20eq%20%271b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c%27%29&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['121'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:27 GMT'] + duration: ['275905'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [eHUy9xL/t2YPMeNAb8K3eJdZ70TbtfpQN57mnPQmQKs=] + ocp-aad-session-key: [Vy3hteFsvqouu3tooQBoYAOsS6Q7BhIUwxZp_oWaeSkMk4vRNlIOwA5UhG9MD_Jq9nf1g8MNEqVX2pVUDQwBecaExxxR073Img3XoKcBxF6CQCxIcGOqNwS_bQcwCC_00iHGq4oAHOPoyMLnCepr1g.qRoA_snR7D1_9ShorQFWszGEe0UhG1rpFRBUHvz2Wpg] + pragma: [no-cache] + request-id: [2bf6cc67-5470-4dbf-9723-f086f03289fa] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner list] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=appId%20eq%20%271b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c%27&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[{"odata.type":"Microsoft.DirectoryServices.Application","objectType":"Application","objectId":"2537562f-3f2a-40b2-ba3a-f05ed017bd12","deletionTimestamp":null,"acceptMappedClaims":null,"addIns":[],"appId":"1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","appRoles":[],"availableToOtherTenants":false,"displayName":"azure-cli-2018-10-16-00-28-22","errorUrl":null,"groupMembershipClaims":null,"homepage":"https://azure-cli-2018-10-16-00-28-22","identifierUris":["http://azure-cli-2018-10-16-00-28-22"],"informationalUrls":{"termsOfService":null,"support":null,"privacy":null,"marketing":null},"isDeviceOnlyAuthSupported":null,"keyCredentials":[],"knownClientApplications":[],"logoutUrl":null,"logo@odata.mediaEditLink":"directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application/logo","logoUrl":null,"mainLogo@odata.mediaEditLink":"directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application/mainLogo","oauth2AllowIdTokenImplicitFlow":true,"oauth2AllowImplicitFlow":false,"oauth2AllowUrlPathMatching":false,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on behalf of the signed-in + user.","adminConsentDisplayName":"Access azure-cli-2018-10-16-00-28-22","id":"62fd8d99-6626-490b-80d0-20ee17ae9bb3","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on your behalf.","userConsentDisplayName":"Access + azure-cli-2018-10-16-00-28-22","value":"user_impersonation"}],"oauth2RequirePostResponse":false,"optionalClaims":null,"orgRestrictions":[],"parentalControlSettings":{"countriesBlockedForMinors":[],"legalAgeGroupRule":"Allow"},"passwordCredentials":[{"customKeyIdentifier":null,"endDate":"2019-10-16T00:28:22.791385Z","keyId":"221ca85d-ad52-4634-9431-98ccb1812b22","startDate":"2018-10-16T00:28:22.791385Z","value":null}],"publicClient":null,"publisherDomain":null,"recordConsentConditions":null,"replyUrls":[],"requiredResourceAccess":[],"samlMetadataUrl":null,"signInAudience":"AzureADMyOrg","tokenEncryptionKeyId":null}]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['2228'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:28 GMT'] + duration: ['377837'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [TF7V9cFPmZmQJjy/0crfkRiCbrtTUG3VKT/zd0mx1Gc=] + ocp-aad-session-key: [FdRxcE6MrQ0A6Ec8x83_3LZ1FM3vcPxjOZM5vbWPZqG0WXUTGGgdWTQqmm8xhzbZhstUYthtG6cx8FlNp-VwO2GuBDrqhlzYQxYFdLOlylci9sdqfe47zmC8xq_SlRgBFBUOWKjLhHgvbJFmwRAqkQ.cQag8wRes__hbYUbkcCPinpaOZi6EtwqV29xuRO5ffA] + pragma: [no-cache] + request-id: [88dbbe57-7119-46b2-9680-0fc9d73f84dd] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner list] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications/2537562f-3f2a-40b2-ba3a-f05ed017bd12/owners?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[{"odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"e7e158d3-7cdc-47cd-8825-5859d7ab2b55","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[],"assignedPlans":[],"city":null,"companyName":null,"consentProvidedForMinor":null,"country":null,"createdDateTime":"2016-01-21T22:10:16Z","creationType":null,"department":null,"dirSyncEnabled":null,"displayName":"admin3","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"admin3","immutableId":null,"isCompromised":null,"jobTitle":null,"lastDirSyncTime":null,"legalAgeGroupClassification":null,"mail":null,"mailNickname":"admin3","mobile":null,"onPremisesDistinguishedName":null,"onPremisesSecurityIdentifier":null,"otherMails":["yugangw@microsoft.com"],"passwordPolicies":"None","passwordProfile":null,"physicalDeliveryOfficeName":null,"postalCode":null,"preferredLanguage":"en-US","provisionedPlans":[],"provisioningErrors":[],"proxyAddresses":[],"refreshTokensValidFromDateTime":"2018-09-11T22:32:04Z","showInAddressList":null,"signInNames":[],"sipProxyAddress":null,"state":null,"streetAddress":null,"surname":"sdk","telephoneNumber":null,"thumbnailPhoto@odata.mediaEditLink":"directoryObjects/e7e158d3-7cdc-47cd-8825-5859d7ab2b55/Microsoft.DirectoryServices.User/thumbnailPhoto","usageLocation":null,"userIdentities":[],"userPrincipalName":"example@example.com","userState":null,"userStateChangedOn":null,"userType":"Member"}]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['1582'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:29 GMT'] + duration: ['337992'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [PJW6A+9+3YfylcLR1ajT1cnYjGDNUw+aeQtcF3NJNzY=] + ocp-aad-session-key: [tuES1YNhJWEvt_V_3wsqpPkAIYTOkyJ6sr_5XdoohtQnuXEzaZTYEeC8Fqa7R9pZl_ltcQac3rbYOecIGMqadvTL1O5h2ClsqoxB3sw58o8Op6Fketx9DQwEWSkFJaBbvoBoQM513ZP_SIZpd2rXrw.Kkabbd13345y0WvKDLVRL1Q52JGdCvIVYkKGVqtCYLI] + pragma: [no-cache] + request-id: [4e15f3a2-ffc4-49f0-87bd-433c53be59f3] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner remove] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=identifierUris%2Fany%28s%3As%20eq%20%271b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c%27%29&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['121'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:30 GMT'] + duration: ['367265'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [zPeOuJeNLZ5N5CAKU8XN6jsJ5sC6cSv6Gh6WpNy3E8g=] + ocp-aad-session-key: [ydyoPN_KdHgAf3pGY-NdlbOjk6tnEXewf0-I-ANUNESwLGnmm1uGnvpYrARNVuaOCwuGk_JKHPZPcgSM4jXWokoAj6jffXjrKQrfknWTcJHsOQLwykljVshpnW68x0YiSWpwKRHaJxivNW-VZTk3sg.NwegNMai8XaXZdNj27sIkS04N-qPnmJsdrfWTImBdHQ] + pragma: [no-cache] + request-id: [d61320f9-69dc-4b3f-b3f2-4135a2ffa5a5] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner remove] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=appId%20eq%20%271b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c%27&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[{"odata.type":"Microsoft.DirectoryServices.Application","objectType":"Application","objectId":"2537562f-3f2a-40b2-ba3a-f05ed017bd12","deletionTimestamp":null,"acceptMappedClaims":null,"addIns":[],"appId":"1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","appRoles":[],"availableToOtherTenants":false,"displayName":"azure-cli-2018-10-16-00-28-22","errorUrl":null,"groupMembershipClaims":null,"homepage":"https://azure-cli-2018-10-16-00-28-22","identifierUris":["http://azure-cli-2018-10-16-00-28-22"],"informationalUrls":{"termsOfService":null,"support":null,"privacy":null,"marketing":null},"isDeviceOnlyAuthSupported":null,"keyCredentials":[],"knownClientApplications":[],"logoutUrl":null,"logo@odata.mediaEditLink":"directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application/logo","logoUrl":null,"mainLogo@odata.mediaEditLink":"directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application/mainLogo","oauth2AllowIdTokenImplicitFlow":true,"oauth2AllowImplicitFlow":false,"oauth2AllowUrlPathMatching":false,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on behalf of the signed-in + user.","adminConsentDisplayName":"Access azure-cli-2018-10-16-00-28-22","id":"62fd8d99-6626-490b-80d0-20ee17ae9bb3","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on your behalf.","userConsentDisplayName":"Access + azure-cli-2018-10-16-00-28-22","value":"user_impersonation"}],"oauth2RequirePostResponse":false,"optionalClaims":null,"orgRestrictions":[],"parentalControlSettings":{"countriesBlockedForMinors":[],"legalAgeGroupRule":"Allow"},"passwordCredentials":[{"customKeyIdentifier":null,"endDate":"2019-10-16T00:28:22.791385Z","keyId":"221ca85d-ad52-4634-9431-98ccb1812b22","startDate":"2018-10-16T00:28:22.791385Z","value":null}],"publicClient":null,"publisherDomain":null,"recordConsentConditions":null,"replyUrls":[],"requiredResourceAccess":[],"samlMetadataUrl":null,"signInAudience":"AzureADMyOrg","tokenEncryptionKeyId":null}]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['2228'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:30 GMT'] + duration: ['379321'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [hwn6uEtjHiiLa1+/G29HvIs5WOJFHYFOq64UHyjuGvY=] + ocp-aad-session-key: [4Q-m3vLf6U2jnsplapsUZBhet4CGOc0plJN28cjtMWtCAnF7Vvd3EICyXAGi3-RboGyYY57OGv2F61x3mo1bU_2X3A11hpqe71e_AYdJCY1K2ruQyRdsPee-JBOsyDmZY8xOn8D0b5bpDPpJUsQFFw.vY_uMpeCNSFipUjy-XzZaZQZGIAoL3AJ4n37dbiT-Oc] + pragma: [no-cache] + request-id: [cb906595-37fa-4f76-9bd0-2abce140cde6] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner remove] + Connection: [keep-alive] + Content-Length: ['0'] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: DELETE + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications/2537562f-3f2a-40b2-ba3a-f05ed017bd12/$links/owners/e7e158d3-7cdc-47cd-8825-5859d7ab2b55?api-version=1.6 + response: + body: {string: ''} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + dataserviceversion: [1.0;] + date: ['Tue, 16 Oct 2018 00:28:31 GMT'] + duration: ['2111357'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [HEPAm0tyongGpYycSw509UTFJ4dZAtir7lD0xyk+LYQ=] + ocp-aad-session-key: [zlCO9t05R72Rf-5IO3ayxvmIAUByF6NuX9WU8qjSB0H_9yicoBQhMFW8geXYKcxd3qq4qzq4KhO0RZ9aifPLcrQIpEJvsw0o6WBxG0F6GN4NQeJz1GYcV19Bh-vPhyFi2Tf7xBdBZbGAJueWhK2Osg.eEmfa2p01DV-P0O7coEQxXPvp9EGwRHEdPam08KmT7w] + pragma: [no-cache] + request-id: [d163f307-a0f3-49e9-a094-08ebf746030b] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 204, message: No Content} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner list] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=identifierUris%2Fany%28s%3As%20eq%20%271b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c%27%29&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['121'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:33 GMT'] + duration: ['250890'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [hwn6uEtjHiiLa1+/G29HvIs5WOJFHYFOq64UHyjuGvY=] + ocp-aad-session-key: [aCDtt3oM36PgWZGjmnoNOazILwd2vQg6eMRKGOkq6Fg1Mydgbxl49vp_7hPnHwEhSokBbSuv673TMOUAThEKPnYw3YAk4VqPYd9IRWMeA6ZDh4psSDjAEfnulS6uJQFAr0-kVO7LuTzubDgJJVz0JQ.pCZibRYZ8ZwLTVOKIPBHZJ75-IzMCOJlshcvMMi6DSY] + pragma: [no-cache] + request-id: [8c7e6544-b8ee-49d1-a1d1-5459379e9dd4] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner list] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=appId%20eq%20%271b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c%27&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[{"odata.type":"Microsoft.DirectoryServices.Application","objectType":"Application","objectId":"2537562f-3f2a-40b2-ba3a-f05ed017bd12","deletionTimestamp":null,"acceptMappedClaims":null,"addIns":[],"appId":"1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","appRoles":[],"availableToOtherTenants":false,"displayName":"azure-cli-2018-10-16-00-28-22","errorUrl":null,"groupMembershipClaims":null,"homepage":"https://azure-cli-2018-10-16-00-28-22","identifierUris":["http://azure-cli-2018-10-16-00-28-22"],"informationalUrls":{"termsOfService":null,"support":null,"privacy":null,"marketing":null},"isDeviceOnlyAuthSupported":null,"keyCredentials":[],"knownClientApplications":[],"logoutUrl":null,"logo@odata.mediaEditLink":"directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application/logo","logoUrl":null,"mainLogo@odata.mediaEditLink":"directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application/mainLogo","oauth2AllowIdTokenImplicitFlow":true,"oauth2AllowImplicitFlow":false,"oauth2AllowUrlPathMatching":false,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on behalf of the signed-in + user.","adminConsentDisplayName":"Access azure-cli-2018-10-16-00-28-22","id":"62fd8d99-6626-490b-80d0-20ee17ae9bb3","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on your behalf.","userConsentDisplayName":"Access + azure-cli-2018-10-16-00-28-22","value":"user_impersonation"}],"oauth2RequirePostResponse":false,"optionalClaims":null,"orgRestrictions":[],"parentalControlSettings":{"countriesBlockedForMinors":[],"legalAgeGroupRule":"Allow"},"passwordCredentials":[{"customKeyIdentifier":null,"endDate":"2019-10-16T00:28:22.791385Z","keyId":"221ca85d-ad52-4634-9431-98ccb1812b22","startDate":"2018-10-16T00:28:22.791385Z","value":null}],"publicClient":null,"publisherDomain":null,"recordConsentConditions":null,"replyUrls":[],"requiredResourceAccess":[],"samlMetadataUrl":null,"signInAudience":"AzureADMyOrg","tokenEncryptionKeyId":null}]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['2228'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:32 GMT'] + duration: ['317450'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [zoXa5OztcZwC9NCZAVZj5EM6pVPNXpVwNUsgvVT3hYg=] + ocp-aad-session-key: [M6L09bT38KtOW7KN8pdM0Wm8VGUBJZAnhfJyZ0biUxTYDnDO0oUQ-pIzomF4qd9uN96VW-f_Ro9MfK2mbj_wRdGlfqJTulGIZ8sEZUUBJ_5p-EAgp2yk3zDJKhRXgBPwyE1gEIIIptjBNqXLl63ktA.xvaoHu22Fq2BchfZ7vK3MNZKxAUDRmkKDsxUQoKxpFg] + pragma: [no-cache] + request-id: [f81172a6-483a-4124-93c6-fc28afd6b1cc] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad app owner list] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications/2537562f-3f2a-40b2-ba3a-f05ed017bd12/owners?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['121'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:33 GMT'] + duration: ['330814'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [K6rldxMxky7aVh9vRPlXWYskRYxAISeuZjxkHfljrVA=] + ocp-aad-session-key: [y5_YCEyjLbxNyLEevleOTu_Fwv7c4eMB2dueOjpKpEh-WMwuC4mjoskNKWB3ZMUokcZxmgzfaW6g-6wMkkuohhBBGg2-LjwpFbK1gvrsvBsI-3lEnIdMSaCU7HeTGKy-ifSvazB6CGDder6c0aXi0w.MoloVMFj0zhC7CDFx_c3A2oUY5iQN0yEZGT2jUYJk1A] + pragma: [no-cache] + request-id: [c4640c45-e99b-43ba-b8d9-257e8268f18a] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad sp delete] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/servicePrincipals?$filter=servicePrincipalNames%2Fany%28c%3Ac%20eq%20%271b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c%27%29&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[{"odata.type":"Microsoft.DirectoryServices.ServicePrincipal","objectType":"ServicePrincipal","objectId":"3435b2ef-82ac-493c-b8c8-297cbc5435e8","deletionTimestamp":null,"accountEnabled":true,"addIns":[],"alternativeNames":[],"appDisplayName":"azure-cli-2018-10-16-00-28-22","appId":"1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","appOwnerTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","appRoleAssignmentRequired":false,"appRoles":[],"displayName":"azure-cli-2018-10-16-00-28-22","errorUrl":null,"homepage":"https://azure-cli-2018-10-16-00-28-22","keyCredentials":[],"logoutUrl":null,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on behalf of the signed-in + user.","adminConsentDisplayName":"Access azure-cli-2018-10-16-00-28-22","id":"62fd8d99-6626-490b-80d0-20ee17ae9bb3","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on your behalf.","userConsentDisplayName":"Access + azure-cli-2018-10-16-00-28-22","value":"user_impersonation"}],"passwordCredentials":[],"preferredTokenSigningKeyThumbprint":null,"publisherName":"AzureSDKTeam","replyUrls":[],"samlMetadataUrl":null,"servicePrincipalNames":["http://azure-cli-2018-10-16-00-28-22","1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c"],"servicePrincipalType":"Application","signInAudience":"AzureADMyOrg","tags":[],"tokenEncryptionKeyId":null}]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['1529'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:35 GMT'] + duration: ['337983'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [/lC86iJ3cwwJGyTWjAKYWDPkB/lyglon9hmrn0nLUXM=] + ocp-aad-session-key: [rkfEtGVJi2N2tsiSdOWNXTUBsKjtes8YrIbq4Ec1YJjMc2OZJ6toqrA5nXo6C_rBTMIeALyKIx1OU9prXH0b-k9IiiuTViplSvzWsij73WjfXiB5u_w_sNBpsJgnNzHQX9WWfX_KJlGu0eH_w0EdjA.Mgcvyovo9tnnr-KTb5bolWWqyiYZGSbySL2SI8rrYys] + pragma: [no-cache] + request-id: [c00df5a5-234d-4fff-8002-b8c453803e64] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad sp delete] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/servicePrincipals/3435b2ef-82ac-493c-b8c8-297cbc5435e8?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/@Element","odata.type":"Microsoft.DirectoryServices.ServicePrincipal","objectType":"ServicePrincipal","objectId":"3435b2ef-82ac-493c-b8c8-297cbc5435e8","deletionTimestamp":null,"accountEnabled":true,"addIns":[],"alternativeNames":[],"appDisplayName":"azure-cli-2018-10-16-00-28-22","appId":"1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","appOwnerTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","appRoleAssignmentRequired":false,"appRoles":[],"displayName":"azure-cli-2018-10-16-00-28-22","errorUrl":null,"homepage":"https://azure-cli-2018-10-16-00-28-22","keyCredentials":[],"logoutUrl":null,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on behalf of the signed-in + user.","adminConsentDisplayName":"Access azure-cli-2018-10-16-00-28-22","id":"62fd8d99-6626-490b-80d0-20ee17ae9bb3","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on your behalf.","userConsentDisplayName":"Access + azure-cli-2018-10-16-00-28-22","value":"user_impersonation"}],"passwordCredentials":[],"preferredTokenSigningKeyThumbprint":null,"publisherName":"AzureSDKTeam","replyUrls":[],"samlMetadataUrl":null,"servicePrincipalNames":["http://azure-cli-2018-10-16-00-28-22","1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c"],"servicePrincipalType":"Application","signInAudience":"AzureADMyOrg","tags":[],"tokenEncryptionKeyId":null}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['1526'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:35 GMT'] + duration: ['332127'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [IVoo8J8Kwo97hZRmPKSXFMOLbXJ4bYdeLcbvUm0th84=] + ocp-aad-session-key: [4EzZUOYG8ud88n-WvIerZFg0So_Km3lmhUcWoEKTHWinhjqVUmzAN4mQphRKnr2YwInWqmBBqKaqYLod4m5vw8eS7Heg3HAldWACIc6u47_9Ru_G9T8vFMOFxNgqgEPFb_9c3lX3fx-20o85NeJdJg.6ZBXjF3qPrMe7efFOX0rvsMbji_21uNWKsLODswXwfg] + pragma: [no-cache] + request-id: [ddd56c21-1322-43e0-86b5-7e09e469fd9a] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad sp delete] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications?$filter=identifierUris%2Fany%28s%3As%20eq%20%27http%3A%2F%2Fazure-cli-2018-10-16-00-28-22%27%29&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[{"odata.type":"Microsoft.DirectoryServices.Application","objectType":"Application","objectId":"2537562f-3f2a-40b2-ba3a-f05ed017bd12","deletionTimestamp":null,"acceptMappedClaims":null,"addIns":[],"appId":"1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","appRoles":[],"availableToOtherTenants":false,"displayName":"azure-cli-2018-10-16-00-28-22","errorUrl":null,"groupMembershipClaims":null,"homepage":"https://azure-cli-2018-10-16-00-28-22","identifierUris":["http://azure-cli-2018-10-16-00-28-22"],"informationalUrls":{"termsOfService":null,"support":null,"privacy":null,"marketing":null},"isDeviceOnlyAuthSupported":null,"keyCredentials":[],"knownClientApplications":[],"logoutUrl":null,"logo@odata.mediaEditLink":"directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application/logo","logoUrl":null,"mainLogo@odata.mediaEditLink":"directoryObjects/2537562f-3f2a-40b2-ba3a-f05ed017bd12/Microsoft.DirectoryServices.Application/mainLogo","oauth2AllowIdTokenImplicitFlow":true,"oauth2AllowImplicitFlow":false,"oauth2AllowUrlPathMatching":false,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on behalf of the signed-in + user.","adminConsentDisplayName":"Access azure-cli-2018-10-16-00-28-22","id":"62fd8d99-6626-490b-80d0-20ee17ae9bb3","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on your behalf.","userConsentDisplayName":"Access + azure-cli-2018-10-16-00-28-22","value":"user_impersonation"}],"oauth2RequirePostResponse":false,"optionalClaims":null,"orgRestrictions":[],"parentalControlSettings":{"countriesBlockedForMinors":[],"legalAgeGroupRule":"Allow"},"passwordCredentials":[{"customKeyIdentifier":null,"endDate":"2019-10-16T00:28:22.791385Z","keyId":"221ca85d-ad52-4634-9431-98ccb1812b22","startDate":"2018-10-16T00:28:22.791385Z","value":null}],"publicClient":null,"publisherDomain":null,"recordConsentConditions":null,"replyUrls":[],"requiredResourceAccess":[],"samlMetadataUrl":null,"signInAudience":"AzureADMyOrg","tokenEncryptionKeyId":null}]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['2228'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:36 GMT'] + duration: ['409906'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [USO0vXsiH/WugU0+xVoguNv4Wxgbvvn8Zb8qUwfOkVw=] + ocp-aad-session-key: [BwHV8BJO6fk5g1H0XL-jQF6ryU6bUHybjltQq-tu1YSUBa0W7r-jeB9zuDhLNfkrN5JiLTCobeRKwFC45tBlPFtMxSsiV5g2DuEuVFSoqkK5LHGMk8R3F7ImMn7dMGpNMuJU2pOt4Q0L7ctvfvANuw.hS3YbjoWu24FvjifDNQYeU-bDB8K2q4YhP0byuh-vP4] + pragma: [no-cache] + request-id: [25cd473f-36f2-4b52-9746-4830c720d0f1] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad sp delete] + Connection: [keep-alive] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/servicePrincipals?$filter=servicePrincipalNames%2Fany%28c%3Ac%20eq%20%271b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c%27%29&api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects","value":[{"odata.type":"Microsoft.DirectoryServices.ServicePrincipal","objectType":"ServicePrincipal","objectId":"3435b2ef-82ac-493c-b8c8-297cbc5435e8","deletionTimestamp":null,"accountEnabled":true,"addIns":[],"alternativeNames":[],"appDisplayName":"azure-cli-2018-10-16-00-28-22","appId":"1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c","appOwnerTenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","appRoleAssignmentRequired":false,"appRoles":[],"displayName":"azure-cli-2018-10-16-00-28-22","errorUrl":null,"homepage":"https://azure-cli-2018-10-16-00-28-22","keyCredentials":[],"logoutUrl":null,"oauth2Permissions":[{"adminConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on behalf of the signed-in + user.","adminConsentDisplayName":"Access azure-cli-2018-10-16-00-28-22","id":"62fd8d99-6626-490b-80d0-20ee17ae9bb3","isEnabled":true,"type":"User","userConsentDescription":"Allow + the application to access azure-cli-2018-10-16-00-28-22 on your behalf.","userConsentDisplayName":"Access + azure-cli-2018-10-16-00-28-22","value":"user_impersonation"}],"passwordCredentials":[],"preferredTokenSigningKeyThumbprint":null,"publisherName":"AzureSDKTeam","replyUrls":[],"samlMetadataUrl":null,"servicePrincipalNames":["http://azure-cli-2018-10-16-00-28-22","1b4dbba3-a2f5-49e8-8e40-c2ce583b8e2c"],"servicePrincipalType":"Application","signInAudience":"AzureADMyOrg","tags":[],"tokenEncryptionKeyId":null}]}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['1529'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Tue, 16 Oct 2018 00:28:36 GMT'] + duration: ['358025'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [uCCQbpgVHNC8rue1lL9wVVx/oAWeG8jNKc51+E8x6H4=] + ocp-aad-session-key: [zWfC2GwKwRZECG6zrGADOZ2JmH6J5fhh2-VvWMhjZV7qASQ7qJH40OqRXmGIcRdgkSe7W2kHkTn9MCH8W6MeA05gVixKVyJB87jUq2hn91_6Gpq_-1SpPm6KxsOEk4a8p5-thUqQgy6BlbJYrH0QgA.yczNE3zvIqWEBlxOv_qIJWPHi7kfgQXKW7YePOWAAtI] + pragma: [no-cache] + request-id: [61a57d75-66ce-4066-8d82-34e7da9748d1] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad sp delete] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-mgmt-authorization/0.50.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignments?$filter=principalId%20eq%20%273435b2ef-82ac-493c-b8c8-297cbc5435e8%27&api-version=2018-01-01-preview + response: + body: {string: '{"value":[]}'} + headers: + cache-control: [no-cache] + content-length: ['12'] + content-type: [application/json; charset=utf-8] + date: ['Tue, 16 Oct 2018 00:28:39 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/10.0] + set-cookie: [x-ms-gateway-slice=productionb; path=/; secure; HttpOnly] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + x-ms-request-charge: ['1'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [ad sp delete] + Connection: [keep-alive] + Content-Length: ['0'] + User-Agent: [python/3.5.4 (Windows-10-10.0.17763-SP0) msrest/0.6.0 msrest_azure/0.4.34 + azure-graphrbac/0.51.0 Azure-SDK-For-Python AZURECLI/2.0.48] + accept-language: [en-US] + method: DELETE + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/applications/2537562f-3f2a-40b2-ba3a-f05ed017bd12?api-version=1.6 + response: + body: {string: ''} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + dataserviceversion: [1.0;] + date: ['Tue, 16 Oct 2018 00:28:39 GMT'] + duration: ['3478321'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [qxvg+LgKyuIFTpm0XjmicPMsnZzmR6m/OWBxHpYTkp8=] + ocp-aad-session-key: [UnSN0VQZiwfEwl0ssUW1WTxb7fvYZc5ozMjVk09xwdCf64E2m8imsYajaiwB6ovDCGiYmCGZcS5PqChFN4Ho4ovoIXyJjfC21BgsSVdxzICQ1r4XM2Ne-foe5G1BuLfRnDfDYlOfgL7Jb01E5PaEjg.UbUVnmA0dBv2CcsrOxsXT0JJzY0l3xMCNXtan8SK-3s] + pragma: [no-cache] + request-id: [c5b98ff4-4fe9-4409-9f9e-1d0c892ac50c] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 204, message: No Content} +version: 1 diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/tests/latest/test_graph.py b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/tests/latest/test_graph.py index df5e59fde2c..75facdd6349 100644 --- a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/tests/latest/test_graph.py +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/tests/latest/test_graph.py @@ -5,7 +5,7 @@ import json import mock from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import ScenarioTest, LiveScenarioTest +from azure.cli.testsdk import ScenarioTest, LiveScenarioTest, AADGraphUserReplacer, MOCKED_USER_NAME class ServicePrincipalExpressCreateScenarioTest(ScenarioTest): @@ -225,3 +225,30 @@ def test_graph_group_scenario(self): self.cmd('ad group delete -g {group}') except Exception: pass + + +class GraphOwnerScenarioTest(ScenarioTest): + def test_graph_ownership(self): + playback = not (self.is_live or self.in_recording) + if playback: + owner = MOCKED_USER_NAME + else: + account_info = self.cmd('account show').get_output_in_json() + if account_info['user']['type'] == 'servicePrincipal': + return # this test delete users which are beyond a SP's capacity, so quit... + owner = account_info['user']['name'] + + self.kwargs = { + 'owner': owner + } + self.recording_processors.append(AADGraphUserReplacer(owner, 'example@example.com')) + try: + self.kwargs['owner_object_id'] = self.cmd('ad user show --upn-or-object-id {owner}').get_output_in_json()['objectId'] + self.kwargs['app_id'] = self.cmd('ad sp create-for-rbac --skip-assignment').get_output_in_json()['appId'] + self.cmd('ad app owner add --owner-object-id {owner_object_id} --id {app_id}') + self.cmd('ad app owner list --id {app_id}', checks=self.check('[0].userPrincipalName', owner)) + self.cmd('ad app owner remove --owner-object-id {owner_object_id} --id {app_id}') + self.cmd('ad app owner list --id {app_id}', checks=self.check('length([*])', 0)) + finally: + if self.kwargs['app_id']: + self.cmd('ad sp delete --id {app_id}') diff --git a/src/command_modules/azure-cli-role/setup.py b/src/command_modules/azure-cli-role/setup.py index a9d6a4e4824..cc686f9db1f 100644 --- a/src/command_modules/azure-cli-role/setup.py +++ b/src/command_modules/azure-cli-role/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.1.7" +VERSION = "2.1.8" CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', @@ -34,7 +34,7 @@ 'azure-cli-core', 'azure-mgmt-authorization==0.50.0', 'azure-mgmt-monitor==0.5.2', - 'azure-graphrbac==0.40.0', + 'azure-graphrbac==0.51.1', 'azure-keyvault==1.1.0', 'pytz' ] diff --git a/src/command_modules/azure-cli-servicefabric/HISTORY.rst b/src/command_modules/azure-cli-servicefabric/HISTORY.rst index d9f67b39669..9aab7735b63 100644 --- a/src/command_modules/azure-cli-servicefabric/HISTORY.rst +++ b/src/command_modules/azure-cli-servicefabric/HISTORY.rst @@ -2,7 +2,6 @@ Release History =============== - 0.1.6 +++++ * Minor fixes diff --git a/src/command_modules/azure-cli-servicefabric/setup.py b/src/command_modules/azure-cli-servicefabric/setup.py index 4c12ee2e347..a624ccd4d65 100644 --- a/src/command_modules/azure-cli-servicefabric/setup.py +++ b/src/command_modules/azure-cli-servicefabric/setup.py @@ -35,7 +35,7 @@ ] DEPENDENCIES = [ - 'azure-graphrbac==0.40.0', + 'azure-graphrbac==0.51.1', 'azure-keyvault==1.1.0', 'azure-mgmt-network==2.2.1', 'azure-mgmt-compute==4.3.1',