Skip to content

AzureRoleAssignmentScheduleRequest

Parameters

Parameter Attribute DataType Description Allowed Values
Principal Key String User Principal Name of the Azure role assignment request.
RoleDefinition Key String Azure role associated with the assignment request (e.g., 'Owner', 'Contributor').
PrincipalType Write String Represented the type of principal to assign the request to. Accepted values are: Group, User and ServicePrincipal. Group, User, ServicePrincipal
DirectoryScopeId Key String Identifier of the scope representing the Azure resource (e.g., /subscriptions/{id}, /providers/Microsoft.Management/managementGroups/{id}). The scope determines the set of Azure resources for which the principal has been granted access.
Id Write String Identifier for the Role Assignment Schedule Request.
AppScopeId Write String Identifier of the app-specific scope when the role assignment is scoped to an app. Not commonly used for Azure RBAC roles.
Justification Write String A message provided by users and administrators when they create the role assignment schedule request.
ScheduleInfo Write MSFT_AzureRoleAssignmentScheduleRequestSchedule The period of the role assignment. The period of assignment is dependent on the settings of the Azure role.
Ensure Write String Present ensures the instance exists, absent ensures it is removed. Present, Absent
Credential Write PSCredential Credentials of the workload's Admin
ApplicationId Write String Id of the Azure Active Directory application to authenticate with.
TenantId Write String Id of the Azure Active Directory tenant used for authentication.
ApplicationSecret Write PSCredential Secret of the Azure Active Directory application to authenticate with.
CertificateThumbprint Write String Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.
ManagedIdentity Write Boolean Managed ID being used for authentication.
AccessTokens Write StringArray[] Access token used for authentication.

Embedded Instances

MSFT_AzureRoleAssignmentScheduleRequestScheduleRecurrenceRange

Parameters

Parameter Attribute DataType Description Allowed Values
endDate Required String The date to stop applying the recurrence pattern. Depending on the recurrence pattern of the event, the last occurrence of the meeting may not be this date.
numberOfOccurrences Write UInt32 The number of times to repeat the event. Required and must be positive if type is numbered.
recurrenceTimeZone Write String Time zone for the startDate and endDate properties.
startDate Required String The date to start applying the recurrence pattern. The first occurrence of the meeting may be this date or later, depending on the recurrence pattern of the event. Must be the same value as the start property of the recurring event.
type Required String The recurrence range. The possible values are: endDate, noEnd, numbered. endDate, noEnd, numbered

MSFT_AzureRoleAssignmentScheduleRequestScheduleRecurrencePattern

Parameters

Parameter Attribute DataType Description Allowed Values
dayOfMonth Write UInt32 The day of the month on which the event occurs.
daysOfWeek Write StringArray[] A collection of the days of the week on which the event occurs. The possible values are: sunday, monday, tuesday, wednesday, thursday, friday, saturday sunday, monday, tuesday, wednesday, thursday, friday, saturday
firstDayOfWeek Write String The first day of the week. sunday, monday, tuesday, wednesday, thursday, friday, saturday
index Write String Specifies on which instance of the allowed days specified in daysOfWeek the event occurs, counted from the first instance in the month. The possible values are: first, second, third, fourth, last. first, second, third, fourth, last
interval Write UInt32 The number of units between occurrences, where units can be in days, weeks, months, or years, depending on the type.
month Write UInt32 The month in which the event occurs. This is a number from 1 to 12.
type Write String The recurrence pattern type: daily, weekly, absoluteMonthly, relativeMonthly, absoluteYearly, relativeYearly. daily, weekly, absoluteMonthly, relativeMonthly, absoluteYearly, relativeYearly

MSFT_AzureRoleAssignmentScheduleRequestScheduleRecurrence

Parameters

Parameter Attribute DataType Description Allowed Values
pattern Write MSFT_AzureRoleAssignmentScheduleRequestScheduleRecurrencePattern The frequency of an event.
range Write MSFT_AzureRoleAssignmentScheduleRequestScheduleRecurrenceRange The duration of an event.

MSFT_AzureRoleAssignmentScheduleRequestScheduleExpiration

Parameters

Parameter Attribute DataType Description Allowed Values
duration Write String The requestor's desired duration of access represented in ISO 8601 format for durations. For example, PT3H refers to three hours. If specified in a request, endDateTime should not be present and the type property should be set to afterDuration.
endDateTime Write String Timestamp of date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.
type Write String The requestor's desired expiration pattern type. The possible values are: notSpecified, noExpiration, afterDateTime, afterDuration. notSpecified, noExpiration, afterDateTime, afterDuration

MSFT_AzureRoleAssignmentScheduleRequestSchedule

Parameters

Parameter Attribute DataType Description Allowed Values
expiration Write MSFT_AzureRoleAssignmentScheduleRequestScheduleExpiration When the eligible or active assignment expires.
recurrence Write MSFT_AzureRoleAssignmentScheduleRequestScheduleRecurrence The frequency of the eligible or active assignment. This property is currently unsupported in PIM.
startDateTime Write String When the eligible or active assignment becomes active.

Description

This resource manages Azure PIM (Privileged Identity Management) role assignment schedule requests for Azure RBAC roles. It supports role assignments at all scope levels including subscription, management group, resource group, and resource-specific scopes.

Key Differences from AADRoleAssignmentScheduleRequest

  • AADRoleAssignmentScheduleRequest: Manages Entra ID (Azure AD) directory roles via Microsoft Graph API
  • AzureRoleAssignmentScheduleRequest: Manages Azure RBAC roles via Azure Resource Manager API

Key Differences from AzureRoleEligibilityScheduleRequest

  • AzureRoleEligibilityScheduleRequest: Manages role eligibility (makes principal eligible to activate the role via PIM)
  • AzureRoleAssignmentScheduleRequest: Manages active role assignments (principal has the role actively assigned)

Supported Scope Levels

Subscription Scope

Format: /subscriptions/{subscriptionId}

Example: Assign "Owner" role on subscription

Management Group Scope

Format: /providers/Microsoft.Management/managementGroups/{managementGroupId}

Example: Assign "Reader" role on management group

Resource Group Scope

Format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}

Example: Assign "Contributor" role on resource group

Resource Scope

Format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

Example: Assign "Key Vault Administrator" role on specific key vault

Azure Government Cloud Support

This resource automatically detects the tenant region and uses the appropriate Azure Management endpoint:

  • Global Azure: https://management.azure.com
  • Azure US Government: https://management.usgovcloudapi.net
  • Azure US Government DoD: https://management.usgovcloudapi.net

Required Permissions

To manage Azure PIM role assignment schedules, you need one of the following:

  • Privileged Role Administrator role in Azure AD
  • Owner or User Access Administrator role at the appropriate Azure scope
  • Custom role with permissions:
  • Microsoft.Authorization/roleAssignmentScheduleRequests/write
  • Microsoft.Authorization/roleAssignmentSchedules/read
  • Microsoft.Authorization/roleDefinitions/read

Known Limitations

  • The resource creates new schedule requests rather than directly modifying existing schedules
  • Schedule changes may take a few minutes to propagate
  • Some built-in roles may have restrictions on assignments
  • Management group scope requires appropriate permissions at the management group level

Examples

See the Examples folder for comprehensive usage scenarios.

Permissions

Examples

Example 1

This example creates a new Azure PIM role assignment schedule at subscription level.

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $Credential
    )

    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        AzureRoleAssignmentScheduleRequest "SubscriptionOwnerAssignment"
        {
            Principal             = "AdeleV@contoso.onmicrosoft.com"
            RoleDefinition        = "Owner"
            DirectoryScopeId      = "/subscriptions/12345678-1234-1234-1234-123456789012"
            PrincipalType         = "User"
            Ensure                = "Present"
            ScheduleInfo          = MSFT_AzureRoleAssignmentScheduleRequestSchedule {
                startDateTime = '2024-01-15T08:00:00Z'
                expiration    = MSFT_AzureRoleAssignmentScheduleRequestScheduleExpiration
                {
                    type        = 'afterDateTime'
                    endDateTime = '2025-12-31T23:59:59Z'
                }
            }
            ApplicationId         = $ApplicationId
            TenantId              = $TenantId
            CertificateThumbprint = $CertificateThumbprint
        }
    }
}

Example 2

This example updates an existing Azure PIM role assignment schedule.

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $Credential
    )

    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        AzureRoleAssignmentScheduleRequest "ResourceGroupContributorAssignment"
        {
            Principal             = "SecurityGroup@contoso.onmicrosoft.com"
            RoleDefinition        = "Contributor"
            DirectoryScopeId      = "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg-production"
            PrincipalType         = "Group"
            Ensure                = "Present"
            ScheduleInfo          = MSFT_AzureRoleAssignmentScheduleRequestSchedule {
                startDateTime = '2024-01-01T00:00:00Z'
                expiration    = MSFT_AzureRoleAssignmentScheduleRequestScheduleExpiration
                {
                    type        = 'noExpiration'
                }
            }
            ApplicationId         = $ApplicationId
            TenantId              = $TenantId
            CertificateThumbprint = $CertificateThumbprint
        }
    }
}

Example 3

This example removes an Azure PIM role assignment schedule.

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $Credential
    )

    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        AzureRoleAssignmentScheduleRequest "RemoveAssignment"
        {
            Principal             = "AdeleV@contoso.onmicrosoft.com"
            RoleDefinition        = "Owner"
            DirectoryScopeId      = "/subscriptions/12345678-1234-1234-1234-123456789012"
            PrincipalType         = "User"
            Ensure                = "Absent"
            ApplicationId         = $ApplicationId
            TenantId              = $TenantId
            CertificateThumbprint = $CertificateThumbprint
        }
    }
}

Example 4

This example creates an Azure PIM role assignment schedule at management group level.

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $Credential
    )

    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        AzureRoleAssignmentScheduleRequest "ManagementGroupReaderAssignment"
        {
            Principal             = "AdeleV@contoso.onmicrosoft.com"
            RoleDefinition        = "Reader"
            DirectoryScopeId      = "/providers/Microsoft.Management/managementGroups/MyManagementGroup"
            PrincipalType         = "User"
            Ensure                = "Present"
            ScheduleInfo          = MSFT_AzureRoleAssignmentScheduleRequestSchedule {
                startDateTime = '2024-01-15T08:00:00Z'
                expiration    = MSFT_AzureRoleAssignmentScheduleRequestScheduleExpiration
                {
                    type        = 'afterDateTime'
                    endDateTime = '2025-12-31T23:59:59Z'
                }
            }
            ApplicationId         = $ApplicationId
            TenantId              = $TenantId
            CertificateThumbprint = $CertificateThumbprint
        }
    }
}

Example 5

This example creates an Azure PIM role assignment schedule at the root management group level.

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $Credential
    )

    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        AzureRoleAssignmentScheduleRequest "RootManagementGroupOwnerAssignment"
        {
            Principal             = "AdeleV@contoso.onmicrosoft.com"
            RoleDefinition        = "Owner"
            DirectoryScopeId      = "/providers/Microsoft.Management/managementGroups/rootGroup"
            PrincipalType         = "User"
            Ensure                = "Present"
            ScheduleInfo          = MSFT_AzureRoleAssignmentScheduleRequestSchedule {
                startDateTime = '2024-01-15T08:00:00Z'
                expiration    = MSFT_AzureRoleAssignmentScheduleRequestScheduleExpiration
                {
                    type        = 'noExpiration'
                }
            }
            ApplicationId         = $ApplicationId
            TenantId              = $TenantId
            CertificateThumbprint = $CertificateThumbprint
        }
    }
}