azuread.ApplicationFromTemplate
Explore with Pulumi AI
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/v6/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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ApplicationFromTemplate resource accepts the following input properties:
- Display
Name string - The display name for the application.
- Template
Id 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 string - The display name for the application.
- Template
Id 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 String - The display name for the application.
- template
Id 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 string - The display name for the application.
- template
Id 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.
- display
Name String - The display name for the application.
- template
Id 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:
- Application
Id string - The resource ID for the application.
- Application
Object stringId - The object ID for the application.
- Id string
- The provider-assigned unique ID for this managed resource.
- Service
Principal stringId - The resource ID for the service principal.
- Service
Principal stringObject Id - The object ID for the service principal.
- Application
Id string - The resource ID for the application.
- Application
Object stringId - The object ID for the application.
- Id string
- The provider-assigned unique ID for this managed resource.
- Service
Principal stringId - The resource ID for the service principal.
- Service
Principal stringObject Id - The object ID for the service principal.
- application
Id String - The resource ID for the application.
- application
Object StringId - The object ID for the application.
- id String
- The provider-assigned unique ID for this managed resource.
- service
Principal StringId - The resource ID for the service principal.
- service
Principal StringObject Id - The object ID for the service principal.
- application
Id string - The resource ID for the application.
- application
Object stringId - The object ID for the application.
- id string
- The provider-assigned unique ID for this managed resource.
- service
Principal stringId - The resource ID for the service principal.
- service
Principal stringObject Id - The object ID for the service principal.
- application_
id str - The resource ID for the application.
- application_
object_ strid - The object ID for the application.
- id str
- The provider-assigned unique ID for this managed resource.
- service_
principal_ strid - The resource ID for the service principal.
- service_
principal_ strobject_ id - The object ID for the service principal.
- application
Id String - The resource ID for the application.
- application
Object StringId - The object ID for the application.
- id String
- The provider-assigned unique ID for this managed resource.
- service
Principal StringId - The resource ID for the service principal.
- service
Principal StringObject Id - 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.
- Application
Id string - The resource ID for the application.
- Application
Object stringId - The object ID for the application.
- Display
Name string - The display name for the application.
- Service
Principal stringId - The resource ID for the service principal.
- Service
Principal stringObject Id - The object ID for the service principal.
- Template
Id 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 string - The resource ID for the application.
- Application
Object stringId - The object ID for the application.
- Display
Name string - The display name for the application.
- Service
Principal stringId - The resource ID for the service principal.
- Service
Principal stringObject Id - The object ID for the service principal.
- Template
Id 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 String - The resource ID for the application.
- application
Object StringId - The object ID for the application.
- display
Name String - The display name for the application.
- service
Principal StringId - The resource ID for the service principal.
- service
Principal StringObject Id - The object ID for the service principal.
- template
Id 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 string - The resource ID for the application.
- application
Object stringId - The object ID for the application.
- display
Name string - The display name for the application.
- service
Principal stringId - The resource ID for the service principal.
- service
Principal stringObject Id - The object ID for the service principal.
- template
Id 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_ strid - The object ID for the application.
- display_
name str - The display name for the application.
- service_
principal_ strid - The resource ID for the service principal.
- service_
principal_ strobject_ id - 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.
- application
Id String - The resource ID for the application.
- application
Object StringId - The object ID for the application.
- display
Name String - The display name for the application.
- service
Principal StringId - The resource ID for the service principal.
- service
Principal StringObject Id - The object ID for the service principal.
- template
Id 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.