Can I add an authentication platform for applications registered with AzureAD in terraform?

Asked 1 years ago, Updated 1 years ago, 105 views

I registered the app in AzureAD with terraform.
The source is terraform apply to register the app as follows:

$cat app.tf
resource "azuread_application" "example" {
  name = "example"
}

resource "azuread_service_principal" "example" {
  application_id = azuread_application.example.application_id
}

resource "azuread_service_principal_password" "example" {
  service_principal_id=azuread_service_principal.example.id
  description="My managed password"
  value="VT=uSgbTanZhyz@%nL9Hpd+Tfay_MRV#"
  end_date="2099-01-01T01:02:03Z"
}

resource "azuread_application_password" "example" {
  application_object_id=azuread_application.example.id
  description="My managed password"
  value="VT=uSgbTanZhyz@%nL9Hpd+Tfay_MRV#"
  end_date="2099-01-01T01:02:03Z"
}

After registering the app, manually select Add a platform from the Authentication menu of the app you registered on Azure's console, select a platform such as web app or iOS, and register the callback URI.

I would also like to set this manual operation to a terraform tf file, but I don't have any resources.

Is there anyone who can add platforms in terraform?

azure terraform

2022-09-29 22:34

1 Answers

You were able to configure the callback URI for reply_urls in azuread_application as shown below.

 resource "azuread_application" "example" {
  name = "example"
  reply_urls = [
    "https://sample1.com/auth",
    "https://sample2.co.jp/auth"
  ]
}

terraform documentation says it correctly.


2022-09-29 22:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.