From 7b1a50bdd3090bd9914dc3fdb3feac9f7a043efe Mon Sep 17 00:00:00 2001 From: Matt Craddock <5796417+craddm@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:23:13 +0000 Subject: [PATCH] Retrieve SRE sub name and use that when connecting to guac database --- data_safe_haven/administration/users/guacamole_users.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/data_safe_haven/administration/users/guacamole_users.py b/data_safe_haven/administration/users/guacamole_users.py index 8c0c5381a0..997ef7e138 100644 --- a/data_safe_haven/administration/users/guacamole_users.py +++ b/data_safe_haven/administration/users/guacamole_users.py @@ -23,7 +23,10 @@ def __init__( pulumi_config=pulumi_config, ) # Read the SRE database secret from key vault - azure_sdk = AzureSdk(context.subscription_name) + azure_sdk = AzureSdk(subscription_name=context.subscription_name) + sre_subscription_name = azure_sdk.get_subscription_name( + config.azure.subscription_id + ) connection_db_server_password = azure_sdk.get_keyvault_secret( sre_stack.output("data")["key_vault_name"], sre_stack.output("data")["password_user_database_admin_secret"], @@ -33,7 +36,7 @@ def __init__( connection_db_server_password, sre_stack.output("remote_desktop")["connection_db_server_name"], sre_stack.output("remote_desktop")["resource_group_name"], - context.subscription_name, + sre_subscription_name, ) self.users_: Sequence[ResearchUser] | None = None self.postgres_script_path: pathlib.Path = (