【问题标题】:Authenticating to Azure Resource Manager with a Service Principal in Azure Automation在 Azure 自动化中使用服务主体向 Azure 资源管理器进行身份验证
【发布时间】:2015-10-07 17:47:04
【问题描述】:

所以现在有一个 documented workaround 在 Azure 自动化中使用 ARM,还有一个 well documented 如何使用服务主体对 ARM 进行身份验证。但即使按照这些步骤进行操作,我仍然无法将这些组合起来工作。使用服务主体在自动化中运行我的 Runbook 总是会出现以下错误:

New-AzureTag : Your Azure credentials have not been set up or have expired, please run Add-AzureAccount to set up your 
Azure credentials.
At Add-SubscriptionTags:48 char:48
+ 
    + CategoryInfo          : CloseError: (:) [New-AzureTag], ArgumentException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Tags.Tag.NewAzureTagCommand

Add-AzureAccountSelect-AzureSubscription 都可以正常执行,但是当我调用任何 cmdlet 来实际执行某些操作时,我会收到上述错误。

当我使用常规 AAD 组织帐户时,我的运行手册可以正常工作,因此我认为这不是自动化/ARM 问题。

使用服务主体在我的 PC 上运行我的工作流也可以,所以我认为我的服务主体设置正确。

有没有人成功实现过这个场景?

【问题讨论】:

  • 我还搞砸了两次调用Add-AzureAccount 并使用基于this GitHub issue 的AzureProfiles,但没有乐趣。

标签: azure azure-automation azure-resource-manager


【解决方案1】:

这是由于 Azure PowerShell 中的错误造成的。它已被识别,并且有一个工作项来修复它。如果我能找到它,我会添加 GitHub 问题。

更新:这是 GitHub 问题 https://github.com/Azure/azure-powershell/issues/655

【讨论】:

  • 另外,除非 PS 修复程序很快就会发布,否则可能值得在您的 blog post 中记录限制,这意味着服务主体将起作用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-11-03
  • 2017-09-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多