Skip to content

Fix reading of external_id for databricks_service_principal #4712

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

Merged
merged 3 commits into from
May 16, 2025

Conversation

alexott
Copy link
Contributor

@alexott alexott commented May 14, 2025

Changes

During work on exporter I found that external_id wasn't filled for service principals and this lead to a problem with generation of correct code. The databricks_user had the correct code, so I unified the things

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • using Go SDK
  • using TF Plugin Framework

During work on exporter I found that `external_id` wasn't filled for service principals
and this lead to a problem with generation of correct code.  The `databricks_user` had the
correct code, so I unified the things
@alexott alexott requested review from a team as code owners May 14, 2025 08:07
@alexott alexott requested review from parthban-db and removed request for a team May 14, 2025 08:07
@alexott alexott temporarily deployed to test-trigger-is May 14, 2025 08:07 — with GitHub Actions Inactive
@alexott alexott temporarily deployed to test-trigger-is May 14, 2025 08:08 — with GitHub Actions Inactive
@alexott alexott requested review from rauchy and mgyucht May 14, 2025 08:13
alexott added a commit that referenced this pull request May 15, 2025
…vice principals

We should generate `application_id` only for Azure-managed service principals, while
Databricks-managed SPs should have only name.

Should be merged after #4712
@alexott alexott temporarily deployed to test-trigger-is May 15, 2025 13:44 — with GitHub Actions Inactive
@alexott alexott temporarily deployed to test-trigger-is May 15, 2025 13:44 — with GitHub Actions Inactive
@@ -101,12 +109,8 @@ func ResourceUser() common.Resource {
if err != nil {
return err
}
setCommonUserFields(d, user, user.UserName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove passing user.UserName since we are passing user so inside setCommonUserFields, we can use user.UserName directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's required because we need to pass different attributes (UserName for user and ApplicationId for service principal)

@alexott alexott temporarily deployed to test-trigger-is May 16, 2025 14:21 — with GitHub Actions Inactive
@alexott alexott temporarily deployed to test-trigger-is May 16, 2025 14:21 — with GitHub Actions Inactive
@alexott alexott enabled auto-merge May 16, 2025 14:21
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/terraform

Inputs:

  • PR number: 4712
  • Commit SHA: f1d34ca47d201e00264c210bdf78fefb97fbe55b

Checks will be approved automatically on success.

@alexott alexott added this pull request to the merge queue May 16, 2025
Merged via the queue into main with commit 9e7e953 May 16, 2025
12 checks passed
@alexott alexott deleted the fix/external-id-sp-read branch May 16, 2025 15:27
github-merge-queue bot pushed a commit that referenced this pull request May 18, 2025
…vice principals (#4716)

## Changes
<!-- Summary of your changes that are easy to understand -->

We should generate `application_id` only for Azure-managed service
principals, while Databricks-managed SPs should have only name.

Should be merged after #4712

## Tests
<!-- 
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [x] `make test` run locally
- [ ] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] using Go SDK
- [ ] using TF Plugin Framework
deco-sdk-tagging bot added a commit that referenced this pull request May 19, 2025
## Release v1.80.0

### New Features and Improvements

* Add `resource_model_serving_provisioned_throughput` for creation of [model serving provisioned throughput](https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/deploy-prov-throughput-foundation-model-apis) endpoints [#4701](#4701)
* Replace DBFS with Unity Catalog resources in [index page](https://registry.terraform.io/providers/databricks/databricks/latest/docs) storage section [#4718](#4718) 

### Bug Fixes

 * Support updating all attributes for `databricks_model_serving` ([#4575](#4575)).
 * Fix reading of `external_id` for `databricks_service_principal` [#4712](#4712)

### Documentation
* Added documentation for GITHUB OIDC authentication type [#4717] (#4717)

### Exporter

 * Generate correct code for Databricks and Azure-managed service principals [#4715](#4715)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants