Complete the code to retrieve a secret from Azure Key Vault.
secret = client.get_secret([1])You must pass the secret name as a string to the get_secret method.
Complete the code to create a Key Vault client with default Azure credentials.
client = SecretClient(vault_url=[1], credential=DefaultAzureCredential())The vault URL must be the full URL including https and domain.
Fix the error in the code to securely store a secret in Azure Key Vault.
client.set_secret([1], "mySecretValue")
The first argument must be the secret name as a string, not the secret value.
Fill both blanks to check if a secret exists and print its value.
try: secret = client.get_secret([1]) print(secret.[2]) except ResourceNotFoundError: print("Secret not found")
You get the secret by its name as a string, then access its value property to print.
Fill all three blanks to create a secret, retrieve it, and print its value.
client.set_secret([1], [2]) retrieved = client.get_secret([3]) print(retrieved.value)
You must use the same secret name as a string when setting and getting the secret. The secret value is also a string.