1. Packages
  2. Azure Active Directory (Azure AD)
  3. API Docs
  4. ApplicationFromTemplate
Azure Active Directory (Azure AD) v5.52.0 published on Friday, Jun 14, 2024 by Pulumi

azuread.ApplicationFromTemplate

Explore with Pulumi AI

azuread logo
Azure Active Directory (Azure AD) v5.52.0 published on Friday, Jun 14, 2024 by Pulumi

    Creates an application registration and associated service principal from a gallery template.

    The azuread.Application resource can also be used to instantiate a gallery application, however unlike the azuread.Application resource, this resource does not attempt to manage any properties of the resulting application.

    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: Application.ReadWrite.OwnedBy or Application.ReadWrite.All

    When authenticated with a user principal, this resource may require one of the following directory roles: Application Administrator or Global Administrator

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuread from "@pulumi/azuread";
    
    const example = azuread.getApplicationTemplate({
        displayName: "Marketo",
    });
    const exampleApplicationFromTemplate = new azuread.ApplicationFromTemplate("example", {
        displayName: "Example Application",
        templateId: example.then(example => example.templateId),
    });
    const exampleGetApplication = azuread.getApplicationOutput({
        objectId: exampleApplicationFromTemplate.applicationObjectId,
    });
    const exampleGetServicePrincipal = azuread.getServicePrincipalOutput({
        objectId: exampleApplicationFromTemplate.servicePrincipalObjectId,
    });
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.get_application_template(display_name="Marketo")
    example_application_from_template = azuread.ApplicationFromTemplate("example",
        display_name="Example Application",
        template_id=example.template_id)
    example_get_application = azuread.get_application_output(object_id=example_application_from_template.application_object_id)
    example_get_service_principal = azuread.get_service_principal_output(object_id=example_application_from_template.service_principal_object_id)
    
    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 {
    		example, err := azuread.GetApplicationTemplate(ctx, &azuread.GetApplicationTemplateArgs{
    			DisplayName: pulumi.StringRef("Marketo"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleApplicationFromTemplate, err := azuread.NewApplicationFromTemplate(ctx, "example", &azuread.ApplicationFromTemplateArgs{
    			DisplayName: pulumi.String("Example Application"),
    			TemplateId:  pulumi.String(example.TemplateId),
    		})
    		if err != nil {
    			return err
    		}
    		_ = azuread.LookupApplicationOutput(ctx, azuread.GetApplicationOutputArgs{
    			ObjectId: exampleApplicationFromTemplate.ApplicationObjectId,
    		}, nil)
    		_ = azuread.LookupServicePrincipalOutput(ctx, azuread.GetServicePrincipalOutputArgs{
    			ObjectId: exampleApplicationFromTemplate.ServicePrincipalObjectId,
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureAD = Pulumi.AzureAD;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AzureAD.GetApplicationTemplate.Invoke(new()
        {
            DisplayName = "Marketo",
        });
    
        var exampleApplicationFromTemplate = new AzureAD.ApplicationFromTemplate("example", new()
        {
            DisplayName = "Example Application",
            TemplateId = example.Apply(getApplicationTemplateResult => getApplicationTemplateResult.TemplateId),
        });
    
        var exampleGetApplication = AzureAD.GetApplication.Invoke(new()
        {
            ObjectId = exampleApplicationFromTemplate.ApplicationObjectId,
        });
    
        var exampleGetServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new()
        {
            ObjectId = exampleApplicationFromTemplate.ServicePrincipalObjectId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuread.AzureadFunctions;
    import com.pulumi.azuread.inputs.GetApplicationTemplateArgs;
    import com.pulumi.azuread.ApplicationFromTemplate;
    import com.pulumi.azuread.ApplicationFromTemplateArgs;
    import com.pulumi.azuread.inputs.GetApplicationArgs;
    import com.pulumi.azuread.inputs.GetServicePrincipalArgs;
    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) {
            final var example = AzureadFunctions.getApplicationTemplate(GetApplicationTemplateArgs.builder()
                .displayName("Marketo")
                .build());
    
            var exampleApplicationFromTemplate = new ApplicationFromTemplate("exampleApplicationFromTemplate", ApplicationFromTemplateArgs.builder()
                .displayName("Example Application")
                .templateId(example.applyValue(getApplicationTemplateResult -> getApplicationTemplateResult.templateId()))
                .build());
    
            final var exampleGetApplication = AzureadFunctions.getApplication(GetApplicationArgs.builder()
                .objectId(exampleApplicationFromTemplate.applicationObjectId())
                .build());
    
            final var exampleGetServicePrincipal = AzureadFunctions.getServicePrincipal(GetServicePrincipalArgs.builder()
                .objectId(exampleApplicationFromTemplate.servicePrincipalObjectId())
                .build());
    
        }
    }
    
    resources:
      exampleApplicationFromTemplate:
        type: azuread:ApplicationFromTemplate
        name: example
        properties:
          displayName: Example Application
          templateId: ${example.templateId}
    variables:
      example:
        fn::invoke:
          Function: azuread:getApplicationTemplate
          Arguments:
            displayName: Marketo
      exampleGetApplication:
        fn::invoke:
          Function: azuread:getApplication
          Arguments:
            objectId: ${exampleApplicationFromTemplate.applicationObjectId}
      exampleGetServicePrincipal:
        fn::invoke:
          Function: azuread:getServicePrincipal
          Arguments:
            objectId: ${exampleApplicationFromTemplate.servicePrincipalObjectId}
    

    Create ApplicationFromTemplate Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ApplicationFromTemplate(name: string, args: ApplicationFromTemplateArgs, opts?: CustomResourceOptions);
    @overload
    def ApplicationFromTemplate(resource_name: str,
                                args: ApplicationFromTemplateArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApplicationFromTemplate(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                display_name: Optional[str] = None,
                                template_id: Optional[str] = None)
    func NewApplicationFromTemplate(ctx *Context, name string, args ApplicationFromTemplateArgs, opts ...ResourceOption) (*ApplicationFromTemplate, error)
    public ApplicationFromTemplate(string name, ApplicationFromTemplateArgs args, CustomResourceOptions? opts = null)
    public ApplicationFromTemplate(String name, ApplicationFromTemplateArgs args)
    public ApplicationFromTemplate(String name, ApplicationFromTemplateArgs args, CustomResourceOptions options)
    
    type: azuread:ApplicationFromTemplate
    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 ApplicationFromTemplateArgs
    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 ApplicationFromTemplateArgs
    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 ApplicationFromTemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApplicationFromTemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApplicationFromTemplateArgs
    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 applicationFromTemplateResource = new AzureAD.ApplicationFromTemplate("applicationFromTemplateResource", new()
    {
        DisplayName = "string",
        TemplateId = "string",
    });
    
    example, err := azuread.NewApplicationFromTemplate(ctx, "applicationFromTemplateResource", &azuread.ApplicationFromTemplateArgs{
    	DisplayName: pulumi.String("string"),
    	TemplateId:  pulumi.String("string"),
    })
    
    var applicationFromTemplateResource = new ApplicationFromTemplate("applicationFromTemplateResource", ApplicationFromTemplateArgs.builder()
        .displayName("string")
        .templateId("string")
        .build());
    
    application_from_template_resource = azuread.ApplicationFromTemplate("applicationFromTemplateResource",
        display_name="string",
        template_id="string")
    
    const applicationFromTemplateResource = new azuread.ApplicationFromTemplate("applicationFromTemplateResource", {
        displayName: "string",
        templateId: "string",
    });
    
    type: azuread:ApplicationFromTemplate
    properties:
        displayName: string
        templateId: string
    

    ApplicationFromTemplate 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 ApplicationFromTemplate resource accepts the following input properties:

    DisplayName string
    The display name for the application.
    TemplateId string
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.
    DisplayName string
    The display name for the application.
    TemplateId string
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.
    displayName String
    The display name for the application.
    templateId String
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.
    displayName string
    The display name for the application.
    templateId string
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.
    display_name str
    The display name for the application.
    template_id str
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.
    displayName String
    The display name for the application.
    templateId String
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.

    Outputs

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

    ApplicationId string
    The resource ID for the application.
    ApplicationObjectId string
    The object ID for the application.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServicePrincipalId string
    The resource ID for the service principal.
    ServicePrincipalObjectId string
    The object ID for the service principal.
    ApplicationId string
    The resource ID for the application.
    ApplicationObjectId string
    The object ID for the application.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServicePrincipalId string
    The resource ID for the service principal.
    ServicePrincipalObjectId string
    The object ID for the service principal.
    applicationId String
    The resource ID for the application.
    applicationObjectId String
    The object ID for the application.
    id String
    The provider-assigned unique ID for this managed resource.
    servicePrincipalId String
    The resource ID for the service principal.
    servicePrincipalObjectId String
    The object ID for the service principal.
    applicationId string
    The resource ID for the application.
    applicationObjectId string
    The object ID for the application.
    id string
    The provider-assigned unique ID for this managed resource.
    servicePrincipalId string
    The resource ID for the service principal.
    servicePrincipalObjectId string
    The object ID for the service principal.
    application_id str
    The resource ID for the application.
    application_object_id str
    The object ID for the application.
    id str
    The provider-assigned unique ID for this managed resource.
    service_principal_id str
    The resource ID for the service principal.
    service_principal_object_id str
    The object ID for the service principal.
    applicationId String
    The resource ID for the application.
    applicationObjectId String
    The object ID for the application.
    id String
    The provider-assigned unique ID for this managed resource.
    servicePrincipalId String
    The resource ID for the service principal.
    servicePrincipalObjectId String
    The object ID for the service principal.

    Look up Existing ApplicationFromTemplate Resource

    Get an existing ApplicationFromTemplate 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?: ApplicationFromTemplateState, opts?: CustomResourceOptions): ApplicationFromTemplate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_id: Optional[str] = None,
            application_object_id: Optional[str] = None,
            display_name: Optional[str] = None,
            service_principal_id: Optional[str] = None,
            service_principal_object_id: Optional[str] = None,
            template_id: Optional[str] = None) -> ApplicationFromTemplate
    func GetApplicationFromTemplate(ctx *Context, name string, id IDInput, state *ApplicationFromTemplateState, opts ...ResourceOption) (*ApplicationFromTemplate, error)
    public static ApplicationFromTemplate Get(string name, Input<string> id, ApplicationFromTemplateState? state, CustomResourceOptions? opts = null)
    public static ApplicationFromTemplate get(String name, Output<String> id, ApplicationFromTemplateState 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:
    ApplicationId string
    The resource ID for the application.
    ApplicationObjectId string
    The object ID for the application.
    DisplayName string
    The display name for the application.
    ServicePrincipalId string
    The resource ID for the service principal.
    ServicePrincipalObjectId string
    The object ID for the service principal.
    TemplateId string
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.
    ApplicationId string
    The resource ID for the application.
    ApplicationObjectId string
    The object ID for the application.
    DisplayName string
    The display name for the application.
    ServicePrincipalId string
    The resource ID for the service principal.
    ServicePrincipalObjectId string
    The object ID for the service principal.
    TemplateId string
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.
    applicationId String
    The resource ID for the application.
    applicationObjectId String
    The object ID for the application.
    displayName String
    The display name for the application.
    servicePrincipalId String
    The resource ID for the service principal.
    servicePrincipalObjectId String
    The object ID for the service principal.
    templateId String
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.
    applicationId string
    The resource ID for the application.
    applicationObjectId string
    The object ID for the application.
    displayName string
    The display name for the application.
    servicePrincipalId string
    The resource ID for the service principal.
    servicePrincipalObjectId string
    The object ID for the service principal.
    templateId string
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.
    application_id str
    The resource ID for the application.
    application_object_id str
    The object ID for the application.
    display_name str
    The display name for the application.
    service_principal_id str
    The resource ID for the service principal.
    service_principal_object_id str
    The object ID for the service principal.
    template_id str
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.
    applicationId String
    The resource ID for the application.
    applicationObjectId String
    The object ID for the application.
    displayName String
    The display name for the application.
    servicePrincipalId String
    The resource ID for the service principal.
    servicePrincipalObjectId String
    The object ID for the service principal.
    templateId String
    Unique ID for a templated application in the Azure AD App Gallery, from which to create the application. Changing this forces a new resource to be created.

    Import

    Templated Applications can be imported using the template ID, the object ID of the application, and the object ID of the service principal, in the following format.

    $ pulumi import azuread:index/applicationFromTemplate:ApplicationFromTemplate example /applicationTemplates/00000000-0000-0000-0000-000000000000/instantiate/11111111-1111-1111-1111-111111111111/22222222-2222-2222-2222-222222222222
    

    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 azuread Terraform Provider.
    azuread logo
    Azure Active Directory (Azure AD) v5.52.0 published on Friday, Jun 14, 2024 by Pulumi