Skip to content

Commit 004133a

Browse files
fix: managed identity (#25)
1 parent f5d43a8 commit 004133a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/allie/flowkit/config/_config.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,21 @@ def _load_config(self, config_path: str) -> dict:
118118

119119
def _get_config_from_azure_key_vault(self):
120120
"""Extract configuration from Azure Key Vault and set attributes."""
121+
# Get environment variables
122+
azure_managed_identity_id = os.getenv(self.azure_managed_identity_id)
123+
azure_key_vault_name = os.getenv(self.azure_key_vault_name)
124+
121125
# Check if all required environment variables are set
122-
if not self.azure_managed_identity_id:
126+
if not azure_managed_identity_id:
123127
raise ValueError(f"Environment variable for {self.azure_managed_identity_id} is not set")
124-
if not self.azure_key_vault_name:
128+
if not azure_key_vault_name:
125129
raise ValueError(f"Environment variable for {self.azure_key_vault_name} is not set")
126130

127131
# Create Key Vault URL
128-
key_vault_url = f"https://{self.azure_key_vault_name}.vault.azure.net/"
132+
key_vault_url = f"https://{azure_key_vault_name}.vault.azure.net/"
129133

130134
# Create Managed Identity credential
131-
credential = ManagedIdentityCredential(client_id=self.azure_managed_identity_id)
135+
credential = ManagedIdentityCredential(client_id=azure_managed_identity_id)
132136

133137
# Test the managed identity by getting a token
134138
scope = "https://vault.azure.net/.default"

0 commit comments

Comments
 (0)