gpt4 book ai didi

python - 在Python中从Azure keyvault检索 key 的内容

转载 作者:行者123 更新时间:2023-12-03 06:51:42 25 4
gpt4 key购买 nike

我想通过 python 检索 Azure key 保管库上的 key 内容。此代码块返回我的 key 属性,而不是内容(我想要 key 的二进制内容):

from azure.identity import DefaultAzureCredential
from azure.keyvault.keys import KeyClient

credential = DefaultAzureCredential()

key_client = KeyClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)
key = key_client.get_key("key-name")
print(key.name)

我找到了this用于从 Key Vault 检索 secret 的代码,但我需要检索 key

如何从 azure keyvault 检索 key 的(二进制)内容?

最佳答案

How can I retrieve (binary) content of a key from azure keyvault?

简单的答案是你不能。一旦 key 存储在 KeyVault 中,就无法检索其值。这就是将 key 存储在 KeyVault 中的全部目的。

关于python - 在Python中从Azure keyvault检索 key 的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73540677/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com