# MicrosoftGraphServicePrincipal Methods

- Package: [Aspire.Hosting.Azure.EntraId](/reference/api/csharp/aspire.hosting.azure.entraid.md)
- Type: [MicrosoftGraphServicePrincipal](/reference/api/csharp/aspire.hosting.azure.entraid/microsoftgraphserviceprincipal.md)
- Kind: `Methods`
- Members: `1`

Models the service principal created for an Entra application registration.

<a id="fromexisting"></a>
<a id="fromexisting-string"></a>

## FromExisting(string)

- Name: `FromExisting(string)`
- Modifiers: `static`
- Returns: [MicrosoftGraphExistingServicePrincipal](/reference/api/csharp/aspire.hosting.azure.entraid/microsoftgraphexistingserviceprincipal.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting.Azure.EntraId/Provisioning/MicrosoftGraphServicePrincipal.cs#L98)

Creates a reference to a service principal that already exists in the tenant, such as the one for Microsoft Graph, addressed by its application (client) ID.

```csharp
public sealed class MicrosoftGraphServicePrincipal
{
    public static MicrosoftGraphExistingServicePrincipal FromExisting(
        string bicepIdentifier)
    {
        // ...
    }
}
```

## Parameters

- `bicepIdentifier` (`string`)
  The resource's identifier in the Bicep module.

## Returns

[MicrosoftGraphExistingServicePrincipal](/reference/api/csharp/aspire.hosting.azure.entraid/microsoftgraphexistingserviceprincipal.md) -- A reference whose [MicrosoftGraphExistingServicePrincipal.Name](/reference/api/csharp/aspire.hosting.azure.entraid/microsoftgraphexistingserviceprincipal/properties.md#name) must be set to the application ID.
