Class ServicePrincipal
Manages a 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 applicationsandSign in and read user profilewithin theWindows Azure Active DirectoryAPI. Please see The Granting a Service Principal permission to manage AAD for the required steps.
Example Usage
using Pulumi;
using AzureAD = Pulumi.AzureAD;
class MyStack : Stack
{
public MyStack()
{
var exampleApplication = new AzureAD.Application("exampleApplication", new AzureAD.ApplicationArgs
{
AvailableToOtherTenants = false,
Homepage = "http://homepage",
IdentifierUris =
{
"http://uri",
},
Oauth2AllowImplicitFlow = true,
ReplyUrls =
{
"http://replyurl",
},
});
var exampleServicePrincipal = new AzureAD.ServicePrincipal("exampleServicePrincipal", new AzureAD.ServicePrincipalArgs
{
AppRoleAssignmentRequired = false,
ApplicationId = exampleApplication.ApplicationId,
Tags =
{
"example",
"tags",
"here",
},
});
}
}
Inherited Members
Namespace: Pulumi.AzureAD
Assembly: Pulumi.AzureAD.dll
Syntax
public class ServicePrincipal : CustomResource
Constructors
View SourceServicePrincipal(String, ServicePrincipalArgs, CustomResourceOptions)
Create a ServicePrincipal resource with the given unique name, arguments, and options.
Declaration
public ServicePrincipal(string name, ServicePrincipalArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ServicePrincipalArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceApplicationId
The ID of the Azure AD Application for which to create a Service Principal.
Declaration
public Output<string> ApplicationId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AppRoleAssignmentRequired
Does this Service Principal require an AppRoleAssignment to a user or group before Azure AD will issue a user or access token to the application? Defaults to false.
Declaration
public Output<bool?> AppRoleAssignmentRequired { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
DisplayName
The Display Name of the Azure Active Directory Application associated with this Service Principal.
Declaration
public Output<string> DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Oauth2Permissions
A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a oauth2_permission block as documented below.
Declaration
public Output<ImmutableArray<ServicePrincipalOauth2Permission>> Oauth2Permissions { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<ServicePrincipalOauth2Permission>> |
ObjectId
The Service Principal's Object ID.
Declaration
public Output<string> ObjectId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
A list of tags to apply to the Service Principal.
Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Methods
View SourceGet(String, Input<String>, ServicePrincipalState, CustomResourceOptions)
Get an existing ServicePrincipal resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static ServicePrincipal Get(string name, Input<string> id, ServicePrincipalState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ServicePrincipalState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| ServicePrincipal |