From 608f988b71e54c3668a86f54520c7d97c9926ad0 Mon Sep 17 00:00:00 2001 From: tomdds Date: Fri, 27 Sep 2019 14:41:42 -0400 Subject: [PATCH] First pass at process of adding admin to azure --- atst/domain/csp/cloud.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/atst/domain/csp/cloud.py b/atst/domain/csp/cloud.py index 58dac63a..420518d1 100644 --- a/atst/domain/csp/cloud.py +++ b/atst/domain/csp/cloud.py @@ -457,8 +457,6 @@ class AzureCloudProvider(CloudProviderInterface): root_creds = self.root_creds() credentials = self._get_credential_obj(root_creds) - self.azure_mgmt. - sub_client = self.azure_mgmt.subscription.SubscriptionClient(credentials) subscription: self.azure_mgmt.subscription.models.Subscription = sub_client.subscriptions.get( csp_environment_id @@ -468,6 +466,10 @@ class AzureCloudProvider(CloudProviderInterface): # the cloud0 subscription? tenant id seems to be separate from subscription id graph_client = self.azure_graph.GraphRbacManagementClient( credentials, root_creds.get("tenant_id") + ) + + # assuming the graph_client is scoped to the new subscription, create an application + app_display_name = "?" app_create_param = self.azure_graph.models.ApplicationCreateParameters( display_name=app_display_name ) @@ -475,8 +477,6 @@ class AzureCloudProvider(CloudProviderInterface): app_create_param ) - self.azure_graph.models. - # create a new service principle for the new application, which should be scoped # to the new subscription app_id = app.app_id