1. Packages
  2. Azure Classic
  3. API Docs
  4. containerservice
  5. getRegistryToken

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.containerservice.getRegistryToken

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to access information about an existing Container Registry token.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.containerservice.getRegistryToken({
    name: "exampletoken",
    resourceGroupName: "example-resource-group",
    containerRegistryName: "example-registry",
});
export const scopeMapId = example.then(example => example.scopeMapId);
Copy
import pulumi
import pulumi_azure as azure

example = azure.containerservice.get_registry_token(name="exampletoken",
    resource_group_name="example-resource-group",
    container_registry_name="example-registry")
pulumi.export("scopeMapId", example.scope_map_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/containerservice"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := containerservice.LookupRegistryToken(ctx, &containerservice.LookupRegistryTokenArgs{
			Name:                  "exampletoken",
			ResourceGroupName:     "example-resource-group",
			ContainerRegistryName: "example-registry",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("scopeMapId", example.ScopeMapId)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.ContainerService.GetRegistryToken.Invoke(new()
    {
        Name = "exampletoken",
        ResourceGroupName = "example-resource-group",
        ContainerRegistryName = "example-registry",
    });

    return new Dictionary<string, object?>
    {
        ["scopeMapId"] = example.Apply(getRegistryTokenResult => getRegistryTokenResult.ScopeMapId),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.containerservice.ContainerserviceFunctions;
import com.pulumi.azure.containerservice.inputs.GetRegistryTokenArgs;
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 = ContainerserviceFunctions.getRegistryToken(GetRegistryTokenArgs.builder()
            .name("exampletoken")
            .resourceGroupName("example-resource-group")
            .containerRegistryName("example-registry")
            .build());

        ctx.export("scopeMapId", example.applyValue(getRegistryTokenResult -> getRegistryTokenResult.scopeMapId()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:containerservice:getRegistryToken
      arguments:
        name: exampletoken
        resourceGroupName: example-resource-group
        containerRegistryName: example-registry
outputs:
  scopeMapId: ${example.scopeMapId}
Copy

Using getRegistryToken

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 getRegistryToken(args: GetRegistryTokenArgs, opts?: InvokeOptions): Promise<GetRegistryTokenResult>
function getRegistryTokenOutput(args: GetRegistryTokenOutputArgs, opts?: InvokeOptions): Output<GetRegistryTokenResult>
Copy
def get_registry_token(container_registry_name: Optional[str] = None,
                       name: Optional[str] = None,
                       resource_group_name: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetRegistryTokenResult
def get_registry_token_output(container_registry_name: Optional[pulumi.Input[str]] = None,
                       name: Optional[pulumi.Input[str]] = None,
                       resource_group_name: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetRegistryTokenResult]
Copy
func LookupRegistryToken(ctx *Context, args *LookupRegistryTokenArgs, opts ...InvokeOption) (*LookupRegistryTokenResult, error)
func LookupRegistryTokenOutput(ctx *Context, args *LookupRegistryTokenOutputArgs, opts ...InvokeOption) LookupRegistryTokenResultOutput
Copy

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

public static class GetRegistryToken 
{
    public static Task<GetRegistryTokenResult> InvokeAsync(GetRegistryTokenArgs args, InvokeOptions? opts = null)
    public static Output<GetRegistryTokenResult> Invoke(GetRegistryTokenInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRegistryTokenResult> getRegistryToken(GetRegistryTokenArgs args, InvokeOptions options)
public static Output<GetRegistryTokenResult> getRegistryToken(GetRegistryTokenArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:containerservice/getRegistryToken:getRegistryToken
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ContainerRegistryName This property is required. string
The Name of the Container Registry where the token exists.
Name This property is required. string
The name of the Container Registry token.
ResourceGroupName This property is required. string
The Name of the Resource Group where this Container Registry token exists.
ContainerRegistryName This property is required. string
The Name of the Container Registry where the token exists.
Name This property is required. string
The name of the Container Registry token.
ResourceGroupName This property is required. string
The Name of the Resource Group where this Container Registry token exists.
containerRegistryName This property is required. String
The Name of the Container Registry where the token exists.
name This property is required. String
The name of the Container Registry token.
resourceGroupName This property is required. String
The Name of the Resource Group where this Container Registry token exists.
containerRegistryName This property is required. string
The Name of the Container Registry where the token exists.
name This property is required. string
The name of the Container Registry token.
resourceGroupName This property is required. string
The Name of the Resource Group where this Container Registry token exists.
container_registry_name This property is required. str
The Name of the Container Registry where the token exists.
name This property is required. str
The name of the Container Registry token.
resource_group_name This property is required. str
The Name of the Resource Group where this Container Registry token exists.
containerRegistryName This property is required. String
The Name of the Container Registry where the token exists.
name This property is required. String
The name of the Container Registry token.
resourceGroupName This property is required. String
The Name of the Resource Group where this Container Registry token exists.

getRegistryToken Result

The following output properties are available:

ContainerRegistryName string
Enabled bool
Whether this Token is enabled.
Id string
The provider-assigned unique ID for this managed resource.
Name string
ResourceGroupName string
ScopeMapId string
The Scope Map ID used by the token.
ContainerRegistryName string
Enabled bool
Whether this Token is enabled.
Id string
The provider-assigned unique ID for this managed resource.
Name string
ResourceGroupName string
ScopeMapId string
The Scope Map ID used by the token.
containerRegistryName String
enabled Boolean
Whether this Token is enabled.
id String
The provider-assigned unique ID for this managed resource.
name String
resourceGroupName String
scopeMapId String
The Scope Map ID used by the token.
containerRegistryName string
enabled boolean
Whether this Token is enabled.
id string
The provider-assigned unique ID for this managed resource.
name string
resourceGroupName string
scopeMapId string
The Scope Map ID used by the token.
container_registry_name str
enabled bool
Whether this Token is enabled.
id str
The provider-assigned unique ID for this managed resource.
name str
resource_group_name str
scope_map_id str
The Scope Map ID used by the token.
containerRegistryName String
enabled Boolean
Whether this Token is enabled.
id String
The provider-assigned unique ID for this managed resource.
name String
resourceGroupName String
scopeMapId String
The Scope Map ID used by the token.

Package Details

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

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi