Created
March 24, 2022 06:28
-
-
Save skyline75489/d9818a133bbd9e230240a9b2543bb1b2 to your computer and use it in GitHub Desktop.
Use-keyvault-in-AzureVm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from azure.keyvault.secrets import SecretClient | |
from azure.identity import ClientSecretCredential, DefaultAzureCredential, ManagedIdentityCredential | |
identity = DefaultAzureCredential(managed_identity_client_id='CLIENT_ID') | |
client = SecretClient("https://MY_VAULT.vault.azure.net", identity) | |
r = client.get_secret('MY_SECRET') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment