Azure 自动化 - 续订 RunAsAccount 证书

Azure Automation - Renew Certificate of RunAsAccount

我正在尝试自动更新 RunAsAccount 的证书。在门户中有一个简单的按钮,可以让您更新帐户的证书。但是,这在商业案例中是不合适的。

我找到了一些使用 PowerShell 更新该证书的解决方案,但它们都依赖于本地计算机的执行,我需要一些可以在 runbook 中完成的操作。

我已经尝试过的基本上是在 env:temp 变量中创建一个新的自签名证书,然后在 New-AzureRmAutomationCertificate 函数中导入该证书。不幸的是,这似乎不起作用。

感谢您对此的任何想法或提示!

您可以使用这个PowerShell script来帮助更新认证。

To create or update an Automation account, you must have the following privileges and permissions:

To create an Automation account, your Azure AD user account must be added to a role with permissions equivalent to the Owner role for Microsoft Automation resources. In the Azure portal, under Azure Active Directory > MANAGE > App registrations, if App registrations is set to Yes, non-admin users in your Azure AD tenant can register Active Directory applications. If App registrations is set to No, the user who performs this action must be a global administrator in Azure AD.

另请参阅 this MSDN thread,它处理与您遇到的相同问题。