A service principle can be created to control the access to a specific resource in azure. For example azure ACR's service principle can be created in according to the official page
My question is that can I create the service principle before the azure ACR has been created. I'm asking because I need to create a azure ACR by Terraform, and I would like to add service principle and assign role to it. But at that moment I don't even have a ACR, it would be a chicken and eggs question. Can I already created the service principle before the provisioning of the ACR resource by Terraform?