App registrations referencing each other
I am trying to move our existing Azure infrastructure over to be managed by Terraform and am running into an issue with our app registrations.
I have a registration for the API and one for the app that accesses that API.
Now when I define them in Terraform I have to add the application_id of the app to the known clients of the API and the application_id of the API to the required resources of the app. The obviously creates a cycle.
Is there any way around this without applying one of them first and then adding the other with the corresponding configuration?
Hi @flexwie, thanks for opening this issue. At this time, there is no way to cross reference specific attributes between two resource in Terraform. For cases such as this, we intend to expand our support for these sort of scenarios by adding virtual resources. In this case for example, potentially a azuread_application_known_clients would enable this scenario for you?
I'm happy to leave this issue open as a feature request for that virtual resource.
Hey @manicminer, yes that would indeed solve that scenario! Terraform providers are new territory for me but if you'd accept a PR for this I could give it a go.
We'll be including an azuread_application_known_clients resource in the next release of the provider.