Viewing docs for Databricks v1.90.0
published on Thursday, Mar 19, 2026 by Pulumi
published on Thursday, Mar 19, 2026 by Pulumi
Viewing docs for Databricks v1.90.0
published on Thursday, Mar 19, 2026 by Pulumi
published on Thursday, Mar 19, 2026 by Pulumi
Retrieves application_ids of all databricks.ServicePrincipal based on their display_name
This data source can be used with an account or workspace-level provider.
Example Usage
Adding all service principals of which display name contains my-spn to admin group
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
import * as std from "@pulumi/std";
export = async () => {
const admins = await databricks.getGroup({
displayName: "admins",
});
const spns = await databricks.getServicePrincipals({
displayNameContains: "my-spn",
});
const spn = .reduce((__obj, [__key, __value]) => ({ ...__obj, [__key]: await databricks.getServicePrincipal({
applicationId: __value,
}) }));
const myMemberSpn: databricks.GroupMember[] = [];
for (const range of std.toset({
input: spns.applicationIds,
}).result.map((v, k) => ({key: k, value: v}))) {
myMemberSpn.push(new databricks.GroupMember(`my_member_spn-${range.key}`, {
groupId: admins.id,
memberId: spn[range.value].spId,
}));
}
}
import pulumi
import pulumi_databricks as databricks
import pulumi_std as std
admins = databricks.get_group(display_name="admins")
spns = databricks.get_service_principals(display_name_contains="my-spn")
spn = {__key: databricks.get_service_principal(application_id=__value) for __key, __value in std.toset(input=spns.application_ids).result}
my_member_spn = []
for range in [{"key": k, "value": v} for [k, v] in enumerate(std.toset(input=spns.application_ids).result)]:
my_member_spn.append(databricks.GroupMember(f"my_member_spn-{range['key']}",
group_id=admins.id,
member_id=spn[range["value"]].sp_id))
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Pulumi;
using Databricks = Pulumi.Databricks;
using Std = Pulumi.Std;
return await Deployment.RunAsync(async() =>
{
var admins = await Databricks.GetGroup.InvokeAsync(new()
{
DisplayName = "admins",
});
var spns = await Databricks.GetServicePrincipals.InvokeAsync(new()
{
DisplayNameContains = "my-spn",
});
var spn = ;
var myMemberSpn = new List<Databricks.GroupMember>();
foreach (var range in )
{
myMemberSpn.Add(new Databricks.GroupMember($"my_member_spn-{range.Key}", new()
{
GroupId = admins.Id,
MemberId = spn[range.Value].SpId,
}));
}
});
Example coming soon!
Example coming soon!
Related Resources
The following resources are used in the same context:
- End to end workspace management guide. - databricks.getCurrentUser data to retrieve information about databricks.User or databricks_service_principal, that is calling Databricks REST API. - databricks.Group to manage Account-level or Workspace-level groups. - databricks.Group data to retrieve information about databricks.Group members, entitlements and instance profiles. - databricks.GroupInstanceProfile to attach databricks.InstanceProfile (AWS) to databricks_group. - databricks.GroupMember to attach users and groups as group members. - databricks.Permissions to manage access control in Databricks workspace. - databricks_service principal to manage service principals
Using getServicePrincipals
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 getServicePrincipals(args: GetServicePrincipalsArgs, opts?: InvokeOptions): Promise<GetServicePrincipalsResult>
function getServicePrincipalsOutput(args: GetServicePrincipalsOutputArgs, opts?: InvokeOptions): Output<GetServicePrincipalsResult>def get_service_principals(application_ids: Optional[Sequence[str]] = None,
display_name_contains: Optional[str] = None,
provider_config: Optional[GetServicePrincipalsProviderConfig] = None,
service_principals: Optional[Sequence[GetServicePrincipalsServicePrincipal]] = None,
opts: Optional[InvokeOptions] = None) -> GetServicePrincipalsResult
def get_service_principals_output(application_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
display_name_contains: Optional[pulumi.Input[str]] = None,
provider_config: Optional[pulumi.Input[GetServicePrincipalsProviderConfigArgs]] = None,
service_principals: Optional[pulumi.Input[Sequence[pulumi.Input[GetServicePrincipalsServicePrincipalArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetServicePrincipalsResult]func GetServicePrincipals(ctx *Context, args *GetServicePrincipalsArgs, opts ...InvokeOption) (*GetServicePrincipalsResult, error)
func GetServicePrincipalsOutput(ctx *Context, args *GetServicePrincipalsOutputArgs, opts ...InvokeOption) GetServicePrincipalsResultOutput> Note: This function is named GetServicePrincipals in the Go SDK.
public static class GetServicePrincipals
{
public static Task<GetServicePrincipalsResult> InvokeAsync(GetServicePrincipalsArgs args, InvokeOptions? opts = null)
public static Output<GetServicePrincipalsResult> Invoke(GetServicePrincipalsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetServicePrincipalsResult> getServicePrincipals(GetServicePrincipalsArgs args, InvokeOptions options)
public static Output<GetServicePrincipalsResult> getServicePrincipals(GetServicePrincipalsArgs args, InvokeOptions options)
fn::invoke:
function: databricks:index/getServicePrincipals:getServicePrincipals
arguments:
# arguments dictionaryThe following arguments are supported:
- Application
Ids List<string> - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - Display
Name stringContains - Only return databricks.ServicePrincipal display name that match the given name string
- Provider
Config GetService Principals Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- Service
Principals List<GetService Principals Service Principal> - List of objects describing individual service principals. Each object has the following attributes:
- Application
Ids []string - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - Display
Name stringContains - Only return databricks.ServicePrincipal display name that match the given name string
- Provider
Config GetService Principals Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- Service
Principals []GetService Principals Service Principal - List of objects describing individual service principals. Each object has the following attributes:
- application
Ids List<String> - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - display
Name StringContains - Only return databricks.ServicePrincipal display name that match the given name string
- provider
Config GetService Principals Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- service
Principals List<GetService Principals Service Principal> - List of objects describing individual service principals. Each object has the following attributes:
- application
Ids string[] - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - display
Name stringContains - Only return databricks.ServicePrincipal display name that match the given name string
- provider
Config GetService Principals Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- service
Principals GetService Principals Service Principal[] - List of objects describing individual service principals. Each object has the following attributes:
- application_
ids Sequence[str] - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - display_
name_ strcontains - Only return databricks.ServicePrincipal display name that match the given name string
- provider_
config GetService Principals Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- service_
principals Sequence[GetService Principals Service Principal] - List of objects describing individual service principals. Each object has the following attributes:
- application
Ids List<String> - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - display
Name StringContains - Only return databricks.ServicePrincipal display name that match the given name string
- provider
Config Property Map - Configure the provider for management through account provider. This block consists of the following fields:
- service
Principals List<Property Map> - List of objects describing individual service principals. Each object has the following attributes:
getServicePrincipals Result
The following output properties are available:
- Application
Ids List<string> - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - Display
Name stringContains - Id string
- The provider-assigned unique ID for this managed resource.
- Service
Principals List<GetService Principals Service Principal> - List of objects describing individual service principals. Each object has the following attributes:
- Provider
Config GetService Principals Provider Config
- Application
Ids []string - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - Display
Name stringContains - Id string
- The provider-assigned unique ID for this managed resource.
- Service
Principals []GetService Principals Service Principal - List of objects describing individual service principals. Each object has the following attributes:
- Provider
Config GetService Principals Provider Config
- application
Ids List<String> - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - display
Name StringContains - id String
- The provider-assigned unique ID for this managed resource.
- service
Principals List<GetService Principals Service Principal> - List of objects describing individual service principals. Each object has the following attributes:
- provider
Config GetService Principals Provider Config
- application
Ids string[] - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - display
Name stringContains - id string
- The provider-assigned unique ID for this managed resource.
- service
Principals GetService Principals Service Principal[] - List of objects describing individual service principals. Each object has the following attributes:
- provider
Config GetService Principals Provider Config
- application_
ids Sequence[str] - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - display_
name_ strcontains - id str
- The provider-assigned unique ID for this managed resource.
- service_
principals Sequence[GetService Principals Service Principal] - List of objects describing individual service principals. Each object has the following attributes:
- provider_
config GetService Principals Provider Config
- application
Ids List<String> - List of
application_idsof service principals. Individual service principal can be retrieved using databricks.ServicePrincipal data source or fromservice_principalsattribute. - display
Name StringContains - id String
- The provider-assigned unique ID for this managed resource.
- service
Principals List<Property Map> - List of objects describing individual service principals. Each object has the following attributes:
- provider
Config Property Map
Supporting Types
GetServicePrincipalsProviderConfig
- 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.
GetServicePrincipalsServicePrincipal
- Acl
Principal stringId - identifier for use in databricks_access_control_rule_set, e.g.
servicePrincipals/00000000-0000-0000-0000-000000000000. - Active bool
- Whether service principal is active or not.
- Application
Id string - Application ID of the service principal.
- Display
Name string - Display name of the service principal, e.g.
Foo SPN. - External
Id string - ID of the service principal in an external identity provider.
- Home string
- Home folder of the service principal, e.g.
/Users/11111111-2222-3333-4444-555666777888. - Id string
- The id of the service principal (SCIM ID).
- Repos string
- Repos location of the service principal, e.g.
/Repos/11111111-2222-3333-4444-555666777888. - Scim
Id string - same as
id. - Sp
Id string
- Acl
Principal stringId - identifier for use in databricks_access_control_rule_set, e.g.
servicePrincipals/00000000-0000-0000-0000-000000000000. - Active bool
- Whether service principal is active or not.
- Application
Id string - Application ID of the service principal.
- Display
Name string - Display name of the service principal, e.g.
Foo SPN. - External
Id string - ID of the service principal in an external identity provider.
- Home string
- Home folder of the service principal, e.g.
/Users/11111111-2222-3333-4444-555666777888. - Id string
- The id of the service principal (SCIM ID).
- Repos string
- Repos location of the service principal, e.g.
/Repos/11111111-2222-3333-4444-555666777888. - Scim
Id string - same as
id. - Sp
Id string
- acl
Principal StringId - identifier for use in databricks_access_control_rule_set, e.g.
servicePrincipals/00000000-0000-0000-0000-000000000000. - active Boolean
- Whether service principal is active or not.
- application
Id String - Application ID of the service principal.
- display
Name String - Display name of the service principal, e.g.
Foo SPN. - external
Id String - ID of the service principal in an external identity provider.
- home String
- Home folder of the service principal, e.g.
/Users/11111111-2222-3333-4444-555666777888. - id String
- The id of the service principal (SCIM ID).
- repos String
- Repos location of the service principal, e.g.
/Repos/11111111-2222-3333-4444-555666777888. - scim
Id String - same as
id. - sp
Id String
- acl
Principal stringId - identifier for use in databricks_access_control_rule_set, e.g.
servicePrincipals/00000000-0000-0000-0000-000000000000. - active boolean
- Whether service principal is active or not.
- application
Id string - Application ID of the service principal.
- display
Name string - Display name of the service principal, e.g.
Foo SPN. - external
Id string - ID of the service principal in an external identity provider.
- home string
- Home folder of the service principal, e.g.
/Users/11111111-2222-3333-4444-555666777888. - id string
- The id of the service principal (SCIM ID).
- repos string
- Repos location of the service principal, e.g.
/Repos/11111111-2222-3333-4444-555666777888. - scim
Id string - same as
id. - sp
Id string
- acl_
principal_ strid - identifier for use in databricks_access_control_rule_set, e.g.
servicePrincipals/00000000-0000-0000-0000-000000000000. - active bool
- Whether service principal is active or not.
- application_
id str - Application ID of the service principal.
- display_
name str - Display name of the service principal, e.g.
Foo SPN. - external_
id str - ID of the service principal in an external identity provider.
- home str
- Home folder of the service principal, e.g.
/Users/11111111-2222-3333-4444-555666777888. - id str
- The id of the service principal (SCIM ID).
- repos str
- Repos location of the service principal, e.g.
/Repos/11111111-2222-3333-4444-555666777888. - scim_
id str - same as
id. - sp_
id str
- acl
Principal StringId - identifier for use in databricks_access_control_rule_set, e.g.
servicePrincipals/00000000-0000-0000-0000-000000000000. - active Boolean
- Whether service principal is active or not.
- application
Id String - Application ID of the service principal.
- display
Name String - Display name of the service principal, e.g.
Foo SPN. - external
Id String - ID of the service principal in an external identity provider.
- home String
- Home folder of the service principal, e.g.
/Users/11111111-2222-3333-4444-555666777888. - id String
- The id of the service principal (SCIM ID).
- repos String
- Repos location of the service principal, e.g.
/Repos/11111111-2222-3333-4444-555666777888. - scim
Id String - same as
id. - sp
Id String
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricksTerraform Provider.
Viewing docs for Databricks v1.90.0
published on Thursday, Mar 19, 2026 by Pulumi
published on Thursday, Mar 19, 2026 by Pulumi
