1. Packages
  2. Packages
  3. Azure Native
  4. API Docs
  5. authorization
  6. getRoleAssignment
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Viewing docs for Azure Native v3.25.0
published on Wednesday, Aug 5, 2026 by Pulumi
azure-native logo
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Viewing docs for Azure Native v3.25.0
published on Wednesday, Aug 5, 2026 by Pulumi

    Get a role assignment by scope and name.

    Uses Azure REST API version 2022-04-01.

    Other available API versions: 2020-08-01-preview, 2020-10-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native authorization [ApiVersion]. See the version guide for details.

    Using getRoleAssignment

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getRoleAssignment(args: GetRoleAssignmentArgs, opts?: InvokeOptions): Promise<GetRoleAssignmentResult>
    function getRoleAssignmentOutput(args: GetRoleAssignmentOutputArgs, opts?: InvokeOptions): Output<GetRoleAssignmentResult>
    def get_role_assignment(role_assignment_name: Optional[str] = None,
                            scope: Optional[str] = None,
                            tenant_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetRoleAssignmentResult
    def get_role_assignment_output(role_assignment_name: pulumi.Input[Optional[str]] = None,
                            scope: pulumi.Input[Optional[str]] = None,
                            tenant_id: pulumi.Input[Optional[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetRoleAssignmentResult]
    func LookupRoleAssignment(ctx *Context, args *LookupRoleAssignmentArgs, opts ...InvokeOption) (*LookupRoleAssignmentResult, error)
    func LookupRoleAssignmentOutput(ctx *Context, args *LookupRoleAssignmentOutputArgs, opts ...InvokeOption) LookupRoleAssignmentResultOutput

    > Note: This function is named LookupRoleAssignment in the Go SDK.

    public static class GetRoleAssignment 
    {
        public static Task<GetRoleAssignmentResult> InvokeAsync(GetRoleAssignmentArgs args, InvokeOptions? opts = null)
        public static Output<GetRoleAssignmentResult> Invoke(GetRoleAssignmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRoleAssignmentResult> getRoleAssignment(GetRoleAssignmentArgs args, InvokeOptions options)
    public static Output<GetRoleAssignmentResult> getRoleAssignment(GetRoleAssignmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azure-native:authorization:getRoleAssignment
      arguments:
        # arguments dictionary
    data "azure-native_authorization_get_role_assignment" "name" {
        # arguments
    }

    The following arguments are supported:

    RoleAssignmentName string
    The name of the role assignment. It can be any valid GUID.
    Scope string
    The fully qualified Azure Resource manager identifier of the resource.
    TenantId string
    Tenant ID for cross-tenant request
    RoleAssignmentName string
    The name of the role assignment. It can be any valid GUID.
    Scope string
    The fully qualified Azure Resource manager identifier of the resource.
    TenantId string
    Tenant ID for cross-tenant request
    role_assignment_name string
    The name of the role assignment. It can be any valid GUID.
    scope string
    The fully qualified Azure Resource manager identifier of the resource.
    tenant_id string
    Tenant ID for cross-tenant request
    roleAssignmentName String
    The name of the role assignment. It can be any valid GUID.
    scope String
    The fully qualified Azure Resource manager identifier of the resource.
    tenantId String
    Tenant ID for cross-tenant request
    roleAssignmentName string
    The name of the role assignment. It can be any valid GUID.
    scope string
    The fully qualified Azure Resource manager identifier of the resource.
    tenantId string
    Tenant ID for cross-tenant request
    role_assignment_name str
    The name of the role assignment. It can be any valid GUID.
    scope str
    The fully qualified Azure Resource manager identifier of the resource.
    tenant_id str
    Tenant ID for cross-tenant request
    roleAssignmentName String
    The name of the role assignment. It can be any valid GUID.
    scope String
    The fully qualified Azure Resource manager identifier of the resource.
    tenantId String
    Tenant ID for cross-tenant request

    getRoleAssignment Result

    The following output properties are available:

    AzureApiVersion string
    The Azure API version of the resource.
    CreatedBy string
    Id of the user who created the assignment
    CreatedOn string
    Time it was created
    Id string
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    Name string
    The name of the resource
    PrincipalId string
    The principal ID.
    RoleDefinitionId string
    The role definition ID.
    Scope string
    The role assignment scope.
    SystemData Pulumi.AzureNative.Authorization.Outputs.SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    Type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    UpdatedBy string
    Id of the user who updated the assignment
    UpdatedOn string
    Time it was updated
    Condition string
    The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
    ConditionVersion string
    Version of the condition. Currently the only accepted value is '2.0'
    DelegatedManagedIdentityResourceId string
    Id of the delegated managed identity resource
    Description string
    Description of role assignment
    PrincipalType string
    The principal type of the assigned principal ID.
    AzureApiVersion string
    The Azure API version of the resource.
    CreatedBy string
    Id of the user who created the assignment
    CreatedOn string
    Time it was created
    Id string
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    Name string
    The name of the resource
    PrincipalId string
    The principal ID.
    RoleDefinitionId string
    The role definition ID.
    Scope string
    The role assignment scope.
    SystemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    Type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    UpdatedBy string
    Id of the user who updated the assignment
    UpdatedOn string
    Time it was updated
    Condition string
    The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
    ConditionVersion string
    Version of the condition. Currently the only accepted value is '2.0'
    DelegatedManagedIdentityResourceId string
    Id of the delegated managed identity resource
    Description string
    Description of role assignment
    PrincipalType string
    The principal type of the assigned principal ID.
    azure_api_version string
    The Azure API version of the resource.
    created_by string
    Id of the user who created the assignment
    created_on string
    Time it was created
    id string
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    name string
    The name of the resource
    principal_id string
    The principal ID.
    role_definition_id string
    The role definition ID.
    scope string
    The role assignment scope.
    system_data object
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    updated_by string
    Id of the user who updated the assignment
    updated_on string
    Time it was updated
    condition string
    The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
    condition_version string
    Version of the condition. Currently the only accepted value is '2.0'
    delegated_managed_identity_resource_id string
    Id of the delegated managed identity resource
    description string
    Description of role assignment
    principal_type string
    The principal type of the assigned principal ID.
    azureApiVersion String
    The Azure API version of the resource.
    createdBy String
    Id of the user who created the assignment
    createdOn String
    Time it was created
    id String
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    name String
    The name of the resource
    principalId String
    The principal ID.
    roleDefinitionId String
    The role definition ID.
    scope String
    The role assignment scope.
    systemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type String
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    updatedBy String
    Id of the user who updated the assignment
    updatedOn String
    Time it was updated
    condition String
    The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
    conditionVersion String
    Version of the condition. Currently the only accepted value is '2.0'
    delegatedManagedIdentityResourceId String
    Id of the delegated managed identity resource
    description String
    Description of role assignment
    principalType String
    The principal type of the assigned principal ID.
    azureApiVersion string
    The Azure API version of the resource.
    createdBy string
    Id of the user who created the assignment
    createdOn string
    Time it was created
    id string
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    name string
    The name of the resource
    principalId string
    The principal ID.
    roleDefinitionId string
    The role definition ID.
    scope string
    The role assignment scope.
    systemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    updatedBy string
    Id of the user who updated the assignment
    updatedOn string
    Time it was updated
    condition string
    The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
    conditionVersion string
    Version of the condition. Currently the only accepted value is '2.0'
    delegatedManagedIdentityResourceId string
    Id of the delegated managed identity resource
    description string
    Description of role assignment
    principalType string
    The principal type of the assigned principal ID.
    azure_api_version str
    The Azure API version of the resource.
    created_by str
    Id of the user who created the assignment
    created_on str
    Time it was created
    id str
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    name str
    The name of the resource
    principal_id str
    The principal ID.
    role_definition_id str
    The role definition ID.
    scope str
    The role assignment scope.
    system_data SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type str
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    updated_by str
    Id of the user who updated the assignment
    updated_on str
    Time it was updated
    condition str
    The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
    condition_version str
    Version of the condition. Currently the only accepted value is '2.0'
    delegated_managed_identity_resource_id str
    Id of the delegated managed identity resource
    description str
    Description of role assignment
    principal_type str
    The principal type of the assigned principal ID.
    azureApiVersion String
    The Azure API version of the resource.
    createdBy String
    Id of the user who created the assignment
    createdOn String
    Time it was created
    id String
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    name String
    The name of the resource
    principalId String
    The principal ID.
    roleDefinitionId String
    The role definition ID.
    scope String
    The role assignment scope.
    systemData Property Map
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type String
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    updatedBy String
    Id of the user who updated the assignment
    updatedOn String
    Time it was updated
    condition String
    The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
    conditionVersion String
    Version of the condition. Currently the only accepted value is '2.0'
    delegatedManagedIdentityResourceId String
    Id of the delegated managed identity resource
    description String
    Description of role assignment
    principalType String
    The principal type of the assigned principal ID.

    Supporting Types

    SystemDataResponse

    CreatedAt string
    The timestamp of resource creation (UTC).
    CreatedBy string
    The identity that created the resource.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource last modification (UTC)
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    The type of identity that last modified the resource.
    CreatedAt string
    The timestamp of resource creation (UTC).
    CreatedBy string
    The identity that created the resource.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource last modification (UTC)
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    The type of identity that last modified the resource.
    created_at string
    The timestamp of resource creation (UTC).
    created_by string
    The identity that created the resource.
    created_by_type string
    The type of identity that created the resource.
    last_modified_at string
    The timestamp of resource last modification (UTC)
    last_modified_by string
    The identity that last modified the resource.
    last_modified_by_type string
    The type of identity that last modified the resource.
    createdAt String
    The timestamp of resource creation (UTC).
    createdBy String
    The identity that created the resource.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource last modification (UTC)
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    The type of identity that last modified the resource.
    createdAt string
    The timestamp of resource creation (UTC).
    createdBy string
    The identity that created the resource.
    createdByType string
    The type of identity that created the resource.
    lastModifiedAt string
    The timestamp of resource last modification (UTC)
    lastModifiedBy string
    The identity that last modified the resource.
    lastModifiedByType string
    The type of identity that last modified the resource.
    created_at str
    The timestamp of resource creation (UTC).
    created_by str
    The identity that created the resource.
    created_by_type str
    The type of identity that created the resource.
    last_modified_at str
    The timestamp of resource last modification (UTC)
    last_modified_by str
    The identity that last modified the resource.
    last_modified_by_type str
    The type of identity that last modified the resource.
    createdAt String
    The timestamp of resource creation (UTC).
    createdBy String
    The identity that created the resource.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource last modification (UTC)
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    The type of identity that last modified the resource.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
    Viewing docs for Azure Native v3.25.0
    published on Wednesday, Aug 5, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial