azuread.Invitation
Explore with Pulumi AI
Manages an invitation of a guest user within Azure Active Directory.
API Permissions
The following API permissions are required in order to use this resource.
When authenticated with a service principal, this resource requires one of the following application roles: User.Invite.All, User.ReadWrite.All or Directory.ReadWrite.All
When authenticated with a user principal, this resource requires one of the following directory roles: Guest Inviter, User Administrator or Global Administrator
Example Usage
Basic example
import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";
const example = new azuread.Invitation("example", {
    userEmailAddress: "jdoe@example.com",
    redirectUrl: "https://portal.azure.com",
});
import pulumi
import pulumi_azuread as azuread
example = azuread.Invitation("example",
    user_email_address="jdoe@example.com",
    redirect_url="https://portal.azure.com")
package main
import (
	"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := azuread.NewInvitation(ctx, "example", &azuread.InvitationArgs{
			UserEmailAddress: pulumi.String("jdoe@example.com"),
			RedirectUrl:      pulumi.String("https://portal.azure.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;
return await Deployment.RunAsync(() => 
{
    var example = new AzureAD.Invitation("example", new()
    {
        UserEmailAddress = "jdoe@example.com",
        RedirectUrl = "https://portal.azure.com",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.Invitation;
import com.pulumi.azuread.InvitationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var example = new Invitation("example", InvitationArgs.builder()
            .userEmailAddress("jdoe@example.com")
            .redirectUrl("https://portal.azure.com")
            .build());
    }
}
resources:
  example:
    type: azuread:Invitation
    properties:
      userEmailAddress: jdoe@example.com
      redirectUrl: https://portal.azure.com
Invitation with standard message
import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";
const example = new azuread.Invitation("example", {
    userEmailAddress: "jdoe@example.com",
    redirectUrl: "https://portal.azure.com",
    message: {
        language: "en-US",
    },
});
import pulumi
import pulumi_azuread as azuread
example = azuread.Invitation("example",
    user_email_address="jdoe@example.com",
    redirect_url="https://portal.azure.com",
    message={
        "language": "en-US",
    })
package main
import (
	"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := azuread.NewInvitation(ctx, "example", &azuread.InvitationArgs{
			UserEmailAddress: pulumi.String("jdoe@example.com"),
			RedirectUrl:      pulumi.String("https://portal.azure.com"),
			Message: &azuread.InvitationMessageArgs{
				Language: pulumi.String("en-US"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;
return await Deployment.RunAsync(() => 
{
    var example = new AzureAD.Invitation("example", new()
    {
        UserEmailAddress = "jdoe@example.com",
        RedirectUrl = "https://portal.azure.com",
        Message = new AzureAD.Inputs.InvitationMessageArgs
        {
            Language = "en-US",
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.Invitation;
import com.pulumi.azuread.InvitationArgs;
import com.pulumi.azuread.inputs.InvitationMessageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var example = new Invitation("example", InvitationArgs.builder()
            .userEmailAddress("jdoe@example.com")
            .redirectUrl("https://portal.azure.com")
            .message(InvitationMessageArgs.builder()
                .language("en-US")
                .build())
            .build());
    }
}
resources:
  example:
    type: azuread:Invitation
    properties:
      userEmailAddress: jdoe@example.com
      redirectUrl: https://portal.azure.com
      message:
        language: en-US
Invitation with custom message body and an additional recipient
import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";
const example = new azuread.Invitation("example", {
    userDisplayName: "Bob Bobson",
    userEmailAddress: "bbobson@example.com",
    redirectUrl: "https://portal.azure.com",
    message: {
        additionalRecipients: "aaliceberg@example.com",
        body: "Hello there! You are invited to join my Azure tenant!",
    },
});
import pulumi
import pulumi_azuread as azuread
example = azuread.Invitation("example",
    user_display_name="Bob Bobson",
    user_email_address="bbobson@example.com",
    redirect_url="https://portal.azure.com",
    message={
        "additional_recipients": "aaliceberg@example.com",
        "body": "Hello there! You are invited to join my Azure tenant!",
    })
package main
import (
	"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := azuread.NewInvitation(ctx, "example", &azuread.InvitationArgs{
			UserDisplayName:  pulumi.String("Bob Bobson"),
			UserEmailAddress: pulumi.String("bbobson@example.com"),
			RedirectUrl:      pulumi.String("https://portal.azure.com"),
			Message: &azuread.InvitationMessageArgs{
				AdditionalRecipients: pulumi.String("aaliceberg@example.com"),
				Body:                 pulumi.String("Hello there! You are invited to join my Azure tenant!"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;
return await Deployment.RunAsync(() => 
{
    var example = new AzureAD.Invitation("example", new()
    {
        UserDisplayName = "Bob Bobson",
        UserEmailAddress = "bbobson@example.com",
        RedirectUrl = "https://portal.azure.com",
        Message = new AzureAD.Inputs.InvitationMessageArgs
        {
            AdditionalRecipients = "aaliceberg@example.com",
            Body = "Hello there! You are invited to join my Azure tenant!",
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.Invitation;
import com.pulumi.azuread.InvitationArgs;
import com.pulumi.azuread.inputs.InvitationMessageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var example = new Invitation("example", InvitationArgs.builder()
            .userDisplayName("Bob Bobson")
            .userEmailAddress("bbobson@example.com")
            .redirectUrl("https://portal.azure.com")
            .message(InvitationMessageArgs.builder()
                .additionalRecipients("aaliceberg@example.com")
                .body("Hello there! You are invited to join my Azure tenant!")
                .build())
            .build());
    }
}
resources:
  example:
    type: azuread:Invitation
    properties:
      userDisplayName: Bob Bobson
      userEmailAddress: bbobson@example.com
      redirectUrl: https://portal.azure.com
      message:
        additionalRecipients: aaliceberg@example.com
        body: Hello there! You are invited to join my Azure tenant!
Create Invitation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Invitation(name: string, args: InvitationArgs, opts?: CustomResourceOptions);@overload
def Invitation(resource_name: str,
               args: InvitationArgs,
               opts: Optional[ResourceOptions] = None)
@overload
def Invitation(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               redirect_url: Optional[str] = None,
               user_email_address: Optional[str] = None,
               message: Optional[InvitationMessageArgs] = None,
               user_display_name: Optional[str] = None,
               user_type: Optional[str] = None)func NewInvitation(ctx *Context, name string, args InvitationArgs, opts ...ResourceOption) (*Invitation, error)public Invitation(string name, InvitationArgs args, CustomResourceOptions? opts = null)
public Invitation(String name, InvitationArgs args)
public Invitation(String name, InvitationArgs args, CustomResourceOptions options)
type: azuread:Invitation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args InvitationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args InvitationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args InvitationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InvitationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InvitationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var invitationResource = new AzureAD.Invitation("invitationResource", new()
{
    RedirectUrl = "string",
    UserEmailAddress = "string",
    Message = new AzureAD.Inputs.InvitationMessageArgs
    {
        AdditionalRecipients = "string",
        Body = "string",
        Language = "string",
    },
    UserDisplayName = "string",
    UserType = "string",
});
example, err := azuread.NewInvitation(ctx, "invitationResource", &azuread.InvitationArgs{
	RedirectUrl:      pulumi.String("string"),
	UserEmailAddress: pulumi.String("string"),
	Message: &azuread.InvitationMessageArgs{
		AdditionalRecipients: pulumi.String("string"),
		Body:                 pulumi.String("string"),
		Language:             pulumi.String("string"),
	},
	UserDisplayName: pulumi.String("string"),
	UserType:        pulumi.String("string"),
})
var invitationResource = new Invitation("invitationResource", InvitationArgs.builder()
    .redirectUrl("string")
    .userEmailAddress("string")
    .message(InvitationMessageArgs.builder()
        .additionalRecipients("string")
        .body("string")
        .language("string")
        .build())
    .userDisplayName("string")
    .userType("string")
    .build());
invitation_resource = azuread.Invitation("invitationResource",
    redirect_url="string",
    user_email_address="string",
    message={
        "additional_recipients": "string",
        "body": "string",
        "language": "string",
    },
    user_display_name="string",
    user_type="string")
const invitationResource = new azuread.Invitation("invitationResource", {
    redirectUrl: "string",
    userEmailAddress: "string",
    message: {
        additionalRecipients: "string",
        body: "string",
        language: "string",
    },
    userDisplayName: "string",
    userType: "string",
});
type: azuread:Invitation
properties:
    message:
        additionalRecipients: string
        body: string
        language: string
    redirectUrl: string
    userDisplayName: string
    userEmailAddress: string
    userType: string
Invitation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Invitation resource accepts the following input properties:
- RedirectUrl string
- The URL that the user should be redirected to once the invitation is redeemed.
- UserEmail stringAddress 
- The email address of the user being invited.
- Message
Pulumi.Azure AD. Inputs. Invitation Message 
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- UserDisplay stringName 
- The display name of the user being invited.
- UserType string
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
- RedirectUrl string
- The URL that the user should be redirected to once the invitation is redeemed.
- UserEmail stringAddress 
- The email address of the user being invited.
- Message
InvitationMessage Args 
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- UserDisplay stringName 
- The display name of the user being invited.
- UserType string
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
- redirectUrl String
- The URL that the user should be redirected to once the invitation is redeemed.
- userEmail StringAddress 
- The email address of the user being invited.
- message
InvitationMessage 
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- userDisplay StringName 
- The display name of the user being invited.
- userType String
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
- redirectUrl string
- The URL that the user should be redirected to once the invitation is redeemed.
- userEmail stringAddress 
- The email address of the user being invited.
- message
InvitationMessage 
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- userDisplay stringName 
- The display name of the user being invited.
- userType string
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
- redirect_url str
- The URL that the user should be redirected to once the invitation is redeemed.
- user_email_ straddress 
- The email address of the user being invited.
- message
InvitationMessage Args 
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- user_display_ strname 
- The display name of the user being invited.
- user_type str
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
- redirectUrl String
- The URL that the user should be redirected to once the invitation is redeemed.
- userEmail StringAddress 
- The email address of the user being invited.
- message Property Map
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- userDisplay StringName 
- The display name of the user being invited.
- userType String
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
Outputs
All input properties are implicitly available as output properties. Additionally, the Invitation resource produces the following output properties:
- id str
- The provider-assigned unique ID for this managed resource.
- redeem_url str
- The URL the user can use to redeem their invitation.
- user_id str
- Object ID of the invited user.
Look up Existing Invitation Resource
Get an existing Invitation 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?: InvitationState, opts?: CustomResourceOptions): Invitation@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        message: Optional[InvitationMessageArgs] = None,
        redeem_url: Optional[str] = None,
        redirect_url: Optional[str] = None,
        user_display_name: Optional[str] = None,
        user_email_address: Optional[str] = None,
        user_id: Optional[str] = None,
        user_type: Optional[str] = None) -> Invitationfunc GetInvitation(ctx *Context, name string, id IDInput, state *InvitationState, opts ...ResourceOption) (*Invitation, error)public static Invitation Get(string name, Input<string> id, InvitationState? state, CustomResourceOptions? opts = null)public static Invitation get(String name, Output<String> id, InvitationState state, CustomResourceOptions options)resources:  _:    type: azuread:Invitation    get:      id: ${id}- 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.
- 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.
- Message
Pulumi.Azure AD. Inputs. Invitation Message 
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- RedeemUrl string
- The URL the user can use to redeem their invitation.
- RedirectUrl string
- The URL that the user should be redirected to once the invitation is redeemed.
- UserDisplay stringName 
- The display name of the user being invited.
- UserEmail stringAddress 
- The email address of the user being invited.
- UserId string
- Object ID of the invited user.
- UserType string
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
- Message
InvitationMessage Args 
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- RedeemUrl string
- The URL the user can use to redeem their invitation.
- RedirectUrl string
- The URL that the user should be redirected to once the invitation is redeemed.
- UserDisplay stringName 
- The display name of the user being invited.
- UserEmail stringAddress 
- The email address of the user being invited.
- UserId string
- Object ID of the invited user.
- UserType string
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
- message
InvitationMessage 
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- redeemUrl String
- The URL the user can use to redeem their invitation.
- redirectUrl String
- The URL that the user should be redirected to once the invitation is redeemed.
- userDisplay StringName 
- The display name of the user being invited.
- userEmail StringAddress 
- The email address of the user being invited.
- userId String
- Object ID of the invited user.
- userType String
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
- message
InvitationMessage 
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- redeemUrl string
- The URL the user can use to redeem their invitation.
- redirectUrl string
- The URL that the user should be redirected to once the invitation is redeemed.
- userDisplay stringName 
- The display name of the user being invited.
- userEmail stringAddress 
- The email address of the user being invited.
- userId string
- Object ID of the invited user.
- userType string
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
- message
InvitationMessage Args 
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- redeem_url str
- The URL the user can use to redeem their invitation.
- redirect_url str
- The URL that the user should be redirected to once the invitation is redeemed.
- user_display_ strname 
- The display name of the user being invited.
- user_email_ straddress 
- The email address of the user being invited.
- user_id str
- Object ID of the invited user.
- user_type str
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
- message Property Map
- A messageblock as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
- redeemUrl String
- The URL the user can use to redeem their invitation.
- redirectUrl String
- The URL that the user should be redirected to once the invitation is redeemed.
- userDisplay StringName 
- The display name of the user being invited.
- userEmail StringAddress 
- The email address of the user being invited.
- userId String
- Object ID of the invited user.
- userType String
- The user type of the user being invited. Must be one of GuestorMember. Only Global Administrators can invite users as members. Defaults toGuest.
Supporting Types
InvitationMessage, InvitationMessageArgs    
- AdditionalRecipients string
- Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- Body string
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with language.
- Language string
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to en-US. Cannot be specified withbody.
- AdditionalRecipients string
- Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- Body string
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with language.
- Language string
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to en-US. Cannot be specified withbody.
- additionalRecipients String
- Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- body String
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with language.
- language String
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to en-US. Cannot be specified withbody.
- additionalRecipients string
- Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- body string
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with language.
- language string
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to en-US. Cannot be specified withbody.
- additional_recipients str
- Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- body str
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with language.
- language str
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to en-US. Cannot be specified withbody.
- additionalRecipients String
- Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- body String
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with language.
- language String
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to en-US. Cannot be specified withbody.
Import
This resource does not support importing.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Active Directory (Azure AD) pulumi/pulumi-azuread
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azureadTerraform Provider.