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

查看:22
本文介绍了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 Resource Manager 是 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天全站免登陆