Is there currently a block capable of configuring ...
# ask-community
d
Is there currently a block capable of configuring access to an Azure Keyvault from within K8s job infrastructure ?
1
c
Not as a block, but you can do this using managed identity and code
what are you looking to do specifically?
d
I need my flows to be able to access the kayvault to retrieve various credentials for external APIs like fivetran and power bi
c
Unfortunately, there is not a tie-in block yet for vaults (keyvault / hashicorp / secrets manager) , but you can use the native code to do this in-flow like:
Copy code
from azure.identity import DefaultAzureCredential, ManagedIdentityCredential
from azure.keyvault.secrets import SecretClient

# Set up the default credential, which uses the managed identity of the Azure resource (ACI, VM, etc.)
credential = DefaultAzureCredential(exclude_shared_token_cache_credential=True)

# Create a secret client using the default credential and the URL to the Key Vault
secret_client = SecretClient(vault_url="<https://mykeyvault.vault.azure.net>", credential=credential)

# Retrieve the secret
secret_name = "mysecret"
retrieved_secret = secret_client.get_secret(secret_name)
I’ve used this with managed identity for things like cloning code from a private repository, or blob storage connection strings
within a prefect flow
There is a goal to integrate 3rd party secret storage, but unfortunately I don’t have a timeline of when that might be complete
d
Got it. Thank you.