When creating a role assignment with the VM system identity, it may throw PrincipalNotFound exception. This may be because there is a gap between service principal creation or cache issue. This issue occurs quite frequent recently. More discussion on Azure/azure-powershell#2286.
Change roleAssignments method depending from vm deployment to init scripts which takes several minutes to temporarily migrate this issue.
When creating a role assignment with the VM system identity, it may throw
PrincipalNotFound
exception. This may be because there is a gap between service principal creation or cache issue. This issue occurs quite frequent recently. More discussion on Azure/azure-powershell#2286.Change roleAssignments method depending from vm deployment to init scripts which takes several minutes to temporarily migrate this issue.