# EntraIdApplicationResource

- Kind: `class`
- Package: [Aspire.Hosting.Azure.EntraId](/reference/api/csharp/aspire.hosting.azure.entraid.md)
- Version: `17.0.0-preview.1.26567.5`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/src/Aspire.Hosting.Azure.EntraId/EntraIdApplicationResource.cs)
- Inherits: `AzureProvisioningResource`
- Implements: `IResource`, `IResourceWithCustomWithReference<EntraIdApplicationResource>`

A resource that represents a Microsoft Entra ID application registration.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class EntraIdApplicationResource
    : Aspire.Hosting.Azure.AzureProvisioningResource,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithCustomWithReference<Aspire.Hosting.Azure.EntraIdApplicationResource>
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Azure.EntraId/EntraIdApplicationResource`

## Remarks

Entra ID application registrations define the identity configuration for services in a distributed application. Each application registration includes a tenant ID, client ID, and optionally client credentials and API scopes.

Aspire creates new registrations using a resource-group-scoped Microsoft Graph Bicep deployment. Use `AddExistingEntraIdApplication` to reference an existing registration without deploying infrastructure. Registration-only builder APIs throw on existing references. Converting a resource with `AsExistingApplication` also throws if registration-only configuration was already applied. Consumer configuration and explicit metadata describing existing API URIs and scopes remain supported.

References to this resource inject configuration as environment variables. .NET program references default to names such as `AzureAd__TenantId` and `AzureAd__ClientId`, compatible with Microsoft.Identity.Web. Other references default to an uppercase resource-name prefix and a single underscore separator, and can configure their own prefix and separator.

The properties align with `MicrosoftEntraApplicationOptions` from `Microsoft.Identity.Abstractions`.

## Constructors

- [EntraIdApplicationResource(string)](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/constructors.md#constructor-string) -- Initializes a new instance of the [EntraIdApplicationResource](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource.md) class.

## Properties

- [AllowWebApiToBeAuthorizedByACL](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#allowwebapitobeauthorizedbyacl) : `bool` `get; set` -- Gets or sets whether to allow ACL-based authorization for daemon-to-API calls.
- [ApplicationIdUri](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#applicationiduri) : `string?` `get` -- Gets the application ID URI that identifies this registration as an API, when one was set explicitly.
- [ApplicationIdUriOutputReference](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#applicationidurioutputreference) : `BicepOutputReference` `get` -- Gets the application ID URI produced when the registration is provisioned with an application ID URI.
- [AppRoles](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#approles) : [IReadOnlyList<EntraIdAppRole>](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapprole.md) `get` -- Gets the application roles to declare on an application created by Aspire.
- [ClientId](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#clientid) : `string?` `get; set` -- Gets or sets a fixed client ID value.
- [ClientIdOutputReference](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#clientidoutputreference) : `BicepOutputReference` `get` -- Gets the application (client) ID produced when the registration is provisioned.
- [ClientIdParameter](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#clientidparameter) : `ParameterResource?` `get; set` -- Gets or sets the parameter resource for the client ID.
- [EnableIdTokenIssuance](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#enableidtokenissuance) : `bool` `get; set` -- Gets or sets whether a created registration can issue ID tokens through implicit and hybrid flows.
- [Instance](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#instance) : `string` `get; set` -- Gets or sets the Entra ID instance URL.
- [RedirectUriParameters](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#redirecturiparameters) : `IReadOnlyList<ParameterResource>` `get` -- Gets the parameters whose values are comma-separated lists of web redirect URIs to register for an application created by Aspire.
- [RedirectUris](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#redirecturis) : `IReadOnlyList<string>` `get` -- Gets the literal web redirect URIs to register for an application created by Aspire.
- [Scopes](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#scopes) : [IReadOnlyList<EntraIdScope>](/reference/api/csharp/aspire.hosting.azure.entraid/entraidscope.md) `get` -- Gets the delegated permission scopes that this registration exposes.
- [SendX5C](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#sendx5c) : `bool` `get; set` -- Gets or sets whether to send the `x5c` claim (the public key of the certificate) with the token request.
- [SignInAudience](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#signinaudience) : [EntraIdSignInAudience](/reference/api/csharp/aspire.hosting.azure.entraid/entraidsigninaudience.md) `get; set` -- Gets or sets which accounts can sign in to the application.
- [TenantId](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#tenantid) : `string?` `get; set` -- Gets or sets a fixed ID of the app's home tenant.
- [TenantIdOutputReference](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#tenantidoutputreference) : `BicepOutputReference` `get` -- Gets the home tenant ID produced when the registration is provisioned.
- [TenantIdParameter](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/properties.md#tenantidparameter) : `ParameterResource?` `get; set` -- Gets or sets the parameter resource for the ID of the app's home tenant.

## Methods

- [GetBicepTemplateFile(string?, bool)](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/methods.md#getbiceptemplatefile-string-bool) : `BicepTemplateFile` -- Gets the path to the bicep file. If the template is a string or embedded resource, it will be written to a temporary file.
- [GetBicepTemplateString](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/methods.md#getbiceptemplatestring) : `string` -- Get the bicep template as a string. Does not write to disk.
- [GetScopeUri(string)](/reference/api/csharp/aspire.hosting.azure.entraid/entraidapplicationresource/methods.md#getscopeuri-string) : `ReferenceExpression` -- Gets an expression for the full URI of one of this registration's scopes, such as `api://{clientId}/access_as_user`.
