简体   繁体   中英

create azure enterprise application with terraform

How can I create an azure enterprise application with Terraform. I search a lot and I can just see this but it is for application, not enterprise application.

I have the same problem as this-problem

There is a same issue . You could create Enterprise Application(Service Principal) with this:

resource "azuread_service_principal" "this" {
  application_id                = azuread_application.this.application_id
  tags = [
    "AppServiceIntegratedApp",
    "WindowsAzureActiveDirectoryIntegratedApp",
  ]
}

Definition of Enterprise Application: https://www.seb8iaan.com/the-difference-between-azuread-app-registrations-and-enterprise-applications-explained/

Newer versions of the AzureAD Terraform provider have included the feature_tags block, which makes this process a little easier.

Here's an example from the Enterprise Application I'm creating for ArgoCD (Idk if it actually works for Argo, but it at least creats the application in the portal properly)

data "azurerm_client_config" "main" {}

resource "azuread_application" "argocd" {
  display_name = "shared-cluster-argocd"
  feature_tags {
    custom_single_sign_on = true
  }
  owners = [
    data.azurerm_client_config.main.object_id
  ]
  identifier_uris = [
    "https://argocd.mysite.ca/api/dex/callback"
  ]
  web {
    redirect_uris = [
      "https://argocd.mysite.ca/api/dex/callback",
    ]

    implicit_grant {
      access_token_issuance_enabled = false
      id_token_issuance_enabled     = false
    }
  }
}

resource "azuread_service_principal" "argocd" {
  application_id                = azuread_application.argocd.application_id
  owners                        = azuread_application.argocd.owners
  preferred_single_sign_on_mode = "saml"
  login_url                     = "https://argocd.mysite.ca/auth/login"
  feature_tags {
    custom_single_sign_on = true
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM