Skip to content

Commit

Permalink
Merge pull request #3 from oZakari/users/mjhoffmeister/kusto-cluster-…
Browse files Browse the repository at this point in the history
…ssid

feat: add system-assigned managed identity option
  • Loading branch information
oZakari authored Aug 14, 2024
2 parents 7ec79ac + e7835db commit 92634f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions avm/res/kusto/cluster/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ var formattedUserAssignedIdentities = reduce(

var identity = !empty(managedIdentities)
? {
type: !empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'UserAssigned' : 'None'
type: (managedIdentities.?systemAssigned ?? false)
? (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'SystemAssigned,UserAssigned' : 'SystemAssigned')
: (!empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'UserAssigned' : 'None')
userAssignedIdentities: !empty(formattedUserAssignedIdentities) ? formattedUserAssignedIdentities : null
}
: null
Expand Down Expand Up @@ -296,7 +298,7 @@ module kustoCluster_principalAssignments 'principal-assignment/main.bicep' = [
principalId: principalAssignment.principalId
principalType: principalAssignment.principalType
role: principalAssignment.role
tenantId: contains(principalAssignment, 'tenantId') ? principalAssignment.tenantId : tenant().tenantId
tenantId: principalAssignment.?tenantId ?? tenant().tenantId
}
}
]
Expand Down Expand Up @@ -467,6 +469,9 @@ type lockType = {
}?

type managedIdentitiesType = {
@description('Optional. Enables system assigned managed identity on the resource.')
systemAssigned: bool?

@description('Optional. The resource id(s) to assign to the resource.')
userAssignedResourceIds: string[]
}?
Expand Down
2 changes: 1 addition & 1 deletion avm/res/kusto/cluster/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.2",
"version": "0.3",
"pathFilters": [
"./main.json"
]
Expand Down

0 comments on commit 92634f3

Please sign in to comment.