Azure DevOps v3.10.2 published on Wednesday, Oct 22, 2025 by Pulumi
azuredevops.getServicePrincipal
Start a Neo task
Explain and create an azuredevops.getServicePrincipal resource
Use this data source to access information about an existing Service Principal.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";
const example = azuredevops.getServicePrincipal({
displayName: "existing",
});
export const id = example.then(example => example.id);
import pulumi
import pulumi_azuredevops as azuredevops
example = azuredevops.get_service_principal(display_name="existing")
pulumi.export("id", example.id)
package main
import (
"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := azuredevops.GetServicePrincipal(ctx, &azuredevops.GetServicePrincipalArgs{
DisplayName: "existing",
}, nil)
if err != nil {
return err
}
ctx.Export("id", example.Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;
return await Deployment.RunAsync(() =>
{
var example = AzureDevOps.GetServicePrincipal.Invoke(new()
{
DisplayName = "existing",
});
return new Dictionary<string, object?>
{
["id"] = example.Apply(getServicePrincipalResult => getServicePrincipalResult.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.AzuredevopsFunctions;
import com.pulumi.azuredevops.inputs.GetServicePrincipalArgs;
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 = AzuredevopsFunctions.getServicePrincipal(GetServicePrincipalArgs.builder()
.displayName("existing")
.build());
ctx.export("id", example.id());
}
}
variables:
example:
fn::invoke:
function: azuredevops:getServicePrincipal
arguments:
displayName: existing
outputs:
id: ${example.id}
Using getServicePrincipal
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 getServicePrincipal(args: GetServicePrincipalArgs, opts?: InvokeOptions): Promise<GetServicePrincipalResult>
function getServicePrincipalOutput(args: GetServicePrincipalOutputArgs, opts?: InvokeOptions): Output<GetServicePrincipalResult>def get_service_principal(display_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetServicePrincipalResult
def get_service_principal_output(display_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetServicePrincipalResult]func GetServicePrincipal(ctx *Context, args *GetServicePrincipalArgs, opts ...InvokeOption) (*GetServicePrincipalResult, error)
func GetServicePrincipalOutput(ctx *Context, args *GetServicePrincipalOutputArgs, opts ...InvokeOption) GetServicePrincipalResultOutput> Note: This function is named GetServicePrincipal in the Go SDK.
public static class GetServicePrincipal
{
public static Task<GetServicePrincipalResult> InvokeAsync(GetServicePrincipalArgs args, InvokeOptions? opts = null)
public static Output<GetServicePrincipalResult> Invoke(GetServicePrincipalInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetServicePrincipalResult> getServicePrincipal(GetServicePrincipalArgs args, InvokeOptions options)
public static Output<GetServicePrincipalResult> getServicePrincipal(GetServicePrincipalArgs args, InvokeOptions options)
fn::invoke:
function: azuredevops:index/getServicePrincipal:getServicePrincipal
arguments:
# arguments dictionaryThe following arguments are supported:
- Display
Name string - The Display Name of the Service Principal. Changing this forces a new Service Principal to be created.
- Display
Name string - The Display Name of the Service Principal. Changing this forces a new Service Principal to be created.
- display
Name String - The Display Name of the Service Principal. Changing this forces a new Service Principal to be created.
- display
Name string - The Display Name of the Service Principal. Changing this forces a new Service Principal to be created.
- display_
name str - The Display Name of the Service Principal. Changing this forces a new Service Principal to be created.
- display
Name String - The Display Name of the Service Principal. Changing this forces a new Service Principal to be created.
getServicePrincipal Result
The following output properties are available:
- Descriptor string
- The descriptor of the Service Principal.
- Display
Name string - Id string
- The provider-assigned unique ID for this managed resource.
- Origin string
- The origin of the Service Principal.
- Origin
Id string - The origin ID of the Service Principal..
- Descriptor string
- The descriptor of the Service Principal.
- Display
Name string - Id string
- The provider-assigned unique ID for this managed resource.
- Origin string
- The origin of the Service Principal.
- Origin
Id string - The origin ID of the Service Principal..
- descriptor String
- The descriptor of the Service Principal.
- display
Name String - id String
- The provider-assigned unique ID for this managed resource.
- origin String
- The origin of the Service Principal.
- origin
Id String - The origin ID of the Service Principal..
- descriptor string
- The descriptor of the Service Principal.
- display
Name string - id string
- The provider-assigned unique ID for this managed resource.
- origin string
- The origin of the Service Principal.
- origin
Id string - The origin ID of the Service Principal..
- descriptor str
- The descriptor of the Service Principal.
- display_
name str - id str
- The provider-assigned unique ID for this managed resource.
- origin str
- The origin of the Service Principal.
- origin_
id str - The origin ID of the Service Principal..
- descriptor String
- The descriptor of the Service Principal.
- display
Name String - id String
- The provider-assigned unique ID for this managed resource.
- origin String
- The origin of the Service Principal.
- origin
Id String - The origin ID of the Service Principal..
Package Details
- Repository
- Azure DevOps pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azuredevopsTerraform Provider.
