UNPKG

@pulumi/azuread

Version:

A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.

120 lines 3.96 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getServicePrincipalOutput = exports.getServicePrincipal = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Gets information about an existing service principal associated with an application within Azure Active Directory. * * ## API Permissions * * The following API permissions are required in order to use this data source. * * When authenticated with a service principal, this data source requires one of the following application roles: `Application.Read.All` or `Directory.Read.All` * * When authenticated with a user principal, this data source does not require any additional roles. * * ## Example Usage * * *Look up by application display name* * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = azuread.getServicePrincipal({ * displayName: "my-awesome-application", * }); * ``` * * *Look up by client ID* * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = azuread.getServicePrincipal({ * clientId: "00000000-0000-0000-0000-000000000000", * }); * ``` * * *Look up by service principal object ID* * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = azuread.getServicePrincipal({ * objectId: "00000000-0000-0000-0000-000000000000", * }); * ``` */ function getServicePrincipal(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("azuread:index/getServicePrincipal:getServicePrincipal", { "clientId": args.clientId, "displayName": args.displayName, "objectId": args.objectId, }, opts); } exports.getServicePrincipal = getServicePrincipal; /** * Gets information about an existing service principal associated with an application within Azure Active Directory. * * ## API Permissions * * The following API permissions are required in order to use this data source. * * When authenticated with a service principal, this data source requires one of the following application roles: `Application.Read.All` or `Directory.Read.All` * * When authenticated with a user principal, this data source does not require any additional roles. * * ## Example Usage * * *Look up by application display name* * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = azuread.getServicePrincipal({ * displayName: "my-awesome-application", * }); * ``` * * *Look up by client ID* * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = azuread.getServicePrincipal({ * clientId: "00000000-0000-0000-0000-000000000000", * }); * ``` * * *Look up by service principal object ID* * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = azuread.getServicePrincipal({ * objectId: "00000000-0000-0000-0000-000000000000", * }); * ``` */ function getServicePrincipalOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("azuread:index/getServicePrincipal:getServicePrincipal", { "clientId": args.clientId, "displayName": args.displayName, "objectId": args.objectId, }, opts); } exports.getServicePrincipalOutput = getServicePrincipalOutput; //# sourceMappingURL=getServicePrincipal.js.map