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

Added IdentityFederation property to Workspace #835

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abij
Copy link

@abij abij commented Dec 6, 2024

What changes are proposed in this pull request?

What: extra optional field on Workspace identity_federation_info

Why: I want to check if the Workspace is/was already connected to Unity, account-level. If workspace Identity federation is enabled I can fetch the permissions for example.

import os
from databricks.sdk import AccountClient

# Assume I have authenticated and stored as profile "ACCOUNT"
os.environ["DATABRICKS_CONFIG_PROFILE"] = "ACCOUNT"

a = AccountClient()
w = a.workspaces.get("387127*******")

if w.identity_federation_info:
    print(f"Identity Federation: {w.identity_federation_info.enable_identity_federation}")
else:
    print("Workspace does not have Identity Federation enabled.")

# Output: Workspace Identity Federation: True

How is this tested?

  • I have based the code on the Website API response (Browser -> Networking-tab) in Account console.
  • I've created a notebook to manually fetch a enabled and disabled IdentityFederated workspace. (code is attached)

ALWAYS ANSWER THIS QUESTION: Answer with "N/A" if tests are not applicable
to your PR (e.g. if the PR only modifies comments). Do not be afraid of
answering "Not tested" if the PR has not been tested. Being clear about what
has been done and not done provides important context to the reviewers.

Copy link

github-actions bot commented Dec 6, 2024

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

Trigger:
go/deco-tests-run/sdk-py

Inputs:

  • PR number: 835
  • Commit SHA: 720f7259e56f00ebdf3de6876044429f626c9606

Checks will be approved automatically on success.

@abij abij changed the title Added IdentityFederation Added IdentityFederation proeprty to Workspace Dec 6, 2024
@abij abij changed the title Added IdentityFederation proeprty to Workspace Added IdentityFederation property to Workspace Dec 6, 2024
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.

1 participant