azure.keyvault.secrets SecretClient returns Certificates togather with Secrets from the Azure Key Vault #39002
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
issue-addressed
Workflow: The Azure SDK team believes it to be addressed and ready to close.
KeyVault
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
`def get_secrets(key_vault_uri, credentials):
secret_client = SecretClient(vault_url=key_vault_uri, credential=credentials)
items = {
"secrets": []
}
Returns secrets and certificates instead of secretes only
To Reproduce
Steps to reproduce the behavior:
`import os
from azure.keyvault.secrets import SecretClient
from azure.identity import DefaultAzureCredential
KVUri = f"https://xxxxxxxxxxxxxxxxxxxxxxxx.vault.azure.net/"
credential = DefaultAzureCredential()
client = SecretClient(vault_url=KVUri, credential=credential)
print(f"Retrieving your secret from KV_NAME.")
secret_list = client.list_properties_of_secrets()
for secret in secret_list:
secret_data = client.get_secret(secret.name)
print(f"{secret_data.properties}")
`
2. Prepare Azure Key Vault with:
Expected behavior
SecretClient should return only secrets
Screenshots
n/a
Additional context
n/a
The text was updated successfully, but these errors were encountered: