本文介绍了ARM模板:查找用户对象ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图以编程方式将某个用户帐户的对象ID插入ARM模板,如下所示:

I'm trying to programatically insert the object Id of a certain user account into an ARM template, like this:

"objectId": "[reference(resourceId('Microsoft.AAD/domainServices/user/read','domain','User.Name'),'2019-01-01').Id]",

我尝试了许多不同的资源提供者,以使其正常工作.例如:

I've tried many different resource providers in an attempt to get this to work. For example:

"objectId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities/read','[email protected]'),'2019-01-01').Id]",

和:

"objectId": "[reference(resourceId('Microsoft.Portal/usersettings/read','[email protected]'),'2018-10-01').Id]"

我查找了用于获取用户列表的API调用,以查看这是否暗示了要使用的正确提供者(没有):

I looked up the API call used to get a list of users, to see if that would hint at the correct provider to use (it didn't):

GET https://graph.windows.net/{TenantId}/users?api-version=1.6 HTTP/1.1

我一直在浏览此提供程序操作列表,但是发现了两个问题:

I've been looking through this list of provider operations but have found two problems with this:

1我看不到与我想要执行的操作相关的操作.

1 I can't see an operation which looks relevant to what I want to do.

2它不提供有关需要哪些参数的信息.

2 It doesn't provide information on what parameters are required.

所以我想我真的有两个问题:

So I guess I have two questions really:

  1. 如何在ARM模板中动态查找用户的ObjectId?
  2. 将来如何查找可用的查找功能和所需的参数?

推荐答案

您无法在ARM模板中插入用户对象ID.

You could not insert the user object Id in the ARM template.

用户帐户由Azure AD租户管理,不是Azure资源,ARM模板用于订阅中的Azure资源.

The user account is managed by your Azure AD tenant, it is not the azure resource, the ARM template is for the azure resources in your subscription.

参考: https://docs .microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview

这篇关于ARM模板:查找用户对象ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 23:22