1. Packages
  2. Azure Classic
  3. API Docs
  4. managedredis
  5. getAccessPolicyAssignment

We recommend using Azure Native.

Viewing docs for Azure v6.33.0
published on Monday, Feb 23, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v6.33.0
published on Monday, Feb 23, 2026 by Pulumi

    Use this data source to access information about an existing Managed Redis Access Policy Assignment.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.managedredis.getAccessPolicyAssignment({
        objectId: "00000000-0000-0000-0000-000000000000",
        managedRedisName: "example-managedredis",
        resourceGroupName: "example-resources",
    });
    export const objectId = example.then(example => example.objectId);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.managedredis.get_access_policy_assignment(object_id="00000000-0000-0000-0000-000000000000",
        managed_redis_name="example-managedredis",
        resource_group_name="example-resources")
    pulumi.export("objectId", example.object_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/managedredis"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := managedredis.LookupAccessPolicyAssignment(ctx, &managedredis.LookupAccessPolicyAssignmentArgs{
    			ObjectId:          "00000000-0000-0000-0000-000000000000",
    			ManagedRedisName:  "example-managedredis",
    			ResourceGroupName: "example-resources",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("objectId", example.ObjectId)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.ManagedRedis.GetAccessPolicyAssignment.Invoke(new()
        {
            ObjectId = "00000000-0000-0000-0000-000000000000",
            ManagedRedisName = "example-managedredis",
            ResourceGroupName = "example-resources",
        });
    
        return new Dictionary<string, object?>
        {
            ["objectId"] = example.Apply(getAccessPolicyAssignmentResult => getAccessPolicyAssignmentResult.ObjectId),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.managedredis.ManagedredisFunctions;
    import com.pulumi.azure.managedredis.inputs.GetAccessPolicyAssignmentArgs;
    import java.util.List;
    import java.util.ArrayList;
    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) {
            final var example = ManagedredisFunctions.getAccessPolicyAssignment(GetAccessPolicyAssignmentArgs.builder()
                .objectId("00000000-0000-0000-0000-000000000000")
                .managedRedisName("example-managedredis")
                .resourceGroupName("example-resources")
                .build());
    
            ctx.export("objectId", example.objectId());
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: azure:managedredis:getAccessPolicyAssignment
          arguments:
            objectId: 00000000-0000-0000-0000-000000000000
            managedRedisName: example-managedredis
            resourceGroupName: example-resources
    outputs:
      objectId: ${example.objectId}
    

    API Providers

    This data source uses the following Azure API Providers:

    • Microsoft.Cache - 2025-07-01

    Using getAccessPolicyAssignment

    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 getAccessPolicyAssignment(args: GetAccessPolicyAssignmentArgs, opts?: InvokeOptions): Promise<GetAccessPolicyAssignmentResult>
    function getAccessPolicyAssignmentOutput(args: GetAccessPolicyAssignmentOutputArgs, opts?: InvokeOptions): Output<GetAccessPolicyAssignmentResult>
    def get_access_policy_assignment(managed_redis_name: Optional[str] = None,
                                     object_id: Optional[str] = None,
                                     resource_group_name: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetAccessPolicyAssignmentResult
    def get_access_policy_assignment_output(managed_redis_name: Optional[pulumi.Input[str]] = None,
                                     object_id: Optional[pulumi.Input[str]] = None,
                                     resource_group_name: Optional[pulumi.Input[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetAccessPolicyAssignmentResult]
    func LookupAccessPolicyAssignment(ctx *Context, args *LookupAccessPolicyAssignmentArgs, opts ...InvokeOption) (*LookupAccessPolicyAssignmentResult, error)
    func LookupAccessPolicyAssignmentOutput(ctx *Context, args *LookupAccessPolicyAssignmentOutputArgs, opts ...InvokeOption) LookupAccessPolicyAssignmentResultOutput

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

    public static class GetAccessPolicyAssignment 
    {
        public static Task<GetAccessPolicyAssignmentResult> InvokeAsync(GetAccessPolicyAssignmentArgs args, InvokeOptions? opts = null)
        public static Output<GetAccessPolicyAssignmentResult> Invoke(GetAccessPolicyAssignmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccessPolicyAssignmentResult> getAccessPolicyAssignment(GetAccessPolicyAssignmentArgs args, InvokeOptions options)
    public static Output<GetAccessPolicyAssignmentResult> getAccessPolicyAssignment(GetAccessPolicyAssignmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azure:managedredis/getAccessPolicyAssignment:getAccessPolicyAssignment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ManagedRedisName string
    The name of the Managed Redis instance.
    ObjectId string
    The object ID of the Azure Active Directory user, group, service principal, or managed identity.
    ResourceGroupName string

    The name of the Resource Group where the Managed Redis instance exists.

    Note: This data source retrieves Access Policy Assignments from the default database of the Managed Redis instance.

    ManagedRedisName string
    The name of the Managed Redis instance.
    ObjectId string
    The object ID of the Azure Active Directory user, group, service principal, or managed identity.
    ResourceGroupName string

    The name of the Resource Group where the Managed Redis instance exists.

    Note: This data source retrieves Access Policy Assignments from the default database of the Managed Redis instance.

    managedRedisName String
    The name of the Managed Redis instance.
    objectId String
    The object ID of the Azure Active Directory user, group, service principal, or managed identity.
    resourceGroupName String

    The name of the Resource Group where the Managed Redis instance exists.

    Note: This data source retrieves Access Policy Assignments from the default database of the Managed Redis instance.

    managedRedisName string
    The name of the Managed Redis instance.
    objectId string
    The object ID of the Azure Active Directory user, group, service principal, or managed identity.
    resourceGroupName string

    The name of the Resource Group where the Managed Redis instance exists.

    Note: This data source retrieves Access Policy Assignments from the default database of the Managed Redis instance.

    managed_redis_name str
    The name of the Managed Redis instance.
    object_id str
    The object ID of the Azure Active Directory user, group, service principal, or managed identity.
    resource_group_name str

    The name of the Resource Group where the Managed Redis instance exists.

    Note: This data source retrieves Access Policy Assignments from the default database of the Managed Redis instance.

    managedRedisName String
    The name of the Managed Redis instance.
    objectId String
    The object ID of the Azure Active Directory user, group, service principal, or managed identity.
    resourceGroupName String

    The name of the Resource Group where the Managed Redis instance exists.

    Note: This data source retrieves Access Policy Assignments from the default database of the Managed Redis instance.

    getAccessPolicyAssignment Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    ManagedRedisName string
    ObjectId string
    ResourceGroupName string
    Id string
    The provider-assigned unique ID for this managed resource.
    ManagedRedisName string
    ObjectId string
    ResourceGroupName string
    id String
    The provider-assigned unique ID for this managed resource.
    managedRedisName String
    objectId String
    resourceGroupName String
    id string
    The provider-assigned unique ID for this managed resource.
    managedRedisName string
    objectId string
    resourceGroupName string
    id str
    The provider-assigned unique ID for this managed resource.
    managed_redis_name str
    object_id str
    resource_group_name str
    id String
    The provider-assigned unique ID for this managed resource.
    managedRedisName String
    objectId String
    resourceGroupName String

    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 v6.33.0
    published on Monday, Feb 23, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.