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

Fix Azure authentication for dev and staging workspaces #1607

Merged
merged 6 commits into from
Sep 23, 2022

Conversation

mehdikit-db
Copy link
Contributor

No description provided.

common/azure_auth.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #1607 (0327a16) into master (10dd11a) will increase coverage by 0.47%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1607      +/-   ##
==========================================
+ Coverage   89.57%   90.05%   +0.47%     
==========================================
  Files         135      135              
  Lines       10825    10833       +8     
==========================================
+ Hits         9697     9756      +59     
+ Misses        737      688      -49     
+ Partials      391      389       -2     
Impacted Files Coverage Δ
common/client.go 97.62% <ø> (ø)
common/azure_auth.go 92.20% <100.00%> (+0.37%) ⬆️
common/azure_cli_auth.go 90.56% <100.00%> (+0.18%) ⬆️
exporter/util.go 82.32% <0.00%> (+3.86%) ⬆️
exporter/importables.go 90.68% <0.00%> (+5.25%) ⬆️

const azureDatabricksProdLoginAppID string = "2ff814a6-3304-4ab8-85cb-cd0e6f879c1d"

func (aa *DatabricksClient) GetAzureDatabricksLoginAppId() string {
res := azureDatabricksProdLoginAppID
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. make this method "unexported" - make it start with lowecase letter (getAzure...)
  2. strings.Contains(aa.Host, ".staging.") is unnecessary and it leaks internal infra references. simplify it to
if aa.AzureDatabricksLoginAppId != "" {
			return aa.AzureDatabricksLoginAppId
		}
return azureDatabricksProdLoginAppID

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1 - This method is being used in common/azure_cli_auth.go.

2 - Good point, Fixed it.

@nfx nfx enabled auto-merge (squash) September 23, 2022 14:26
@nfx nfx merged commit 7adb6d4 into databricks:master Sep 23, 2022
nkvuong pushed a commit that referenced this pull request Oct 6, 2022
* Fix Azure authentication for dev and staging workspaces
* use env variable
* Fix client attributes tests
* Rename AzureDatabricksResourceId to AzureDatabricksLoginAppId
* Simplify GetAzureDatabricksLoginAppId
nkvuong pushed a commit that referenced this pull request Oct 7, 2022
author Serge Smertin <259697+nfx@users.noreply.github.com> 1664570116 -0700
committer Vuong Nguyen <vuong.nguyen@databricks.com> 1665140905 +0100

parent 06af47b
author Serge Smertin <259697+nfx@users.noreply.github.com> 1664570116 -0700
committer Vuong Nguyen <vuong.nguyen@databricks.com> 1665140865 +0100

parent 06af47b
author Serge Smertin <259697+nfx@users.noreply.github.com> 1664570116 -0700
committer Vuong Nguyen <vuong.nguyen@databricks.com> 1665140826 +0100

parent 06af47b
author Serge Smertin <259697+nfx@users.noreply.github.com> 1664570116 -0700
committer Vuong Nguyen <vuong.nguyen@databricks.com> 1665140786 +0100

Release 1.4.0 (#1650)

remove databricks_table resource from doc

fix following suggestions

update docs to match new privilege model

Fix dashboard acceptance test (#1618)

DBSQL resources are organized in a workspace structure as of recently.
As such it is no longer possible to use the same name for different
assets. This acceptance test used to use the same name for both
the dashboard and the query and started failing. The solution here
is to use a different suffix for the different resources.

Fix unity catalog docs to use correct metastore (#1620)

aws_iam_policy.unity_metastore is referencing
aws_s3_bucket.unity_metastore.arn, which is non-existent.
Fix to use aws_s3_bucket.metastore.arn instead. This also
matches with the online tutorial.

https://docs.databricks.com/data-governance/unity-catalog/automate.html

fix `secret` field name in `databricks_mlflow_webhook` resource (#1625)

fixes #1621

Fixed `gcp_availability` field in `databricks_insance_pool` resource (#1610)

Co-authored-by: Alex Ott <alexey.ott@databricks.com>

Add autoscale `mode` configuration to `databricks_pipeline` resource (#1600)

Fix Azure authentication for dev and staging workspaces (#1607)

* Fix Azure authentication for dev and staging workspaces
* use env variable
* Fix client attributes tests
* Rename AzureDatabricksResourceId to AzureDatabricksLoginAppId
* Simplify GetAzureDatabricksLoginAppId

Fixed minor errors in Unity Catalog docs (#1626)

* Fixed errors in docs
* Fixed Azure SPOT and elastic disk
* Added fallback on SPOT_AZURE configuration

Bump github.com/hashicorp/hcl/v2 from 2.14.0 to 2.14.1 (#1634)

Bumps [github.com/hashicorp/hcl/v2](https://github.com/hashicorp/hcl) from 2.14.0 to 2.14.1.
- [Release notes](https://github.com/hashicorp/hcl/releases)
- [Changelog](https://github.com/hashicorp/hcl/blob/main/CHANGELOG.md)
- [Commits](hashicorp/hcl@v2.14.0...v2.14.1)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/hcl/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Bump google.golang.org/api from 0.96.0 to 0.97.0 (#1633)

Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.96.0 to 0.97.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](googleapis/google-api-go-client@v0.96.0...v0.97.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Correct handling of references in `databricks_permissions` resources (#1631)

this fixes #1628

expand documentation for `databricks_sql_visualization` resource (#1630)

* expand documentation for `options` field in `sql-visualization` resource
* add wording for how to restore during issue scenario

Prevent stripping of `CAN_MANAGE` permission from caller of `databricks_sql_query` resource (#1644)

Make debugging work again (#1560)

Fix test for `databricks_job` data source (#1649)
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this pull request Feb 15, 2023
)

* Fix Azure authentication for dev and staging workspaces
* use env variable
* Fix client attributes tests
* Rename AzureDatabricksResourceId to AzureDatabricksLoginAppId
* Simplify GetAzureDatabricksLoginAppId
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.

3 participants