在 Azure 中创建凭据时遇到问题

Trouble creating credentials in Azure

我正在使用 GetSSL - Azure Automation PowerShell 脚本在 Azure 中设置 Let's Encrypt SSL 证书。作为其中的一部分,我必须为要使用的脚本设置一个 Azure AD 用户。

但是,当 运行 脚本在 运行 Get-AutomationPSCredential cmdlet 时出错:

Credentials asset not found. To create this Credentials asset, navigate to the Assets blade and create a Credentials asset named: myuser@mydomain.com.

但是,当我尝试在 Azure 门户中创建凭据时,我看到了这个错误:

所以,我有点卡住了。

欢迎任何有关在 Azure 中创建凭据(或实际上设置 Let's Encrypt SSL 证书!)的建议!

您没有按照正确的步骤创建自动化凭据。

要创建新凭据,请转到您在 Azure 门户中创建的自动化帐户。在自动化帐户的左侧选项窗格中,向下滚动到共享资源部分并单击凭据选项。 Select 在顶部添加凭据选项以创建新凭据。

您还可以选择使用下面的 Windows Powershell 创建自动化凭据 -

$user = "MyDomain\MyUser"
$pw = ConvertTo-SecureString "PassWord!" -AsPlainText -Force
$cred = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $user, $pw
New-AzureAutomationCredential -AutomationAccountName "MyAutomationAccount" -Name "MyCredential" -Value $cred