First pass at process of adding admin to azure
This commit is contained in:
parent
15ff4a01f1
commit
608f988b71
@ -457,8 +457,6 @@ class AzureCloudProvider(CloudProviderInterface):
|
|||||||
root_creds = self.root_creds()
|
root_creds = self.root_creds()
|
||||||
credentials = self._get_credential_obj(root_creds)
|
credentials = self._get_credential_obj(root_creds)
|
||||||
|
|
||||||
self.azure_mgmt.
|
|
||||||
|
|
||||||
sub_client = self.azure_mgmt.subscription.SubscriptionClient(credentials)
|
sub_client = self.azure_mgmt.subscription.SubscriptionClient(credentials)
|
||||||
subscription: self.azure_mgmt.subscription.models.Subscription = sub_client.subscriptions.get(
|
subscription: self.azure_mgmt.subscription.models.Subscription = sub_client.subscriptions.get(
|
||||||
csp_environment_id
|
csp_environment_id
|
||||||
@ -468,6 +466,10 @@ class AzureCloudProvider(CloudProviderInterface):
|
|||||||
# the cloud0 subscription? tenant id seems to be separate from subscription id
|
# the cloud0 subscription? tenant id seems to be separate from subscription id
|
||||||
graph_client = self.azure_graph.GraphRbacManagementClient(
|
graph_client = self.azure_graph.GraphRbacManagementClient(
|
||||||
credentials, root_creds.get("tenant_id")
|
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(
|
app_create_param = self.azure_graph.models.ApplicationCreateParameters(
|
||||||
display_name=app_display_name
|
display_name=app_display_name
|
||||||
)
|
)
|
||||||
@ -475,8 +477,6 @@ class AzureCloudProvider(CloudProviderInterface):
|
|||||||
app_create_param
|
app_create_param
|
||||||
)
|
)
|
||||||
|
|
||||||
self.azure_graph.models.
|
|
||||||
|
|
||||||
# create a new service principle for the new application, which should be scoped
|
# create a new service principle for the new application, which should be scoped
|
||||||
# to the new subscription
|
# to the new subscription
|
||||||
app_id = app.app_id
|
app_id = app.app_id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user