1. Registry
  2. Packages
  3. Azure Active Directory (Azure AD)
  4. API Docs
  5. UserLicense
Viewing docs for Azure Active Directory (Azure AD) v6.11.1
published on Tuesday, Oct 13, 2026 by Pulumi
azuread logo
Viewing docs for Azure Active Directory (Azure AD) v6.11.1
published on Tuesday, Oct 13, 2026 by Pulumi

    Manages a single license assignment for a user.

    License availability The SKU being assigned must be available in your tenant. You can find the available SKUs and their service plans in the Microsoft 365 admin center, or by inspecting the subscribedSkus in Microsoft Graph.

    Usage location required Microsoft Graph rejects license assignment for users that do not have a usage location set, due to legal requirements to check for the availability of services in a given country. Ensure usageLocation is set on the azuread.User resource (or the user object) before assigning licenses.

    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.ReadWrite.All or Directory.ReadWrite.All

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuread from "@pulumi/azuread";
    
    const example = new azuread.User("example", {
        userPrincipalName: "jane.fischer@example.com",
        displayName: "Jane Fischer",
        password: "Ch@ngeMe",
        usageLocation: "US",
    });
    const exampleUserLicense = new azuread.UserLicense("example", {
        userObjectId: example.objectId,
        skuId: "c7df2760-2c81-4ef7-b578-5b5392b571df",
    });
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.User("example",
        user_principal_name="jane.fischer@example.com",
        display_name="Jane Fischer",
        password="Ch@ngeMe",
        usage_location="US")
    example_user_license = azuread.UserLicense("example",
        user_object_id=example.object_id,
        sku_id="c7df2760-2c81-4ef7-b578-5b5392b571df")
    
    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.NewUser(ctx, "example", &azuread.UserArgs{
    			UserPrincipalName: pulumi.String("jane.fischer@example.com"),
    			DisplayName:       pulumi.String("Jane Fischer"),
    			Password:          pulumi.String("Ch@ngeMe"),
    			UsageLocation:     pulumi.String("US"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = azuread.NewUserLicense(ctx, "example", &azuread.UserLicenseArgs{
    			UserObjectId: example.ObjectId,
    			SkuId:        pulumi.String("c7df2760-2c81-4ef7-b578-5b5392b571df"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureAD = Pulumi.AzureAD;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureAD.User("example", new()
        {
            UserPrincipalName = "jane.fischer@example.com",
            DisplayName = "Jane Fischer",
            Password = "Ch@ngeMe",
            UsageLocation = "US",
        });
    
        var exampleUserLicense = new AzureAD.UserLicense("example", new()
        {
            UserObjectId = example.ObjectId,
            SkuId = "c7df2760-2c81-4ef7-b578-5b5392b571df",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuread.User;
    import com.pulumi.azuread.UserArgs;
    import com.pulumi.azuread.UserLicense;
    import com.pulumi.azuread.UserLicenseArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 User("example", UserArgs.builder()
                .userPrincipalName("jane.fischer@example.com")
                .displayName("Jane Fischer")
                .password("Ch@ngeMe")
                .usageLocation("US")
                .build());
    
            var exampleUserLicense = new UserLicense("exampleUserLicense", UserLicenseArgs.builder()
                .userObjectId(example.objectId())
                .skuId("c7df2760-2c81-4ef7-b578-5b5392b571df")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azuread:User
        properties:
          userPrincipalName: jane.fischer@example.com
          displayName: Jane Fischer
          password: Ch@ngeMe
          usageLocation: US
      exampleUserLicense:
        type: azuread:UserLicense
        name: example
        properties:
          userObjectId: ${example.objectId}
          skuId: c7df2760-2c81-4ef7-b578-5b5392b571df
    
    terraform {
      required_providers {
        azuread = {
          source = "pulumi/azuread"
        }
      }
    }
    
    resource "azuread_user" "example" {
      lifecycle {
        create_before_destroy = true
      }
      user_principal_name = "jane.fischer@example.com"
      display_name        = "Jane Fischer"
      password            = "Ch@ngeMe"
      usage_location      = "US"
    }
    resource "azuread_user_license" "example" {
      lifecycle {
        create_before_destroy = true
      }
      user_object_id = azuread_user.example.object_id
      sku_id         = "c7df2760-2c81-4ef7-b578-5b5392b571df"
    }
    

    Disabling specific service plans

    import * as pulumi from "@pulumi/pulumi";
    import * as azuread from "@pulumi/azuread";
    
    const example = new azuread.UserLicense("example", {
        userObjectId: exampleAzureadUser.objectId,
        skuId: "c7df2760-2c81-4ef7-b578-5b5392b571df",
        disabledPlans: ["a23b959c-7ce8-4e57-9140-b90eb88a9e97"],
    });
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.UserLicense("example",
        user_object_id=example_azuread_user["objectId"],
        sku_id="c7df2760-2c81-4ef7-b578-5b5392b571df",
        disabled_plans=["a23b959c-7ce8-4e57-9140-b90eb88a9e97"])
    
    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 {
    		_, err := azuread.NewUserLicense(ctx, "example", &azuread.UserLicenseArgs{
    			UserObjectId: pulumi.Any(exampleAzureadUser.ObjectId),
    			SkuId:        pulumi.String("c7df2760-2c81-4ef7-b578-5b5392b571df"),
    			DisabledPlans: pulumi.StringArray{
    				pulumi.String("a23b959c-7ce8-4e57-9140-b90eb88a9e97"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureAD = Pulumi.AzureAD;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureAD.UserLicense("example", new()
        {
            UserObjectId = exampleAzureadUser.ObjectId,
            SkuId = "c7df2760-2c81-4ef7-b578-5b5392b571df",
            DisabledPlans = new[]
            {
                "a23b959c-7ce8-4e57-9140-b90eb88a9e97",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuread.UserLicense;
    import com.pulumi.azuread.UserLicenseArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 UserLicense("example", UserLicenseArgs.builder()
                .userObjectId(exampleAzureadUser.get("objectId"))
                .skuId("c7df2760-2c81-4ef7-b578-5b5392b571df")
                .disabledPlans("a23b959c-7ce8-4e57-9140-b90eb88a9e97")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azuread:UserLicense
        properties:
          userObjectId: ${exampleAzureadUser.objectId}
          skuId: c7df2760-2c81-4ef7-b578-5b5392b571df
          disabledPlans:
            - a23b959c-7ce8-4e57-9140-b90eb88a9e97
    
    terraform {
      required_providers {
        azuread = {
          source = "pulumi/azuread"
        }
      }
    }
    
    resource "azuread_user_license" "example" {
      lifecycle {
        create_before_destroy = true
      }
      user_object_id = exampleAzureadUser.objectId
      sku_id         = "c7df2760-2c81-4ef7-b578-5b5392b571df"
      disabled_plans = ["a23b959c-7ce8-4e57-9140-b90eb88a9e97"]
    }
    

    Tip For assigning more licenses to a user, create additional instances of this resource.

    Create UserLicense Resource

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

    Constructor syntax

    new UserLicense(name: string, args: UserLicenseArgs, opts?: CustomResourceOptions);
    @overload
    def UserLicense(resource_name: str,
                    args: UserLicenseArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserLicense(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    sku_id: Optional[str] = None,
                    user_object_id: Optional[str] = None,
                    disabled_plans: Optional[Sequence[str]] = None)
    func NewUserLicense(ctx *Context, name string, args UserLicenseArgs, opts ...ResourceOption) (*UserLicense, error)
    public UserLicense(string name, UserLicenseArgs args, CustomResourceOptions? opts = null)
    public UserLicense(String name, UserLicenseArgs args)
    public UserLicense(String name, UserLicenseArgs args, CustomResourceOptions options)
    
    type: azuread:UserLicense
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "azuread_user_license" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args UserLicenseArgs
    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 UserLicenseArgs
    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 UserLicenseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserLicenseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserLicenseArgs
    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 userLicenseResource = new AzureAD.UserLicense("userLicenseResource", new()
    {
        SkuId = "string",
        UserObjectId = "string",
        DisabledPlans = new[]
        {
            "string",
        },
    });
    
    example, err := azuread.NewUserLicense(ctx, "userLicenseResource", &azuread.UserLicenseArgs{
    	SkuId:        pulumi.String("string"),
    	UserObjectId: pulumi.String("string"),
    	DisabledPlans: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    resource "azuread_user_license" "userLicenseResource" {
      lifecycle {
        create_before_destroy = true
      }
      sku_id         = "string"
      user_object_id = "string"
      disabled_plans = ["string"]
    }
    
    var userLicenseResource = new UserLicense("userLicenseResource", UserLicenseArgs.builder()
        .skuId("string")
        .userObjectId("string")
        .disabledPlans("string")
        .build());
    
    user_license_resource = azuread.UserLicense("userLicenseResource",
        sku_id="string",
        user_object_id="string",
        disabled_plans=["string"])
    
    const userLicenseResource = new azuread.UserLicense("userLicenseResource", {
        skuId: "string",
        userObjectId: "string",
        disabledPlans: ["string"],
    });
    
    type: azuread:UserLicense
    properties:
        disabledPlans:
            - string
        skuId: string
        userObjectId: string
    

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

    SkuId string
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    UserObjectId string

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    DisabledPlans List<string>
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    SkuId string
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    UserObjectId string

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    DisabledPlans []string
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    sku_id string
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    user_object_id string

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    disabled_plans list(string)
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    skuId String
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    userObjectId String

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    disabledPlans List<String>
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    skuId string
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    userObjectId string

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    disabledPlans string[]
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    sku_id str
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    user_object_id str

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    disabled_plans Sequence[str]
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    skuId String
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    userObjectId String

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    disabledPlans List<String>
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the UserLicense 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 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.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing UserLicense Resource

    Get an existing UserLicense 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?: UserLicenseState, opts?: CustomResourceOptions): UserLicense
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            disabled_plans: Optional[Sequence[str]] = None,
            sku_id: Optional[str] = None,
            user_object_id: Optional[str] = None) -> UserLicense
    func GetUserLicense(ctx *Context, name string, id IDInput, state *UserLicenseState, opts ...ResourceOption) (*UserLicense, error)
    public static UserLicense Get(string name, Input<string> id, UserLicenseState? state, CustomResourceOptions? opts = null)
    public static UserLicense get(String name, Output<String> id, UserLicenseState state, CustomResourceOptions options)
    resources:  _:    type: azuread:UserLicense    get:      id: ${id}
    import {
      to = azuread_user_license.example
      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:
    DisabledPlans List<string>
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    SkuId string
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    UserObjectId string

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    DisabledPlans []string
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    SkuId string
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    UserObjectId string

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    disabled_plans list(string)
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    sku_id string
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    user_object_id string

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    disabledPlans List<String>
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    skuId String
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    userObjectId String

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    disabledPlans string[]
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    skuId string
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    userObjectId string

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    disabled_plans Sequence[str]
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    sku_id str
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    user_object_id str

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    disabledPlans List<String>
    A set of unique identifiers (GUIDs) for the service plans to disable for this license. Changing this forces a new resource to be created.
    skuId String
    The unique identifier (GUID) for the SKU (license) to assign to the user. Changing this forces a new resource to be created.
    userObjectId String

    The object ID of the user to which the license should be assigned. Changing this forces a new resource to be created.

    Group-based licensing This resource only manages licenses assigned directly to a user. Licenses inherited via group-based licensing are ignored and are not managed by this resource.

    Import

    User Licenses can be imported using the object ID of the user and the SKU ID of the license, in the following format.

    $ pulumi import azuread:index/userLicense:UserLicense example 00000000-0000-0000-0000-000000000000/license/11111111-1111-1111-1111-111111111111
    

    This ID format is unique to Terraform and is composed of the Azure AD User Object ID and the license SKU ID in the format {UserObjectID}/license/{SkuID}.

    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
    Viewing docs for Azure Active Directory (Azure AD) v6.11.1
    published on Tuesday, Oct 13, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial