gpt4 book ai didi

azure - 作业暂停运行 Login-AzureRmAccount 以使用 Azure AutomationAccounts 系统托管标识登录

转载 作者:行者123 更新时间:2023-12-03 07:00:19 27 4
gpt4 key购买 nike

我正在尝试使用 Azure 自动化帐户系统管理身份选项关闭 VM。

但是我最终遇到了以下错误。

enter image description here

根据其他文章,提到升级模块 Update-ModulesInAutomationToLatestVersion 但由于以下错误,我无法更新。我不确定脚本中存在什么问题。相同的脚本可与 AzureRunAsConnection 选项配合使用,不会出现任何问题 ( script )。我什至使用系统管理身份进行简单登录检查,它成功登录并获取资源组名称。

enter image description here

最佳答案

我已经在我的自动化帐户中测试了上述共享脚本。以下是几个观察结果:

  1. 您需要使用 Connect-AzureRMAccount -Identity cmdlet 而不是“connect-AzAccount”来连接到您的订阅,因为脚本的其余部分是使用 Azure RM cmdlet 编写的。
  2. 如果我们在您的运行手册脚本中使用 AzureRM cmdlet,则作业将被暂停,表明 Azure RM 将停用,并建议我们在您的工作流程中使用 Az 模块.
  3. 您可以引用this documentation了解如何将 PowerShell 脚本自动从 AzureRM 迁移到 AZ 模块。
  4. 如果您想在虚拟机上执行启动/停止,您可以利用 Azure Automation start/stop during the off hours功能。

关于azure - 作业暂停运行 Login-AzureRmAccount 以使用 Azure AutomationAccounts 系统托管标识登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72481134/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com