Open slavizh opened 5 months ago
@eketo-msft we should take a look at this. This makes sense to me. I wonder if we should do the same for devices, while we are at it. @slavizh already has a legitimate ask for adding uniqueName
property to groups too - #128
Additionally to add scenario to this - there are many Azure resources that allow configuring (via Bicep) Microsoft Entra users, groups or service principals for authenticating to the service's data plane.
@slavizh, would userPrincipalName work for your scenarios? It's not an alternate key (officially) and it can change, but it is unique and there is reluctance to add additional "name" properties to the User resource.
@eketo-msft yes it should be sufficient.
Quick update: We added support for UPN as an alternative key on the User resource in MS Graph. Next up we're working on Bicep type support so it can be used with the existing keyword. That is likely to land in early December due to lockdowns for the US elections and Thanksgiving holidays.
@eketo-msft awesome! that will make referencing users even more easier.
@eketo-msft - does that mean something like this will work?
resource user 'Microsoft.Graph/users@v1.0' existing = {
userPrincipalName: 'alfran@microsoft.com'
}
output objectId string = user.objectId
If so, then I think it will also close this issue: https://github.com/Azure/bicep/issues/645
@alex-frankel, exactly. It will allow reading an existing user by UPN and then referencing the user for operations, like managing membership, which require objectId
(or id
in MS Graph).
Amazing! You will make a lot of people happy with this one!
Is your feature request related to a problem? Please describe. Users can be members of groups. Due to that would be good if you can add them to groups using existing syntax. Currently that is not possible due to users not being part of the resources available in Bicep Graph.
Describe the solution you'd like With this I would like not specifically to be able to deploy users with Bicep Graph but to at least being able to reference them by unique name. As uniqueName is something that can be updated by Graph API and it is something that most Graph resources in Bicep have would makes things easier if you can use existing syntax for users before being able to deploy the users via Bicep. I would assume just adding uniqueName to user resources it will be a lot easier than just making it available for creation via Bicep.
Additional context Add any other context or screenshots about the feature request here.