Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] databricks_service_principal not accepting a "known after apply" application_id #1165

Closed
alex-davies opened this issue Mar 9, 2022 · 1 comment · Fixed by #1171
Closed

Comments

@alex-davies
Copy link

databricks_service_principal is failing to validate the application_id if it is derived from a dependant resource (i.e. Known after apply).

When creating an azuread_application and databricks_service_principal in the same plan/apply, the databricks_service_principal fails to recognize an application_id has been set

if the azuread_application is applied first. Then the databricks_service_principal is applied separately. Then the issue does not occur

Configuration

data "azurerm_client_config" "current" {}

resource "azuread_application" "service" {
  display_name     = "my-ad-app"
  sign_in_audience = "AzureADMyOrg"
  owners           = [data.azurerm_client_config.current.object_id]
}

resource "databricks_service_principal" "service" {
  display_name          = azuread_application.service.display_name
  application_id        = azuread_application.service.application_id
}

Expected Behavior

  1. Azure AD app is created
  2. Databricks principal is created linked to the azure app

Actual Behavior

When planning an Error: application_id is required for service principals in Azure Databricks is output

Steps to Reproduce

This can be reproduced using a azure databricks. Error is produced when running terraform plan

Terraform and provider versions

Terraform v1.0.5
on windows_amd64
+ provider registry.terraform.io/databrickslabs/databricks v0.5.2
+ provider registry.terraform.io/hashicorp/azuread v2.18.0
+ provider registry.terraform.io/hashicorp/azurerm v2.96.0
@nfx
Copy link
Contributor

nfx commented Mar 9, 2022

@alex-davies Databricks Platform API on Azure will throw an error if application_id is not specified. can you build the provider locally and comment out these and see what happens:

https://github.com/databrickslabs/terraform-provider-databricks/blob/17a67b140bda8c54f095122f006051ce2cff832d/scim/resource_service_principal.go#L88-L91

well-tested PRs are welcome.

nfx added a commit that referenced this issue Mar 10, 2022
Remove client-side validation in `databricks_service_principal` for `application_id`, that may not always be available in the planning stage.

Fixes #1165
@nfx nfx closed this as completed in #1171 Mar 10, 2022
nfx added a commit that referenced this issue Mar 10, 2022
Remove client-side validation in `databricks_service_principal` for `application_id`, that may not always be available in the planning stage.

Fixes #1165
@nfx nfx mentioned this issue Mar 14, 2022
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this issue Feb 15, 2023
…abricks#1171)

Remove client-side validation in `databricks_service_principal` for `application_id`, that may not always be available in the planning stage.

Fixes databricks#1165
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants