json - 我可以将 JSON 存储在 Azure Key Vault 中吗

标签 json azure azure-keyvault

我有一些 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/

相关文章:

c# - 将 Azure KeyVault key 转换为 RSACng 或 RSACryptoServiceProvider

javascript - 循环闭合 - 我把它放在哪里?

json - 运算符不存在 - Postgres 和 JSON 选择查询

javascript - 从 JSON 文件在 JavaScript 中创建数组

java - 理解从 get_responses 返回的 SurveyMonkey API JSON 数据

azure - 如何管理 Azure Durable Functions 的执行历史记录

azure - 是否建议面向客户的应用程序使用 Azure Active Directory 进行身份验证?

azure - 为 .net 6 Web 应用程序配置 App Insights

国家云的 Azure Key Vault 域名

c# - dotnet 程序中的 Azure.Identity.CredentialUnavailableException