-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmanaged-identity.bicep
43 lines (39 loc) · 1.68 KB
/
managed-identity.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@description('Name of the resource.')
param name string
@description('Location to deploy the resource. Defaults to the location of the resource group.')
param location string = resourceGroup().location
@description('Tags for the resource.')
param tags object = {}
@export()
@description('Role assignment information for an identity.')
type roleAssignmentInfo = {
@description('Role definition ID for the RBAC role to assign to the identity.')
roleDefinitionId: string
@description('Principal ID of the identity to assign to.')
principalId: string
@description('Type of the principal ID.')
principalType: 'Device' | 'User' | 'Group' | 'ServicePrincipal' | 'ForeignGroup'
}
@export()
@description('Identity information to use for role assignments.')
type identityInfo = {
@description('Principal ID of the identity to assign to.')
principalId: string
@description('Type of the principal ID.')
principalType: 'Device' | 'User' | 'Group' | 'ServicePrincipal' | 'ForeignGroup'
}
resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-07-31-preview' = {
name: name
location: location
tags: tags
}
@description('The deployed Managed Identity resource.')
output resource resource = identity
@description('ID for the deployed Managed Identity resource.')
output id string = identity.id
@description('Name for the deployed Managed Identity resource.')
output name string = identity.name
@description('Principal ID for the deployed Managed Identity resource.')
output principalId string = identity.properties.principalId
@description('Client ID for the deployed Managed Identity resource.')
output clientId string = identity.properties.clientId