c# - Azure keyvault 值未进入我的代码
问题描述
我正在尝试从 azure 获取 keyvault 值。我已经使用下面提到的步骤来获取密钥。Crypto 进展顺利,但在 KeyVault 部分却没有。
string key = KeyVault.GetValueByKey(Crypto.GetDecryptedValue(WebConfigurationManager.LicenseKey))
我以 ThumbPrint 形式给出的 Liensekey 值。
public static string GetValueByKey(string key)
{
string value = string.Empty;
try
{
if (secrets.ContainsKey(key) == false)
{
value = KeyVault.GetSecret(key);
secrets.Add(key, value); //Caching
}
else
{
value = secrets[key];
}
}
catch (Exception Ex)
{
new CustomException("Failed to retrieve the value from keyvalult for key:'" + key + "'", Ex);
}
它value = KeyVault.GetSecret(key);
一步一步失败了。任何人都可以在这方面帮助我。
解决方案
推荐阅读
- javascript - 路由器路径不能正常工作?
- javascript - 在 Material UI 中使用 withStyles HOC 时,Typescript 道具与组件道具不匹配
- python - 弹丸给出直线的Python动画
- python - python中的API状态设计模式
- node.js - 为什么 TypeORM 需要提供 OneToMany 的反面,但不需要提供 ManyToOne 的反面?
- spring - 带有 Spring Boot 2.1 WebMvcTest 的 Kotlin - 缺少 bean
- php - PHP从字符串获取unix时间戳而不设置默认时区
- flutter - 如何用已经获得的未来实现 FutureBuilder
- java - 后台服务中的 Android webRTC 视频通话
- sql - Alation 查询表单 - 参数不适用于“IN”运算符