# EntraIdApplicationResource.WithServicePrincipalOwners

- Module: [Aspire.Hosting.Azure.EntraId](/reference/api/go/aspire.hosting.azure.entraid.md)
- Defined on: [EntraIdApplicationResource](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `method`

Appends a service principal owner supplied as a literal directory object GUID or a parameter.

## Remarks

Service principal ownership is independent of application ownership. Throws for existing registrations; configure their owners manually.

## Definition

```go
type EntraIdApplicationResource interface {
    // ... omitted for brevity
    WithServicePrincipalOwners(ownerObjectId any) EntraIdApplicationResource
}
```

## Signature

```go
WithServicePrincipalOwners(ownerObjectId any) EntraIdApplicationResource
```

## Parameters

- `ownerObjectId` (`any`) -- The directory object ID of a user or service principal.

## Returns

[`EntraIdApplicationResource`](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md) -- The registration builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [EntraIdApplicationResource](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md) -- `handle`
