1. Packages
  2. Azure Active Directory (Azure AD)
  3. API Docs
  4. Invitation
Azure Active Directory (Azure AD) v5.47.2 published on Tuesday, Feb 27, 2024 by Pulumi

azuread.Invitation

Explore with Pulumi AI

azuread logo
Azure Active Directory (Azure AD) v5.47.2 published on Tuesday, Feb 27, 2024 by Pulumi

    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

    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 main
    
    import (
    	"github.com/pulumi/pulumi-azuread/sdk/v5/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
    	})
    }
    
    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());
    
        }
    }
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.Invitation("example",
        user_email_address="jdoe@example.com",
        redirect_url="https://portal.azure.com")
    
    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",
    });
    
    resources:
      example:
        type: azuread:Invitation
        properties:
          userEmailAddress: jdoe@example.com
          redirectUrl: https://portal.azure.com
    

    Invitation with standard message

    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 main
    
    import (
    	"github.com/pulumi/pulumi-azuread/sdk/v5/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
    	})
    }
    
    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());
    
        }
    }
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.Invitation("example",
        user_email_address="jdoe@example.com",
        redirect_url="https://portal.azure.com",
        message=azuread.InvitationMessageArgs(
            language="en-US",
        ))
    
    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",
        },
    });
    
    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

    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 main
    
    import (
    	"github.com/pulumi/pulumi-azuread/sdk/v5/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
    	})
    }
    
    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());
    
        }
    }
    
    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=azuread.InvitationMessageArgs(
            additional_recipients="aaliceberg@example.com",
            body="Hello there! You are invited to join my Azure tenant!",
        ))
    
    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!",
        },
    });
    
    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

    new Invitation(name: string, args: InvitationArgs, opts?: CustomResourceOptions);
    @overload
    def Invitation(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   message: Optional[InvitationMessageArgs] = None,
                   redirect_url: Optional[str] = None,
                   user_display_name: Optional[str] = None,
                   user_email_address: Optional[str] = None,
                   user_type: Optional[str] = None)
    @overload
    def Invitation(resource_name: str,
                   args: InvitationArgs,
                   opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    The Invitation resource accepts the following input properties:

    RedirectUrl string
    The URL that the user should be redirected to once the invitation is redeemed.
    UserEmailAddress string
    The email address of the user being invited.
    Message Pulumi.AzureAD.Inputs.InvitationMessage
    A message block as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
    UserDisplayName string
    The display name of the user being invited.
    UserType string
    The user type of the user being invited. Must be one of Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.
    RedirectUrl string
    The URL that the user should be redirected to once the invitation is redeemed.
    UserEmailAddress string
    The email address of the user being invited.
    Message InvitationMessageArgs
    A message block as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
    UserDisplayName string
    The display name of the user being invited.
    UserType string
    The user type of the user being invited. Must be one of Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.
    redirectUrl String
    The URL that the user should be redirected to once the invitation is redeemed.
    userEmailAddress String
    The email address of the user being invited.
    message InvitationMessage
    A message block as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
    userDisplayName String
    The display name of the user being invited.
    userType String
    The user type of the user being invited. Must be one of Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.
    redirectUrl string
    The URL that the user should be redirected to once the invitation is redeemed.
    userEmailAddress string
    The email address of the user being invited.
    message InvitationMessage
    A message block as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
    userDisplayName string
    The display name of the user being invited.
    userType string
    The user type of the user being invited. Must be one of Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.
    redirect_url str
    The URL that the user should be redirected to once the invitation is redeemed.
    user_email_address str
    The email address of the user being invited.
    message InvitationMessageArgs
    A message block 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_name str
    The display name of the user being invited.
    user_type str
    The user type of the user being invited. Must be one of Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.
    redirectUrl String
    The URL that the user should be redirected to once the invitation is redeemed.
    userEmailAddress String
    The email address of the user being invited.
    message Property Map
    A message block as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent.
    userDisplayName String
    The display name of the user being invited.
    userType String
    The user type of the user being invited. Must be one of Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Invitation resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    RedeemUrl string
    The URL the user can use to redeem their invitation.
    UserId string
    Object ID of the invited user.
    Id string
    The provider-assigned unique ID for this managed resource.
    RedeemUrl string
    The URL the user can use to redeem their invitation.
    UserId string
    Object ID of the invited user.
    id String
    The provider-assigned unique ID for this managed resource.
    redeemUrl String
    The URL the user can use to redeem their invitation.
    userId String
    Object ID of the invited user.
    id string
    The provider-assigned unique ID for this managed resource.
    redeemUrl string
    The URL the user can use to redeem their invitation.
    userId string
    Object ID of the invited user.
    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.
    id String
    The provider-assigned unique ID for this managed resource.
    redeemUrl String
    The URL the user can use to redeem their invitation.
    userId String
    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) -> Invitation
    func 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)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    Message Pulumi.AzureAD.Inputs.InvitationMessage
    A message block 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.
    UserDisplayName string
    The display name of the user being invited.
    UserEmailAddress string
    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 Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.
    Message InvitationMessageArgs
    A message block 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.
    UserDisplayName string
    The display name of the user being invited.
    UserEmailAddress string
    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 Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.
    message InvitationMessage
    A message block 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.
    userDisplayName String
    The display name of the user being invited.
    userEmailAddress String
    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 Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.
    message InvitationMessage
    A message block 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.
    userDisplayName string
    The display name of the user being invited.
    userEmailAddress string
    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 Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.
    message InvitationMessageArgs
    A message block 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_name str
    The display name of the user being invited.
    user_email_address str
    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 Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.
    message Property Map
    A message block 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.
    userDisplayName String
    The display name of the user being invited.
    userEmailAddress String
    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 Guest or Member. Only Global Administrators can invite users as members. Defaults to Guest.

    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 with body.
    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 with body.
    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 with body.
    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 with body.
    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 with body.
    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 with body.

    Import

    This resource does not support importing.

    Package Details

    Repository
    Azure Active Directory (Azure AD) pulumi/pulumi-azuread
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuread Terraform Provider.
    azuread logo
    Azure Active Directory (Azure AD) v5.47.2 published on Tuesday, Feb 27, 2024 by Pulumi