我有一些 JSON 想要存储在 Azure Key Vault 中。
数据并不像这样分层:
{
"type": "XXXXXX",
"project_id": "XXXXXX",
"private_key_id": "XXXXXXXX"
}
但是我有 4 组 JSON 数据,每组都有一些 secret ,所以我希望不必将它们分解成单独的 key ,但如果必须的话我会这样做。
最佳答案
将此视为使用 Azure CLI 将 secret 添加到 Azure Key Vault 的有效语句。 :
az keyvault secret set --vault-name "<YourKeyVaultName>" --name "AppSecret" --value "MySecret"
,取自Tutorial: Use Azure Key Vault with an Azure web app in .NET
在此基础上,我看不出有任何原因该值 MySecret
不能是 JSON 字符串。
进一步调查一下,看看 About keys, secrets, and certificates - Key Vault secrets :
From a developer's perspective, Key Vault APIs accept and return secret values as strings. Internally, Key Vault stores and manages secrets as sequences of octets (8-bit bytes), with a maximum size of 25k bytes each.
因此,只要您的 JSON 低于 25k 限制,就可以开始使用。
关于json - 我可以将 JSON 存储在 Azure Key Vault 中吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54009278/