验证天青资源管理器在Azure的自动化服务主体 [英] Authenticating to Azure Resource Manager with a Service Principal in Azure Automation

查看:299
本文介绍了验证天青资源管理器在Azure的自动化服务主体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以现在是一个<一个href=\"https://azure.microsoft.com/blog/2015/07/14/using-azure-resource-manager-in-azure-automation-runbooks/\"相对=nofollow>记载的解决方法在Azure中自动使用ARM,它也是<一个href=\"http://azure.microsoft.com/blog/2014/08/27/azure-automation-authenticating-to-azure-using-azure-active-directory/\"相对=nofollow>据可查如何进行身份验证使用服务主体为ARM。但是,即使按照这些步骤后,我仍然无法得到这些的结合工作。我运行自动化运行手册与服务主体总是提供了以下错误:

So there's now a documented workaround to use ARM in Azure Automation, and it's also well documented how to authenticate to ARM using a Service Principal. But even after following these steps I still cannot get the combination of those to work. Running my runbook in Automation with a Service Principal always gives the following error:

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

添加-AzureAccount 选择-AzureSubscription 都会执行罚款,但是当我调用任何cmdlet来确实做了什么我得到上述错误。

Add-AzureAccount and Select-AzureSubscription both execute fine, but when I call any cmdlet to actually do something I get the above error.

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

My runbook works when I use a regular AAD org account, so I don't think it's an Automation/ARM issue.

运行我的工作流程我与服务主体也适用PC上,所以我觉得我的服务主体设置正确。

Running my workflow on my PC with the service principal also works, so I think my service principal is set up correctly.

有没有人成功实施此方案?

Has anyone successfully implemented this scenario?

推荐答案

这是由于在Azure中的PowerShell的错误。它已被确定,有一个工作项目来解决它。如果我能找到它,我将添加GitHub的问题。

This is due to a bug in Azure PowerShell. It has been identified and there is a work item to fix it. I will add the GitHub issue if I'm able to find it.

更新:下面是GitHub的问题 https://开头的github .COM /天青/蔚的PowerShell /问题/ 655

Update: Here's the GitHub issue https://github.com/Azure/azure-powershell/issues/655

这篇关于验证天青资源管理器在Azure的自动化服务主体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆