1. Packages
  2. Azure Classic
  3. API Docs
  4. authorization
  5. UserAssignedIdentity

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Manages a user assigned identity.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
            {
                Location = "West Europe",
            });
            var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new Azure.Authorization.UserAssignedIdentityArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                Location = exampleResourceGroup.Location,
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/authorization"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{
    			ResourceGroupName: exampleResourceGroup.Name,
    			Location:          exampleResourceGroup.Location,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
    const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", {
        resourceGroupName: exampleResourceGroup.name,
        location: exampleResourceGroup.location,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
    example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity",
        resource_group_name=example_resource_group.name,
        location=example_resource_group.location)
    

    Example coming soon!

    Create UserAssignedIdentity Resource

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

    Constructor syntax

    new UserAssignedIdentity(name: string, args: UserAssignedIdentityArgs, opts?: CustomResourceOptions);
    @overload
    def UserAssignedIdentity(resource_name: str,
                             args: UserAssignedIdentityArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserAssignedIdentity(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             resource_group_name: Optional[str] = None,
                             location: Optional[str] = None,
                             name: Optional[str] = None,
                             tags: Optional[Mapping[str, str]] = None)
    func NewUserAssignedIdentity(ctx *Context, name string, args UserAssignedIdentityArgs, opts ...ResourceOption) (*UserAssignedIdentity, error)
    public UserAssignedIdentity(string name, UserAssignedIdentityArgs args, CustomResourceOptions? opts = null)
    public UserAssignedIdentity(String name, UserAssignedIdentityArgs args)
    public UserAssignedIdentity(String name, UserAssignedIdentityArgs args, CustomResourceOptions options)
    
    type: azure:authorization:UserAssignedIdentity
    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 UserAssignedIdentityArgs
    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 UserAssignedIdentityArgs
    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 UserAssignedIdentityArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserAssignedIdentityArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserAssignedIdentityArgs
    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 userAssignedIdentityResource = new Azure.Authorization.UserAssignedIdentity("userAssignedIdentityResource", new()
    {
        ResourceGroupName = "string",
        Location = "string",
        Name = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := authorization.NewUserAssignedIdentity(ctx, "userAssignedIdentityResource", &authorization.UserAssignedIdentityArgs{
    	ResourceGroupName: pulumi.String("string"),
    	Location:          pulumi.String("string"),
    	Name:              pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var userAssignedIdentityResource = new UserAssignedIdentity("userAssignedIdentityResource", UserAssignedIdentityArgs.builder()
        .resourceGroupName("string")
        .location("string")
        .name("string")
        .tags(Map.of("string", "string"))
        .build());
    
    user_assigned_identity_resource = azure.authorization.UserAssignedIdentity("userAssignedIdentityResource",
        resource_group_name="string",
        location="string",
        name="string",
        tags={
            "string": "string",
        })
    
    const userAssignedIdentityResource = new azure.authorization.UserAssignedIdentity("userAssignedIdentityResource", {
        resourceGroupName: "string",
        location: "string",
        name: "string",
        tags: {
            string: "string",
        },
    });
    
    type: azure:authorization:UserAssignedIdentity
    properties:
        location: string
        name: string
        resourceGroupName: string
        tags:
            string: string
    

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

    ResourceGroupName string
    The name of the resource group in which to create the user assigned identity.
    Location string
    The location/region where the user assigned identity is created.
    Name string
    The name of the user assigned identity. Changing this forces a new identity to be created.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    ResourceGroupName string
    The name of the resource group in which to create the user assigned identity.
    Location string
    The location/region where the user assigned identity is created.
    Name string
    The name of the user assigned identity. Changing this forces a new identity to be created.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    resourceGroupName String
    The name of the resource group in which to create the user assigned identity.
    location String
    The location/region where the user assigned identity is created.
    name String
    The name of the user assigned identity. Changing this forces a new identity to be created.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    resourceGroupName string
    The name of the resource group in which to create the user assigned identity.
    location string
    The location/region where the user assigned identity is created.
    name string
    The name of the user assigned identity. Changing this forces a new identity to be created.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    resource_group_name str
    The name of the resource group in which to create the user assigned identity.
    location str
    The location/region where the user assigned identity is created.
    name str
    The name of the user assigned identity. Changing this forces a new identity to be created.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    resourceGroupName String
    The name of the resource group in which to create the user assigned identity.
    location String
    The location/region where the user assigned identity is created.
    name String
    The name of the user assigned identity. Changing this forces a new identity to be created.
    tags Map<String>
    A mapping of tags to assign to the resource.

    Outputs

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

    ClientId string
    Client ID associated with the user assigned identity.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrincipalId string
    Service Principal ID associated with the user assigned identity.
    TenantId string
    Tenant ID associated with the user assigned identity.
    ClientId string
    Client ID associated with the user assigned identity.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrincipalId string
    Service Principal ID associated with the user assigned identity.
    TenantId string
    Tenant ID associated with the user assigned identity.
    clientId String
    Client ID associated with the user assigned identity.
    id String
    The provider-assigned unique ID for this managed resource.
    principalId String
    Service Principal ID associated with the user assigned identity.
    tenantId String
    Tenant ID associated with the user assigned identity.
    clientId string
    Client ID associated with the user assigned identity.
    id string
    The provider-assigned unique ID for this managed resource.
    principalId string
    Service Principal ID associated with the user assigned identity.
    tenantId string
    Tenant ID associated with the user assigned identity.
    client_id str
    Client ID associated with the user assigned identity.
    id str
    The provider-assigned unique ID for this managed resource.
    principal_id str
    Service Principal ID associated with the user assigned identity.
    tenant_id str
    Tenant ID associated with the user assigned identity.
    clientId String
    Client ID associated with the user assigned identity.
    id String
    The provider-assigned unique ID for this managed resource.
    principalId String
    Service Principal ID associated with the user assigned identity.
    tenantId String
    Tenant ID associated with the user assigned identity.

    Look up Existing UserAssignedIdentity Resource

    Get an existing UserAssignedIdentity 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?: UserAssignedIdentityState, opts?: CustomResourceOptions): UserAssignedIdentity
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            client_id: Optional[str] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            principal_id: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tenant_id: Optional[str] = None) -> UserAssignedIdentity
    func GetUserAssignedIdentity(ctx *Context, name string, id IDInput, state *UserAssignedIdentityState, opts ...ResourceOption) (*UserAssignedIdentity, error)
    public static UserAssignedIdentity Get(string name, Input<string> id, UserAssignedIdentityState? state, CustomResourceOptions? opts = null)
    public static UserAssignedIdentity get(String name, Output<String> id, UserAssignedIdentityState state, CustomResourceOptions options)
    resources:  _:    type: azure:authorization:UserAssignedIdentity    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.
    The following state arguments are supported:
    ClientId string
    Client ID associated with the user assigned identity.
    Location string
    The location/region where the user assigned identity is created.
    Name string
    The name of the user assigned identity. Changing this forces a new identity to be created.
    PrincipalId string
    Service Principal ID associated with the user assigned identity.
    ResourceGroupName string
    The name of the resource group in which to create the user assigned identity.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    TenantId string
    Tenant ID associated with the user assigned identity.
    ClientId string
    Client ID associated with the user assigned identity.
    Location string
    The location/region where the user assigned identity is created.
    Name string
    The name of the user assigned identity. Changing this forces a new identity to be created.
    PrincipalId string
    Service Principal ID associated with the user assigned identity.
    ResourceGroupName string
    The name of the resource group in which to create the user assigned identity.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    TenantId string
    Tenant ID associated with the user assigned identity.
    clientId String
    Client ID associated with the user assigned identity.
    location String
    The location/region where the user assigned identity is created.
    name String
    The name of the user assigned identity. Changing this forces a new identity to be created.
    principalId String
    Service Principal ID associated with the user assigned identity.
    resourceGroupName String
    The name of the resource group in which to create the user assigned identity.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    tenantId String
    Tenant ID associated with the user assigned identity.
    clientId string
    Client ID associated with the user assigned identity.
    location string
    The location/region where the user assigned identity is created.
    name string
    The name of the user assigned identity. Changing this forces a new identity to be created.
    principalId string
    Service Principal ID associated with the user assigned identity.
    resourceGroupName string
    The name of the resource group in which to create the user assigned identity.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    tenantId string
    Tenant ID associated with the user assigned identity.
    client_id str
    Client ID associated with the user assigned identity.
    location str
    The location/region where the user assigned identity is created.
    name str
    The name of the user assigned identity. Changing this forces a new identity to be created.
    principal_id str
    Service Principal ID associated with the user assigned identity.
    resource_group_name str
    The name of the resource group in which to create the user assigned identity.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    tenant_id str
    Tenant ID associated with the user assigned identity.
    clientId String
    Client ID associated with the user assigned identity.
    location String
    The location/region where the user assigned identity is created.
    name String
    The name of the user assigned identity. Changing this forces a new identity to be created.
    principalId String
    Service Principal ID associated with the user assigned identity.
    resourceGroupName String
    The name of the resource group in which to create the user assigned identity.
    tags Map<String>
    A mapping of tags to assign to the resource.
    tenantId String
    Tenant ID associated with the user assigned identity.

    Import

    User Assigned Identities can be imported using the resource id, e.g.

     $ pulumi import azure:authorization/userAssignedIdentity:UserAssignedIdentity exampleIdentity /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acceptanceTestResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testIdentity
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.