【发布时间】:2019-06-21 11:54:26
【问题描述】:
我在我的 MVC Web 应用程序中使用 Azure Key Vault。我使用证书连接到 Key Vault。下面是我的示例代码
AssertionCert = GetCertificate(WebConfigurationManager.AppSettings[KeyVaultConstant.ApplicationID], WebConfigurationManager.AppSettings[KeyVaultConstant.CertificateThumbprint], false);
var keyClient = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback((authority, resource, scope) => GetToken(authority, resource, scope, AssertionCert)));
var secrets = keyClient.GetSecretsAsync(WebConfigurationManager.AppSettings["VaultUri"]).GetAwaiter().GetResult();
在某些情况下,我收到一条错误消息 加密异常:密钥集不存在
在研究中,我发现我必须授予 IIS_IUser 对存储主键的文件夹的权限。我这样做了,但有时我会收到此错误。这不会每次都发生。
【问题讨论】:
标签: c# .net azure x509certificate azure-keyvault