MSI with role assigmnet in the same main #4063
-
Dear All, I like to ask question, how to resovle my issue without spliting to diffrent process. In my structure I have 2 modules
But when I run on fresh start I see thta identity casnnot be found in dicrectory I alredy added "dependsOn" Principal ***********************6 does not exist in the directory ***********************************. resource roleAssignNetwork 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
name: guid(subscription().subscriptionId,'Network')
properties: {
roleDefinitionId: '${subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '4d97b98b-1d4f-4787-a291-c67834d212e7')}' //Network Contributor
principalId: aksIdentity.outputs.principalId
}
dependsOn: [
aksIdentity
]
} When I run with next time identity is found and roles are assigne, can anybody advise how to resolver this issue ? Kind regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Try to add You can read more about it here: https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal |
Beta Was this translation helpful? Give feedback.
-
thanks it works |
Beta Was this translation helpful? Give feedback.
Try to add
principalType: 'MSI'
orprincipalType: 'ServicePrincipal'
to your properties, both should work.You can read more about it here: https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-template#new-service-principal