Azure / Azure/azure-quickstart-templates

PrincipalNotFound error

Open
#4,945 1 comment 11 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

Role Assignment template

Issue Details
I was wondering about a technical issue with this template. When you create an AAD group and then execute this template to do role assignment to this newly created group, you get an error:

"code": "PrincipalNotFound",
"message": "Principal does not exist in the directory ."

The AAD group gets created and objectId for this is retrieved and passed as parameter to this template. Why is this AAD group not found when template is executed?

Repro steps:
1) Create an AAD group.
2) Retrieve objectId of the above AAD group.
3) Execute the above role assignment template with principalId parameter set to AAD group objectId.
4) PrincialNotFound error is thrown

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the Role Assignment template referenced in the issue and reproduce the four listed steps with an Azure AD group. Compare the group creation, objectId retrieval, and role assignment stages; done means identifying the cause of the PrincipalNotFound response and documenting a verified resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
authorization, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.