published on Tuesday, Sep 8, 2026 by Pulumi
published on Tuesday, Sep 8, 2026 by Pulumi
Retrieves an external service principal — a service principal that can be synced from your identity provider (IdP) — with the given external ID from the customer’s IdP, scoped to a workspace. If the service principal does not exist in the account, it will be created. If the customer is not onboarded onto Automatic Identity Management (AIM), this returns an error.
The name uses the format external-service-principals/{external_service_principal_id}, where externalServicePrincipalId is the service principal’s object ID in the IdP (for example, a Microsoft Entra ID object ID).
Note Reading this data source has a side effect: it resolves the service principal against the IdP and provisions the service principal in the account if it does not already exist. Provisioning happens at the account level; it does not assign the service principal to the workspace.
Note This data source can be used with an account-level or workspace-level provider. With an account-level provider, a
workspaceIdis required — set it in theproviderConfigblock (or via the provider’sworkspaceIdattribute). With a workspace-level provider,workspaceIdis optional and defaults to the provider’s workspace.
Example Usage
Referring to an external service principal within a workspace, using an account-level provider with the target workspace selected via providerConfig:
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const example = databricks.getWorkspaceIamExternalServicePrincipalV2({
name: "external-service-principals/11111111-2222-3333-4444-555555555555",
providerConfig: {
workspaceId: "1234567890123456",
},
});
import pulumi
import pulumi_databricks as databricks
example = databricks.get_workspace_iam_external_service_principal_v2(name="external-service-principals/11111111-2222-3333-4444-555555555555",
provider_config={
"workspace_id": "1234567890123456",
})
package main
import (
"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := databricks.GetWorkspaceIamExternalServicePrincipalV2(ctx, &databricks.GetWorkspaceIamExternalServicePrincipalV2Args{
Name: "external-service-principals/11111111-2222-3333-4444-555555555555",
ProviderConfig: databricks.GetWorkspaceIamExternalServicePrincipalV2ProviderConfig{
WorkspaceId: "1234567890123456",
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var example = Databricks.GetWorkspaceIamExternalServicePrincipalV2.Invoke(new()
{
Name = "external-service-principals/11111111-2222-3333-4444-555555555555",
ProviderConfig = new Databricks.Inputs.GetWorkspaceIamExternalServicePrincipalV2ProviderConfigInputArgs
{
WorkspaceId = "1234567890123456",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.DatabricksFunctions;
import com.pulumi.databricks.inputs.GetWorkspaceIamExternalServicePrincipalV2Args;
import com.pulumi.databricks.inputs.GetWorkspaceIamExternalServicePrincipalV2ProviderConfigArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = DatabricksFunctions.getWorkspaceIamExternalServicePrincipalV2(GetWorkspaceIamExternalServicePrincipalV2Args.builder()
.name("external-service-principals/11111111-2222-3333-4444-555555555555")
.providerConfig(GetWorkspaceIamExternalServicePrincipalV2ProviderConfigArgs.builder()
.workspaceId("1234567890123456")
.build())
.build());
}
}
variables:
example:
fn::invoke:
function: databricks:getWorkspaceIamExternalServicePrincipalV2
arguments:
name: external-service-principals/11111111-2222-3333-4444-555555555555
providerConfig:
workspaceId: '1234567890123456'
pulumi {
required_providers {
databricks = {
source = "pulumi/databricks"
}
}
}
data "databricks_getworkspaceiamexternalserviceprincipalv2" "example" {
name = "external-service-principals/11111111-2222-3333-4444-555555555555"
provider_config = {
workspace_id = "1234567890123456"
}
}
Using getWorkspaceIamExternalServicePrincipalV2
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getWorkspaceIamExternalServicePrincipalV2(args: GetWorkspaceIamExternalServicePrincipalV2Args, opts?: InvokeOptions): Promise<GetWorkspaceIamExternalServicePrincipalV2Result>
function getWorkspaceIamExternalServicePrincipalV2Output(args: GetWorkspaceIamExternalServicePrincipalV2OutputArgs, opts?: InvokeOutputOptions): Output<GetWorkspaceIamExternalServicePrincipalV2Result>def get_workspace_iam_external_service_principal_v2(name: Optional[str] = None,
provider_config: Optional[GetWorkspaceIamExternalServicePrincipalV2ProviderConfig] = None,
opts: Optional[InvokeOptions] = None) -> GetWorkspaceIamExternalServicePrincipalV2Result
def get_workspace_iam_external_service_principal_v2_output(name: pulumi.Input[Optional[str]] = None,
provider_config: pulumi.Input[Optional[GetWorkspaceIamExternalServicePrincipalV2ProviderConfigArgs]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetWorkspaceIamExternalServicePrincipalV2Result]func GetWorkspaceIamExternalServicePrincipalV2(ctx *Context, args *GetWorkspaceIamExternalServicePrincipalV2Args, opts ...InvokeOption) (*GetWorkspaceIamExternalServicePrincipalV2Result, error)
func GetWorkspaceIamExternalServicePrincipalV2Output(ctx *Context, args *GetWorkspaceIamExternalServicePrincipalV2OutputArgs, opts ...InvokeOption) GetWorkspaceIamExternalServicePrincipalV2ResultOutput> Note: This function is named GetWorkspaceIamExternalServicePrincipalV2 in the Go SDK.
public static class GetWorkspaceIamExternalServicePrincipalV2
{
public static Task<GetWorkspaceIamExternalServicePrincipalV2Result> InvokeAsync(GetWorkspaceIamExternalServicePrincipalV2Args args, InvokeOptions? opts = null)
public static Output<GetWorkspaceIamExternalServicePrincipalV2Result> Invoke(GetWorkspaceIamExternalServicePrincipalV2InvokeArgs args, InvokeOptions? opts = null)
public static Output<GetWorkspaceIamExternalServicePrincipalV2Result> Invoke(GetWorkspaceIamExternalServicePrincipalV2InvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetWorkspaceIamExternalServicePrincipalV2Result> getWorkspaceIamExternalServicePrincipalV2(GetWorkspaceIamExternalServicePrincipalV2Args args, InvokeOptions options)
public static Output<GetWorkspaceIamExternalServicePrincipalV2Result> getWorkspaceIamExternalServicePrincipalV2(GetWorkspaceIamExternalServicePrincipalV2Args args, InvokeOptions options)
public static Output<GetWorkspaceIamExternalServicePrincipalV2Result> getWorkspaceIamExternalServicePrincipalV2(GetWorkspaceIamExternalServicePrincipalV2Args args, InvokeOutputOptions options)
fn::invoke:
function: databricks:index/getWorkspaceIamExternalServicePrincipalV2:getWorkspaceIamExternalServicePrincipalV2
arguments:
# arguments dictionarydata "databricks_get_workspace_iam_external_service_principal_v2" "name" {
# arguments
}The following arguments are supported:
- Name string
- The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- Provider
Config GetWorkspace Iam External Service Principal V2Provider Config - Configure the provider for management through account provider.
- Name string
- The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- Provider
Config GetWorkspace Iam External Service Principal V2Provider Config - Configure the provider for management through account provider.
- name string
- The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- provider_
config object - Configure the provider for management through account provider.
- name String
- The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- provider
Config GetWorkspace Iam External Service Principal V2Provider Config - Configure the provider for management through account provider.
- name string
- The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- provider
Config GetWorkspace Iam External Service Principal V2Provider Config - Configure the provider for management through account provider.
- name str
- The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- provider_
config GetWorkspace Iam External Service Principal V2Provider Config - Configure the provider for management through account provider.
- name String
- The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- provider
Config Property Map - Configure the provider for management through account provider.
getWorkspaceIamExternalServicePrincipalV2 Result
The following output properties are available:
- Account
Id string - (string) - The parent account ID, from Databricks
- Account
Sp stringStatus - (string) - The activity status of the service principal in the Databricks account. Possible values are:
ACTIVE,INACTIVE - Application
Id string - (string) - Application ID of the service principal, from the customer's IdP
- Display
Name string - (string) - Display name of the service principal, from the customer's IdP
- External
Service stringPrincipal Id - (string) - The external ID of the service principal in the customer's IdP
- Internal
Id string - (string) - Internal servicePrincipalId of the service principal in Databricks
- Name string
- (string) - The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- Provider
Config GetWorkspace Iam External Service Principal V2Provider Config
- Account
Id string - (string) - The parent account ID, from Databricks
- Account
Sp stringStatus - (string) - The activity status of the service principal in the Databricks account. Possible values are:
ACTIVE,INACTIVE - Application
Id string - (string) - Application ID of the service principal, from the customer's IdP
- Display
Name string - (string) - Display name of the service principal, from the customer's IdP
- External
Service stringPrincipal Id - (string) - The external ID of the service principal in the customer's IdP
- Internal
Id string - (string) - Internal servicePrincipalId of the service principal in Databricks
- Name string
- (string) - The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- Provider
Config GetWorkspace Iam External Service Principal V2Provider Config
- account_
id string - (string) - The parent account ID, from Databricks
- account_
sp_ stringstatus - (string) - The activity status of the service principal in the Databricks account. Possible values are:
ACTIVE,INACTIVE - application_
id string - (string) - Application ID of the service principal, from the customer's IdP
- display_
name string - (string) - Display name of the service principal, from the customer's IdP
- external_
service_ stringprincipal_ id - (string) - The external ID of the service principal in the customer's IdP
- internal_
id string - (string) - Internal servicePrincipalId of the service principal in Databricks
- name string
- (string) - The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- provider_
config object
- account
Id String - (string) - The parent account ID, from Databricks
- account
Sp StringStatus - (string) - The activity status of the service principal in the Databricks account. Possible values are:
ACTIVE,INACTIVE - application
Id String - (string) - Application ID of the service principal, from the customer's IdP
- display
Name String - (string) - Display name of the service principal, from the customer's IdP
- external
Service StringPrincipal Id - (string) - The external ID of the service principal in the customer's IdP
- internal
Id String - (string) - Internal servicePrincipalId of the service principal in Databricks
- name String
- (string) - The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- provider
Config GetWorkspace Iam External Service Principal V2Provider Config
- account
Id string - (string) - The parent account ID, from Databricks
- account
Sp stringStatus - (string) - The activity status of the service principal in the Databricks account. Possible values are:
ACTIVE,INACTIVE - application
Id string - (string) - Application ID of the service principal, from the customer's IdP
- display
Name string - (string) - Display name of the service principal, from the customer's IdP
- external
Service stringPrincipal Id - (string) - The external ID of the service principal in the customer's IdP
- internal
Id string - (string) - Internal servicePrincipalId of the service principal in Databricks
- name string
- (string) - The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- provider
Config GetWorkspace Iam External Service Principal V2Provider Config
- account_
id str - (string) - The parent account ID, from Databricks
- account_
sp_ strstatus - (string) - The activity status of the service principal in the Databricks account. Possible values are:
ACTIVE,INACTIVE - application_
id str - (string) - Application ID of the service principal, from the customer's IdP
- display_
name str - (string) - Display name of the service principal, from the customer's IdP
- external_
service_ strprincipal_ id - (string) - The external ID of the service principal in the customer's IdP
- internal_
id str - (string) - Internal servicePrincipalId of the service principal in Databricks
- name str
- (string) - The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- provider_
config GetWorkspace Iam External Service Principal V2Provider Config
- account
Id String - (string) - The parent account ID, from Databricks
- account
Sp StringStatus - (string) - The activity status of the service principal in the Databricks account. Possible values are:
ACTIVE,INACTIVE - application
Id String - (string) - Application ID of the service principal, from the customer's IdP
- display
Name String - (string) - Display name of the service principal, from the customer's IdP
- external
Service StringPrincipal Id - (string) - The external ID of the service principal in the customer's IdP
- internal
Id String - (string) - Internal servicePrincipalId of the service principal in Databricks
- name String
- (string) - The resource name of the external service principal. The format depends on
the API that returned it:
- Account-scoped: accounts/{account_id}/external-service-principals/{external_service_principal_id}
- Workspace-scoped: external-service-principals/{external_service_principal_id}
- provider
Config Property Map
Supporting Types
GetWorkspaceIamExternalServicePrincipalV2ProviderConfig
- Workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- Workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace_
id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id String - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace_
id str - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id String - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricksTerraform Provider.
published on Tuesday, Sep 8, 2026 by Pulumi