ARM模板:查找用户对象ID [英] ARM Template: Looking up a user object Id

查看:98
本文介绍了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','user@domain.onmicrosoft.com'),'2019-01-01').Id]",

和:

"objectId": "[reference(resourceId('Microsoft.Portal/usersettings/read','user@domain.onmicrosoft.com'),'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

Azure资源管理器是Azure的部署和管理服务.它提供了一致的管理层,使您可以创建,更新和删除Azure订阅中的资源.

Azure Resource Manager is the deployment and management service for Azure. It provides a consistent management layer that enables you to create, update, and delete resources in your Azure subscription.

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

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