【问题标题】:What does Object reference not set to an instance of an object error mean when using Add-AzServiceFabricClusterCertificate?使用 Add-AzServiceFabricClusterCertificate 时,未将对象引用设置为对象错误的实例是什么意思?
【发布时间】:2020-07-04 19:38:22
【问题描述】:

我正在尝试向服务结构添加新的辅助证书,但是收到以下错误。有没有人有任何指示?

PS C:\WINDOWS\system32> Add-AzServiceFabricClusterCertificate -ResourceGroupName '******'  -Name '********'  -SecretIdentifier '*************'  
Add-AzServiceFabricClusterCertificate : Object reference not set to an instance of an object.
At line:1 char:1
+ Add-AzServiceFabricClusterCertificate -ResourceGroupName '****
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Add-AzServiceFabricClusterCertificate], NullReferenceException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ServiceFabric.Commands.AddAzureRmServiceFabricClusterCertificate

【问题讨论】:

    标签: azure powershell azure-service-fabric azure-keyvault


    【解决方案1】:

    我无法重现您的问题,它适用于我。

    尝试使用以下命令更新Az.ServiceFabric,我的版本是2.0.1

    Update-Module -Name Az.ServiceFabric -Force
    

    在 azure keyvault 中,我使用自签名证书,请确保您使用下面的 SecretIdentifier

    然后使用 powershell 并在门户中检查结果。

    Add-AzServiceFabricClusterCertificate -ResourceGroupName '<group-name>' -Name 'joyfabric' -SecretIdentifier 'https://joykeyvault.vault.azure.net/secrets/cer135/23c6706daeab47e59caca2431ad96a1c'
    

    【讨论】:

    • 感谢您的回答,我有一个问题,我的证书存在于 Secrets Blade 中,这是个问题吗?
    • @TaherKhan 您需要将您的证书导入到证书刀片而不是秘密刀片中的密钥库中,然后单击它,您会找到一个像屏幕截图一样的秘密网址。
    猜你喜欢
    • 2012-04-25
    • 2010-10-21
    • 2019-03-20
    • 2011-07-09
    • 2012-08-31
    • 2011-11-21
    • 2012-10-01
    • 1970-01-01
    相关资源
    最近更新 更多