get User Assigned Identity
Deprecated
azure.core.getUserAssignedIdentity has been deprecated in favor of azure.authorization.getUserAssignedIdentity
Use this data source to access information about an existing User Assigned Identity.
Example Usage
Reference An Existing)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.authorization.getUserAssignedIdentity({
name: "name_of_user_assigned_identity",
resourceGroupName: "name_of_resource_group",
});
export const uaiClientId = example.then(example => example.clientId);
export const uaiPrincipalId = example.then(example => example.principalId);
export const uaiTenantId = example.then(example => example.tenantId);
import pulumi
import pulumi_azure as azure
example = azure.authorization.get_user_assigned_identity(name="name_of_user_assigned_identity",
resource_group_name="name_of_resource_group")
pulumi.export("uaiClientId", example.client_id)
pulumi.export("uaiPrincipalId", example.principal_id)
pulumi.export("uaiTenantId", example.tenant_id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Authorization.GetUserAssignedIdentity.Invoke(new()
{
Name = "name_of_user_assigned_identity",
ResourceGroupName = "name_of_resource_group",
});
return new Dictionary<string, object?>
{
["uaiClientId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.ClientId),
["uaiPrincipalId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.PrincipalId),
["uaiTenantId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.TenantId),
};
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/authorization"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := authorization.LookupUserAssignedIdentity(ctx, &authorization.LookupUserAssignedIdentityArgs{
Name: "name_of_user_assigned_identity",
ResourceGroupName: "name_of_resource_group",
}, nil)
if err != nil {
return err
}
ctx.Export("uaiClientId", example.ClientId)
ctx.Export("uaiPrincipalId", example.PrincipalId)
ctx.Export("uaiTenantId", example.TenantId)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.authorization.AuthorizationFunctions;
import com.pulumi.azure.authorization.inputs.GetUserAssignedIdentityArgs;
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 = AuthorizationFunctions.getUserAssignedIdentity(GetUserAssignedIdentityArgs.builder()
.name("name_of_user_assigned_identity")
.resourceGroupName("name_of_resource_group")
.build());
ctx.export("uaiClientId", example.clientId());
ctx.export("uaiPrincipalId", example.principalId());
ctx.export("uaiTenantId", example.tenantId());
}
}
variables:
example:
fn::invoke:
function: azure:authorization:getUserAssignedIdentity
arguments:
name: name_of_user_assigned_identity
resourceGroupName: name_of_resource_group
outputs:
uaiClientId: ${example.clientId}
uaiPrincipalId: ${example.principalId}
uaiTenantId: ${example.tenantId}
API Providers
This data source uses the following Azure API Providers:
Microsoft.ManagedIdentity
: 2023-01-31
Return
A collection of values returned by getUserAssignedIdentity.
Parameters
A collection of arguments for invoking getUserAssignedIdentity.
Deprecated
azure.core.getUserAssignedIdentity has been deprecated in favor of azure.authorization.getUserAssignedIdentity
Return
A collection of values returned by getUserAssignedIdentity.
Parameters
The name of the User Assigned Identity.
The name of the Resource Group in which the User Assigned Identity exists.
See also
Deprecated
azure.core.getUserAssignedIdentity has been deprecated in favor of azure.authorization.getUserAssignedIdentity
Return
A collection of values returned by getUserAssignedIdentity.
Parameters
Builder for com.pulumi.azure.core.kotlin.inputs.GetUserAssignedIdentityPlainArgs.