Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save gregjhogan/2491ced2aeded49e0d007bc04db2eb0a to your computer and use it in GitHub Desktop.

Select an option

Save gregjhogan/2491ced2aeded49e0d007bc04db2eb0a to your computer and use it in GitHub Desktop.
azure sdk python key vault get secret using client from cli credentials
from azure.common.credentials import get_azure_cli_credentials
credentials, subscription_id = get_azure_cli_credentials(resource="https://vault.azure.net")
kv_client = KeyVaultClient(credentials=credentials)
kv_secret = kv_client.get_secret("https://<vault-name>.vault.azure.net/", "<secret-name>", "")
print(kv_secret.value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment