hi i've set-up credentials hooks (kedro 0.19) and want to access the azure_creds values from inside the pipelines file to pass them to the node function, but OmegaConfigLoader is returning an empty value, is there a solution to this ?
#hooks.py from kedro.framework.hooks import hook_impl from azure.keyvault.secrets import SecretClient from azure.identity import DefaultAzureCredential class AzureSecretsHook: @hook_impl def after_context_created(self, context) -> None: keyVaultName = "keyvault-0542abb" # or os.environ["KEY_VAULT_NAME"] if you would like to provide it through environment variables KVUri = f"https://{keyVaultName}.vault.azure.net" my_credential = DefaultAzureCredential() client = SecretClient(vault_url=KVUri, credential=my_credential) secrets = { "abs_creds": "azure-blob-store", "s3_creds": "s3-bucket-creds", } azure_creds = { cred_name: client.get_secret(secret_name).value for cred_name, secret_name in secrets.items() } context.config_loader["credentials"] = { **context.config_loader["credentials"], **azure_creds, }
hi Eduard, context dict is immutable except of globals, so looks like you should use globals here?
https://docs.kedro.org/en/stable/configuration/advanced_configuration.html#how-to-use-global-variables-with-the-omegaconfigloader