Azure / azure-quickstart-templates

Azure Quickstart Templates
https://aka.ms/azqst
MIT License
14k stars 16.1k forks source link

PrincipalNotFound error #4945

Open AmudhaPalani opened 6 years ago

AmudhaPalani commented 6 years ago

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

NagaCSC commented 2 years ago

it would be a delay in replica between write and read replica. Did you have logic to try after few min?. that would be a good test to isolate it.

Refer: https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-architecture

Why do I sometimes get a 404 when trying to update an Azure Directory object after I just created it? | Azure Active Directory Developer Support Team (aaddevsup.xyz)