terraform-provider-azuread icon indicating copy to clipboard operation
terraform-provider-azuread copied to clipboard

App registrations referencing each other

Open flexwie opened this issue 3 years ago • 2 comments

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?

flexwie avatar Jul 07 '22 13:07 flexwie

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.

manicminer avatar Jul 11 '22 10:07 manicminer

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.

flexwie avatar Jul 11 '22 11:07 flexwie

We'll be including an azuread_application_known_clients resource in the next release of the provider.

manicminer avatar Oct 17 '23 23:10 manicminer