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",
},
});
}
}
Coming soon!
import pulumi
import pulumi_azuread as azuread
example_application = azuread.Application("exampleApplication",
available_to_other_tenants=False,
homepage="http://homepage",
identifier_uris=["http://uri"],
oauth2_allow_implicit_flow=True,
reply_urls=["http://replyurl"])
example_service_principal = azuread.ServicePrincipal("exampleServicePrincipal",
app_role_assignment_required=False,
application_id=example_application.application_id,
tags=[
"example",
"tags",
"here",
])import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";
const exampleApplication = new azuread.Application("example", {
availableToOtherTenants: false,
homepage: "http://homepage",
identifierUris: ["http://uri"],
oauth2AllowImplicitFlow: true,
replyUrls: ["http://replyurl"],
});
const exampleServicePrincipal = new azuread.ServicePrincipal("example", {
appRoleAssignmentRequired: false,
applicationId: exampleApplication.applicationId,
tags: [
"example",
"tags",
"here",
],
});Create a ServicePrincipal Resource
new ServicePrincipal(name: string, args: ServicePrincipalArgs, opts?: CustomResourceOptions);def ServicePrincipal(resource_name, opts=None, app_role_assignment_required=None, application_id=None, oauth2_permissions=None, tags=None, __props__=None);func NewServicePrincipal(ctx *Context, name string, args ServicePrincipalArgs, opts ...ResourceOption) (*ServicePrincipal, error)public ServicePrincipal(string name, ServicePrincipalArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ServicePrincipalArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ServicePrincipalArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServicePrincipalArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
ServicePrincipal Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ServicePrincipal resource accepts the following input properties:
- Application
Id string The ID of the Azure AD Application for which to create a Service Principal.
- App
Role boolAssignment Required 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.- Oauth2Permissions
List<Pulumi.
Azure AD. Inputs. Service Principal Oauth2Permission Args> A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a
oauth2_permissionblock as documented below.- List<string>
A list of tags to apply to the Service Principal.
- Application
Id string The ID of the Azure AD Application for which to create a Service Principal.
- App
Role boolAssignment Required 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.- Oauth2Permissions
[]Service
Principal Oauth2Permission A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a
oauth2_permissionblock as documented below.- []string
A list of tags to apply to the Service Principal.
- application
Id string The ID of the Azure AD Application for which to create a Service Principal.
- app
Role booleanAssignment Required 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.- oauth2Permissions
Service
Principal Oauth2Permission[] A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a
oauth2_permissionblock as documented below.- string[]
A list of tags to apply to the Service Principal.
- application_
id str The ID of the Azure AD Application for which to create a Service Principal.
- app_
role_ boolassignment_ required 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.- oauth2_
permissions List[ServicePrincipal Oauth2Permission] A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a
oauth2_permissionblock as documented below.- List[str]
A list of tags to apply to the Service Principal.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServicePrincipal resource produces the following output properties:
Look up an Existing ServicePrincipal Resource
Get an existing ServicePrincipal resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ServicePrincipalState, opts?: CustomResourceOptions): ServicePrincipalstatic get(resource_name, id, opts=None, app_role_assignment_required=None, application_id=None, display_name=None, oauth2_permissions=None, object_id=None, tags=None, __props__=None);func GetServicePrincipal(ctx *Context, name string, id IDInput, state *ServicePrincipalState, opts ...ResourceOption) (*ServicePrincipal, error)public static ServicePrincipal Get(string name, Input<string> id, ServicePrincipalState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- App
Role boolAssignment Required 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.- Application
Id string The ID of the Azure AD Application for which to create a Service Principal.
- Display
Name string The Display Name of the Azure Active Directory Application associated with this Service Principal.
- Oauth2Permissions
List<Pulumi.
Azure AD. Inputs. Service Principal Oauth2Permission Args> A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a
oauth2_permissionblock as documented below.- Object
Id string The Service Principal’s Object ID.
- List<string>
A list of tags to apply to the Service Principal.
- App
Role boolAssignment Required 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.- Application
Id string The ID of the Azure AD Application for which to create a Service Principal.
- Display
Name string The Display Name of the Azure Active Directory Application associated with this Service Principal.
- Oauth2Permissions
[]Service
Principal Oauth2Permission A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a
oauth2_permissionblock as documented below.- Object
Id string The Service Principal’s Object ID.
- []string
A list of tags to apply to the Service Principal.
- app
Role booleanAssignment Required 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.- application
Id string The ID of the Azure AD Application for which to create a Service Principal.
- display
Name string The Display Name of the Azure Active Directory Application associated with this Service Principal.
- oauth2Permissions
Service
Principal Oauth2Permission[] A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a
oauth2_permissionblock as documented below.- object
Id string The Service Principal’s Object ID.
- string[]
A list of tags to apply to the Service Principal.
- app_
role_ boolassignment_ required 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.- application_
id str The ID of the Azure AD Application for which to create a Service Principal.
- display_
name str The Display Name of the Azure Active Directory Application associated with this Service Principal.
- oauth2_
permissions List[ServicePrincipal Oauth2Permission] A collection of OAuth 2.0 permissions exposed by the associated application. Each permission is covered by a
oauth2_permissionblock as documented below.- object_
id str The Service Principal’s Object ID.
- List[str]
A list of tags to apply to the Service Principal.
Supporting Types
ServicePrincipalOauth2Permission
- Admin
Consent stringDescription The description of the admin consent.
- Admin
Consent stringDisplay Name The display name of the admin consent.
- Id string
The unique identifier for one of the
OAuth2Permission.- Is
Enabled bool Is this permission enabled?
- Type string
The type of the permission.
- User
Consent stringDescription The description of the user consent.
- User
Consent stringDisplay Name The display name of the user consent.
- Value string
The name of this permission.
- Admin
Consent stringDescription The description of the admin consent.
- Admin
Consent stringDisplay Name The display name of the admin consent.
- Id string
The unique identifier for one of the
OAuth2Permission.- Is
Enabled bool Is this permission enabled?
- Type string
The type of the permission.
- User
Consent stringDescription The description of the user consent.
- User
Consent stringDisplay Name The display name of the user consent.
- Value string
The name of this permission.
- admin
Consent stringDescription The description of the admin consent.
- admin
Consent stringDisplay Name The display name of the admin consent.
- id string
The unique identifier for one of the
OAuth2Permission.- is
Enabled boolean Is this permission enabled?
- type string
The type of the permission.
- user
Consent stringDescription The description of the user consent.
- user
Consent stringDisplay Name The display name of the user consent.
- value string
The name of this permission.
- admin
Consent strDescription The description of the admin consent.
- admin
Consent strDisplay Name The display name of the admin consent.
- id str
The unique identifier for one of the
OAuth2Permission.- is
Enabled bool Is this permission enabled?
- type str
The type of the permission.
- user
Consent strDescription The description of the user consent.
- user
Consent strDisplay Name The display name of the user consent.
- value str
The name of this permission.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azuread
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azureadTerraform Provider.