GetServicePrincipal

Gets information about an existing Service Principal associated with an Application within Azure Active Directory.

NOTE: If you’re authenticating using a Service Principal then it must have permissions to both Read and write all applications and Sign in and read user profile within the Windows Azure Active Directory API.

Example Usage (by Application Display Name)

import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";

const example = pulumi.output(azuread.getServicePrincipal({
    displayName: "my-awesome-application",
}, { async: true }));
import pulumi
import pulumi_azuread as azuread

example = azuread.get_service_principal(display_name="my-awesome-application")
using Pulumi;
using AzureAD = Pulumi.AzureAD;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AzureAD.GetServicePrincipal.InvokeAsync(new AzureAD.GetServicePrincipalArgs
        {
            DisplayName = "my-awesome-application",
        }));
    }

}

Example Usage (by Application ID)

import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";

const example = pulumi.output(azuread.getServicePrincipal({
    applicationId: "00000000-0000-0000-0000-000000000000",
}, { async: true }));
import pulumi
import pulumi_azuread as azuread

example = azuread.get_service_principal(application_id="00000000-0000-0000-0000-000000000000")
using Pulumi;
using AzureAD = Pulumi.AzureAD;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AzureAD.GetServicePrincipal.InvokeAsync(new AzureAD.GetServicePrincipalArgs
        {
            ApplicationId = "00000000-0000-0000-0000-000000000000",
        }));
    }

}

Example Usage (by Object ID)

import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";

const example = pulumi.output(azuread.getServicePrincipal({
    objectId: "00000000-0000-0000-0000-000000000000",
}, { async: true }));
import pulumi
import pulumi_azuread as azuread

example = azuread.get_service_principal(object_id="00000000-0000-0000-0000-000000000000")
using Pulumi;
using AzureAD = Pulumi.AzureAD;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AzureAD.GetServicePrincipal.InvokeAsync(new AzureAD.GetServicePrincipalArgs
        {
            ObjectId = "00000000-0000-0000-0000-000000000000",
        }));
    }

}

Using GetServicePrincipal

function getServicePrincipal(args: GetServicePrincipalArgs, opts?: InvokeOptions): Promise<GetServicePrincipalResult>
function  get_service_principal(application_id=None, display_name=None, oauth2_permissions=None, object_id=None, opts=None)
func LookupServicePrincipal(ctx *Context, args *LookupServicePrincipalArgs, opts ...InvokeOption) (*LookupServicePrincipalResult, error)

Note: This function is named LookupServicePrincipal in the Go SDK.

public static class GetServicePrincipal {
    public static Task<GetServicePrincipalResult> InvokeAsync(GetServicePrincipalArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

ApplicationId string

The ID of the Azure AD Application.

DisplayName string

The Display Name of the Azure AD Application associated with this Service Principal.

Oauth2Permissions List<Pulumi.AzureAD.Inputs.GetServicePrincipalOauth2PermissionArgs>

A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a oauth2_permission block as documented below.

ObjectId string

The ID of the Azure AD Service Principal.

ApplicationId string

The ID of the Azure AD Application.

DisplayName string

The Display Name of the Azure AD Application associated with this Service Principal.

Oauth2Permissions []GetServicePrincipalOauth2Permission

A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a oauth2_permission block as documented below.

ObjectId string

The ID of the Azure AD Service Principal.

applicationId string

The ID of the Azure AD Application.

displayName string

The Display Name of the Azure AD Application associated with this Service Principal.

oauth2Permissions GetServicePrincipalOauth2Permission[]

A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a oauth2_permission block as documented below.

objectId string

The ID of the Azure AD Service Principal.

application_id str

The ID of the Azure AD Application.

display_name str

The Display Name of the Azure AD Application associated with this Service Principal.

oauth2_permissions List[GetServicePrincipalOauth2Permission]

A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a oauth2_permission block as documented below.

object_id str

The ID of the Azure AD Service Principal.

GetServicePrincipal Result

The following output properties are available:

AppRoles List<Pulumi.AzureAD.Outputs.GetServicePrincipalAppRole>
ApplicationId string
DisplayName string

Display name for the permission that appears in the admin consent and app assignment experiences.

Id string

The provider-assigned unique ID for this managed resource.

Oauth2Permissions List<Pulumi.AzureAD.Outputs.GetServicePrincipalOauth2Permission>
ObjectId string
AppRoles []GetServicePrincipalAppRole
ApplicationId string
DisplayName string

Display name for the permission that appears in the admin consent and app assignment experiences.

Id string

The provider-assigned unique ID for this managed resource.

Oauth2Permissions []GetServicePrincipalOauth2Permission
ObjectId string
appRoles GetServicePrincipalAppRole[]
applicationId string
displayName string

Display name for the permission that appears in the admin consent and app assignment experiences.

id string

The provider-assigned unique ID for this managed resource.

oauth2Permissions GetServicePrincipalOauth2Permission[]
objectId string
app_roles List[GetServicePrincipalAppRole]
application_id str
display_name str

Display name for the permission that appears in the admin consent and app assignment experiences.

id str

The provider-assigned unique ID for this managed resource.

oauth2_permissions List[GetServicePrincipalOauth2Permission]
object_id str

Supporting Types

GetServicePrincipalAppRole

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

AllowedMemberTypes List<string>

Specifies whether this app role definition can be assigned to users and groups, or to other applications (that are accessing this application in daemon service scenarios). Possible values are: User and Application, or both.

Description string

Permission help text that appears in the admin app assignment and consent experiences.

DisplayName string

The Display Name of the Azure AD Application associated with this Service Principal.

Id string

The unique identifier of the app_role.

IsEnabled bool

Determines if the app role is enabled.

Value string

Specifies the value of the roles claim that the application should expect in the authentication and access tokens.

AllowedMemberTypes []string

Specifies whether this app role definition can be assigned to users and groups, or to other applications (that are accessing this application in daemon service scenarios). Possible values are: User and Application, or both.

Description string

Permission help text that appears in the admin app assignment and consent experiences.

DisplayName string

The Display Name of the Azure AD Application associated with this Service Principal.

Id string

The unique identifier of the app_role.

IsEnabled bool

Determines if the app role is enabled.

Value string

Specifies the value of the roles claim that the application should expect in the authentication and access tokens.

allowedMemberTypes string[]

Specifies whether this app role definition can be assigned to users and groups, or to other applications (that are accessing this application in daemon service scenarios). Possible values are: User and Application, or both.

description string

Permission help text that appears in the admin app assignment and consent experiences.

displayName string

The Display Name of the Azure AD Application associated with this Service Principal.

id string

The unique identifier of the app_role.

isEnabled boolean

Determines if the app role is enabled.

value string

Specifies the value of the roles claim that the application should expect in the authentication and access tokens.

allowedMemberTypes List[str]

Specifies whether this app role definition can be assigned to users and groups, or to other applications (that are accessing this application in daemon service scenarios). Possible values are: User and Application, or both.

description str

Permission help text that appears in the admin app assignment and consent experiences.

display_name str

The Display Name of the Azure AD Application associated with this Service Principal.

id str

The unique identifier of the app_role.

isEnabled bool

Determines if the app role is enabled.

value str

Specifies the value of the roles claim that the application should expect in the authentication and access tokens.

GetServicePrincipalOauth2Permission

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

AdminConsentDescription string

The description of the admin consent

AdminConsentDisplayName string

The display name of the admin consent

Id string

The unique identifier of the app_role.

IsEnabled bool

Determines if the app role is enabled.

Type string

The type of the permission

UserConsentDescription string

The description of the user consent

UserConsentDisplayName string

The display name of the user consent

Value string

Specifies the value of the roles claim that the application should expect in the authentication and access tokens.

AdminConsentDescription string

The description of the admin consent

AdminConsentDisplayName string

The display name of the admin consent

Id string

The unique identifier of the app_role.

IsEnabled bool

Determines if the app role is enabled.

Type string

The type of the permission

UserConsentDescription string

The description of the user consent

UserConsentDisplayName string

The display name of the user consent

Value string

Specifies the value of the roles claim that the application should expect in the authentication and access tokens.

adminConsentDescription string

The description of the admin consent

adminConsentDisplayName string

The display name of the admin consent

id string

The unique identifier of the app_role.

isEnabled boolean

Determines if the app role is enabled.

type string

The type of the permission

userConsentDescription string

The description of the user consent

userConsentDisplayName string

The display name of the user consent

value string

Specifies the value of the roles claim that the application should expect in the authentication and access tokens.

adminConsentDescription str

The description of the admin consent

adminConsentDisplayName str

The display name of the admin consent

id str

The unique identifier of the app_role.

isEnabled bool

Determines if the app role is enabled.

type str

The type of the permission

userConsentDescription str

The description of the user consent

userConsentDisplayName str

The display name of the user consent

value str

Specifies the value of the roles claim that the application should expect in the authentication and access tokens.

Package Details

Repository
https://github.com/pulumi/pulumi-azuread
License
Apache-2.0
Notes
This Pulumi package is based on the azuread Terraform Provider.