ApplicationPassword

Manages a Password associated with an Application within Azure Active Directory. Also can be referred to as Client secrets.

NOTE: If you’re authenticating using a Service Principal then it must have permissions to both Read and write all applications and Sign in and read user profile within the Windows Azure Active Directory API.

Example Usage

using Pulumi;
using AzureAD = Pulumi.AzureAD;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleApplication = new AzureAD.Application("exampleApplication", new AzureAD.ApplicationArgs
        {
        });
        var exampleApplicationPassword = new AzureAD.ApplicationPassword("exampleApplicationPassword", new AzureAD.ApplicationPasswordArgs
        {
            ApplicationObjectId = exampleApplication.Id,
            Description = "My managed password",
            Value = "VT=uSgbTanZhyz@%nL9Hpd+Tfay_MRV#",
            EndDate = "2099-01-01T01:02:03Z",
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-azuread/sdk/v4/go/azuread"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleApplication, err := azuread.NewApplication(ctx, "exampleApplication", nil)
		if err != nil {
			return err
		}
		_, err = azuread.NewApplicationPassword(ctx, "exampleApplicationPassword", &azuread.ApplicationPasswordArgs{
			ApplicationObjectId: exampleApplication.ID(),
			Description:         pulumi.String("My managed password"),
			Value:               pulumi.String(fmt.Sprintf("%v%v%v", "VT=uSgbTanZhyz@", "%", "nL9Hpd+Tfay_MRV#")),
			EndDate:             pulumi.String("2099-01-01T01:02:03Z"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_azuread as azuread

example_application = azuread.Application("exampleApplication")
example_application_password = azuread.ApplicationPassword("exampleApplicationPassword",
    application_object_id=example_application.id,
    description="My managed password",
    value="VT=uSgbTanZhyz@%nL9Hpd+Tfay_MRV#",
    end_date="2099-01-01T01:02:03Z")
import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";

const exampleApplication = new azuread.Application("exampleApplication", {});
const exampleApplicationPassword = new azuread.ApplicationPassword("exampleApplicationPassword", {
    applicationObjectId: exampleApplication.id,
    description: "My managed password",
    value: `VT=uSgbTanZhyz@%nL9Hpd+Tfay_MRV#`,
    endDate: "2099-01-01T01:02:03Z",
});

Create a ApplicationPassword Resource

new ApplicationPassword(name: string, args: ApplicationPasswordArgs, opts?: CustomResourceOptions);
@overload
def ApplicationPassword(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        application_object_id: Optional[str] = None,
                        description: Optional[str] = None,
                        end_date: Optional[str] = None,
                        end_date_relative: Optional[str] = None,
                        key_id: Optional[str] = None,
                        start_date: Optional[str] = None,
                        value: Optional[str] = None)
@overload
def ApplicationPassword(resource_name: str,
                        args: ApplicationPasswordArgs,
                        opts: Optional[ResourceOptions] = None)
func NewApplicationPassword(ctx *Context, name string, args ApplicationPasswordArgs, opts ...ResourceOption) (*ApplicationPassword, error)
public ApplicationPassword(string name, ApplicationPasswordArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ApplicationPasswordArgs
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 ApplicationPasswordArgs
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 ApplicationPasswordArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ApplicationPasswordArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ApplicationPassword Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ApplicationPassword resource accepts the following input properties:

ApplicationObjectId string
The Object ID of the Application for which this password should be created. Changing this field forces a new resource to be created.
Value string
The Password for this Application.
Description string
A description for the Password.
EndDate string
The End Date which the Password is valid until, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). Changing this field forces a new resource to be created.
EndDateRelative string
A relative duration for which the Password is valid until, for example 240h (10 days) or 2400h30m. Changing this field forces a new resource to be created.
KeyId string
A GUID used to uniquely identify this Password. If not specified a GUID will be created. Changing this field forces a new resource to be created.
StartDate string
The Start Date which the Password is valid from, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). If this isn’t specified, the current date is used. Changing this field forces a new resource to be created.
ApplicationObjectId string
The Object ID of the Application for which this password should be created. Changing this field forces a new resource to be created.
Value string
The Password for this Application.
Description string
A description for the Password.
EndDate string
The End Date which the Password is valid until, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). Changing this field forces a new resource to be created.
EndDateRelative string
A relative duration for which the Password is valid until, for example 240h (10 days) or 2400h30m. Changing this field forces a new resource to be created.
KeyId string
A GUID used to uniquely identify this Password. If not specified a GUID will be created. Changing this field forces a new resource to be created.
StartDate string
The Start Date which the Password is valid from, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). If this isn’t specified, the current date is used. Changing this field forces a new resource to be created.
applicationObjectId string
The Object ID of the Application for which this password should be created. Changing this field forces a new resource to be created.
value string
The Password for this Application.
description string
A description for the Password.
endDate string
The End Date which the Password is valid until, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). Changing this field forces a new resource to be created.
endDateRelative string
A relative duration for which the Password is valid until, for example 240h (10 days) or 2400h30m. Changing this field forces a new resource to be created.
keyId string
A GUID used to uniquely identify this Password. If not specified a GUID will be created. Changing this field forces a new resource to be created.
startDate string
The Start Date which the Password is valid from, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). If this isn’t specified, the current date is used. Changing this field forces a new resource to be created.
application_object_id str
The Object ID of the Application for which this password should be created. Changing this field forces a new resource to be created.
value str
The Password for this Application.
description str
A description for the Password.
end_date str
The End Date which the Password is valid until, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). Changing this field forces a new resource to be created.
end_date_relative str
A relative duration for which the Password is valid until, for example 240h (10 days) or 2400h30m. Changing this field forces a new resource to be created.
key_id str
A GUID used to uniquely identify this Password. If not specified a GUID will be created. Changing this field forces a new resource to be created.
start_date str
The Start Date which the Password is valid from, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). If this isn’t specified, the current date is used. Changing this field forces a new resource to be created.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing ApplicationPassword Resource

Get an existing ApplicationPassword 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?: ApplicationPasswordState, opts?: CustomResourceOptions): ApplicationPassword
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        application_object_id: Optional[str] = None,
        description: Optional[str] = None,
        end_date: Optional[str] = None,
        end_date_relative: Optional[str] = None,
        key_id: Optional[str] = None,
        start_date: Optional[str] = None,
        value: Optional[str] = None) -> ApplicationPassword
func GetApplicationPassword(ctx *Context, name string, id IDInput, state *ApplicationPasswordState, opts ...ResourceOption) (*ApplicationPassword, error)
public static ApplicationPassword Get(string name, Input<string> id, ApplicationPasswordState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ApplicationObjectId string
The Object ID of the Application for which this password should be created. Changing this field forces a new resource to be created.
Description string
A description for the Password.
EndDate string
The End Date which the Password is valid until, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). Changing this field forces a new resource to be created.
EndDateRelative string
A relative duration for which the Password is valid until, for example 240h (10 days) or 2400h30m. Changing this field forces a new resource to be created.
KeyId string
A GUID used to uniquely identify this Password. If not specified a GUID will be created. Changing this field forces a new resource to be created.
StartDate string
The Start Date which the Password is valid from, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). If this isn’t specified, the current date is used. Changing this field forces a new resource to be created.
Value string
The Password for this Application.
ApplicationObjectId string
The Object ID of the Application for which this password should be created. Changing this field forces a new resource to be created.
Description string
A description for the Password.
EndDate string
The End Date which the Password is valid until, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). Changing this field forces a new resource to be created.
EndDateRelative string
A relative duration for which the Password is valid until, for example 240h (10 days) or 2400h30m. Changing this field forces a new resource to be created.
KeyId string
A GUID used to uniquely identify this Password. If not specified a GUID will be created. Changing this field forces a new resource to be created.
StartDate string
The Start Date which the Password is valid from, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). If this isn’t specified, the current date is used. Changing this field forces a new resource to be created.
Value string
The Password for this Application.
applicationObjectId string
The Object ID of the Application for which this password should be created. Changing this field forces a new resource to be created.
description string
A description for the Password.
endDate string
The End Date which the Password is valid until, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). Changing this field forces a new resource to be created.
endDateRelative string
A relative duration for which the Password is valid until, for example 240h (10 days) or 2400h30m. Changing this field forces a new resource to be created.
keyId string
A GUID used to uniquely identify this Password. If not specified a GUID will be created. Changing this field forces a new resource to be created.
startDate string
The Start Date which the Password is valid from, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). If this isn’t specified, the current date is used. Changing this field forces a new resource to be created.
value string
The Password for this Application.
application_object_id str
The Object ID of the Application for which this password should be created. Changing this field forces a new resource to be created.
description str
A description for the Password.
end_date str
The End Date which the Password is valid until, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). Changing this field forces a new resource to be created.
end_date_relative str
A relative duration for which the Password is valid until, for example 240h (10 days) or 2400h30m. Changing this field forces a new resource to be created.
key_id str
A GUID used to uniquely identify this Password. If not specified a GUID will be created. Changing this field forces a new resource to be created.
start_date str
The Start Date which the Password is valid from, formatted as a RFC3339 date string (e.g. 2018-01-01T01:02:03Z). If this isn’t specified, the current date is used. Changing this field forces a new resource to be created.
value str
The Password for this Application.

Import

Passwords can be imported using the object id of an Application and the key id of the password, e.g.

 $ pulumi import azuread:index/applicationPassword:ApplicationPassword test 00000000-0000-0000-0000-000000000000/password/11111111-1111-1111-1111-111111111111

Package Details

Repository
https://github.com/pulumi/pulumi-azuread
License
Apache-2.0
Notes
This Pulumi package is based on the azuread Terraform Provider.