相关疑难解决方法(0)

如何以编程方式创建Azure KeyVault密钥时,如何修复"操作'设置'不允许"错误?

我正在尝试使用Microsoft以编程方式创建Azure KeyVault密钥.Azure.KeyVault.KeyVaultClient.出于我的目的,我将使用证书作为Azure AD应用程序进行身份验证令牌身份验证.Azure AD应用程序已在其清单中包含证书信息.

我的代码创建Azure KeyVault,为Azure AD应用程序的对象ID提供密码和密钥的"所有"权限.我验证使用Powershell检索KeyVault并查看访问策略时发生了这种情况.

当我尝试使用KeyVaultClient.SetSecretAsync()在此KeyVault上创建一个秘密时,我得到一个异常,说"不允许操作'设置'." 状态代码为"Forbidden".

在KeyVault上设置的权限之外,我是否需要确保其他任何权限(如Azure AD应用程序)?

azure azure-keyvault

5
推荐指数
1
解决办法
3899
查看次数

Azure Key Vault:部署后无法从kv获取证书

我有一个webjob从azure密钥保险库服务中获取证书,并且在本地我没有从kv访问/获取此证书的问题。但是,当部署此webjob时,出现此错误:

System.Security.Cryptography.CryptographicException: The system cannot find the file specified.

   at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
   at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)
   at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags)
   at Microsoft.Ambassadors.Infrastructure.KeyVaultService.<GetCertificateAsync>d__7.MoveNext() in C:\Source\Repos\Xbox.Ambassadors\Microsoft.Ambassadors.Azure\Microsoft.Ambassadors.Infrastructure\KeyVaultService.cs:line 0
Run Code Online (Sandbox Code Playgroud)

我已经使用AAD注册了该应用程序(托管此Webjob的位置),并且该应用程序具有对kv空间的只读访问权限。我发现了一些与此相关的帖子(我认为..?):

“发生了内部错误。” 使用X509Certificate2加载pfx文件时

X509Certificate构造函数异常

但是我不确定这是否可以解决我的问题...?如果有人可以提供帮助,那真是太好了!感谢:D

certificate azure azure-keyvault

4
推荐指数
1
解决办法
637
查看次数

标签 统计

azure ×2

azure-keyvault ×2

certificate ×1