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

feat: allow data.azuread_application lookup using identifier_uri

Open JonasBak opened this issue 1 year ago • 1 comments

This PR introduces a small feature to the azuread_application data source that allows us to get the application based on an identifying URI. This is a feature we would really like to use. It looks like this:

data "azuread_application" "example" {
  identifier_uris  = [
    "api://example-app",
  ]
}

I've implemented it in a way where you can provide a list of one element to the identifier_uris field, instead of introducing another field called identifier_uri that is just a string, as I thought it might be easy to mix up the two fields, but would love some input on this. I added an error if more than one element is provided in identifier_uris.

JonasBak avatar Feb 02 '24 11:02 JonasBak

Thanks for the review @manicminer, I rebased and added your suggestion 👍 It now looks like this:

data "azuread_application" "test" {
  identifier_uri = "api://example-app"
}

JonasBak avatar May 13 '24 08:05 JonasBak

Test results

Screenshot 2024-05-15 at 23 57 37

manicminer avatar May 15 '24 22:05 manicminer