更新Let的加密SSL证书时出错

时间:2018-04-12 06:36:45

标签: powershell azure ssl-certificate lets-encrypt

这是错误的一部分:

Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: Functions.RenewCertificate ---> System.ArgumentException: 'authority' should be in Uri format Parameter name

当我通过PowerShell安装de aplication时执行此命令(the tutorial that i followed

$ app = New-AzureRmADApplication -DisplayName {some display name} -HomePage $ uri -IdentifierUris $ uri -Password $ password

它显示了这个错误:

ConvertTo-SecureString: Can not bind argument to parameter 'String' because it is null. At line: 1 char: 44 + $ password = ConvertTo-SecureString -String $ _. password -AsPlainText - ... + ~~~~~~~~~~~ + CategoryInfo: InvalidData: (:) [ConvertTo-SecureString], ParameterBindingValidationException + FullyQualifiedErrorId: ParameterArgumentValidationErrorNullNotAllowed, Microsoft.PowerShell.Commands.ConvertToSecureStringCommand

所以我用$ password = ConvertTo-SecureString -String $ password -AsPlainText -Force“修复它”。

如何解决错误?

由于

1 个答案:

答案 0 :(得分:1)

当您尝试使用密码创建新的AAD应用程序时,-password需要 SecureString

以下是示例:

PS E:\> $SecureStringPassword = ConvertTo-SecureString -String "password" -AsPlainText -Force
PS C:\> New-AzureRmADApplication -DisplayName "NewApplication" -HomePage "http://www.microsoft.com" -IdentifierUris "http:
//NewApplication" -Password $SecureStringPassword

必填参数:

enter image description here

有关此命令的详细信息,请参阅此article