# Aspire.Hosting.Azure.EntraId

- Module: `Aspire.Hosting.Azure.EntraId`
- Version: `17.0.0-preview.1.26565.2`
- Import path: `apphost/modules/aspire`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)
- Functions: `35`
- Types: `10`

## Handles

- [AzureKeyVaultResource](/reference/api/go/aspire.hosting.azure.entraid/azurekeyvaultresource.md) -- `handle` - 0 members
- [AzureUserAssignedIdentityResource](/reference/api/go/aspire.hosting.azure.entraid/azureuserassignedidentityresource.md) -- `handle` - 0 members
- [EntraIdApplicationResource](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md) -- `handle` - 32 members -- A resource that represents a Microsoft Entra ID application registration.

## DTOs

- [EntraIdCustomApi](/reference/api/go/aspire.hosting.azure.entraid/entraidcustomapi.md) -- `struct` - 4 fields -- Identifies an API that is not an Aspire resource by its application ID and application ID URI.
- [EntraIdExternalApiPermission](/reference/api/go/aspire.hosting.azure.entraid/entraidexternalapipermission.md) -- `struct` - 3 fields -- A permission of an API that is not an Aspire resource.
- [EntraIdScopeOptions](/reference/api/go/aspire.hosting.azure.entraid/entraidscopeoptions.md) -- `struct` - 6 fields -- Optional settings for a scope exposed by a created registration or described by an existing reference.
- [EntraIdTokenExchangeOptions](/reference/api/go/aspire.hosting.azure.entraid/entraidtokenexchangeoptions.md) -- `struct` - 2 fields -- Optional token exchange settings for a pre-existing managed identity federation trust.

## Enums

- [EntraIdPermissionType](/reference/api/go/aspire.hosting.azure.entraid/entraidpermissiontype.md) -- `enum` - 2 values -- The kind of permission that an application requests from an API.
- [EntraIdSignInAudience](/reference/api/go/aspire.hosting.azure.entraid/entraidsigninaudience.md) -- `enum` - 4 values -- Specifies which Microsoft accounts can sign in to an Entra ID application.
- [EntraIdWellKnownApi](/reference/api/go/aspire.hosting.azure.entraid/entraidwellknownapi.md) -- `enum` - 3 values -- The Microsoft first-party APIs whose common permissions Aspire knows by name.

## Functions

- [AddEntraIdApplication](/reference/api/go/aspire.hosting.azure.entraid/addentraidapplication.md) -- `method` - on `DistributedApplicationBuilder` -- Adds a Microsoft Entra ID application registration resource to the application model.
- [AddExistingEntraIdApplication](/reference/api/go/aspire.hosting.azure.entraid/addexistingentraidapplication.md) -- `method` - on `DistributedApplicationBuilder` -- References an existing registration without enabling Azure provisioning or querying Microsoft Graph.
- [AsExistingApplication](/reference/api/go/aspire.hosting.azure.entraid/asexistingapplication.md) -- `method` - on `EntraIdApplicationResource` -- References an existing registration without undoing the Azure provisioning setup enabled when this resource was added.
- [GetScopeUri](/reference/api/go/aspire.hosting.azure.entraid/getscopeuri.md) -- `method` - on `EntraIdApplicationResource` -- Gets an expression for the full URI of one of this registration's scopes, such as api://{clientId}/access_as_user.
- [PublishWithAppRoleAssignment](/reference/api/go/aspire.hosting.azure.entraid/publishwithapproleassignment.md) -- `method` - on `EntraIdApplicationResource` -- Publishes explicit application-role assignments to a managed identity or a compute resource's managed identity.
- [PublishWithFederatedManagedIdentityCredential](/reference/api/go/aspire.hosting.azure.entraid/publishwithfederatedmanagedidentitycredential.md) -- `method` - on `EntraIdApplicationResource` -- Publishes managed identity federation trust for a registration created by Aspire.
- [RunWithLocalDeveloperCertificateCredential](/reference/api/go/aspire.hosting.azure.entraid/runwithlocaldevelopercertificatecredential.md) -- `method` - on `EntraIdApplicationResource` -- Creates and provisions a short-lived certificate credential for local development.
- [WithAdminConsent](/reference/api/go/aspire.hosting.azure.entraid/withadminconsent.md) -- `method` - on `EntraIdApplicationResource` -- Grants tenant-wide consent to delegated permissions that this registration declared for another registration in the AppHost.
- [WithAllowWebApiToBeAuthorizedByACL](/reference/api/go/aspire.hosting.azure.entraid/withallowwebapitobeauthorizedbyacl.md) -- `method` - on `EntraIdApplicationResource` -- Enables ACL-based authorization for daemon-to-API scenarios.
- [WithApiPermissions](/reference/api/go/aspire.hosting.azure.entraid/withapipermissions.md) -- `method` - on `EntraIdApplicationResource` -- Declares that this registration requires delegated permissions to scopes of another registration in the AppHost.
- [WithApplicationIdUri](/reference/api/go/aspire.hosting.azure.entraid/withapplicationiduri.md) -- `method` - on `EntraIdApplicationResource` -- Exposes the registration as an API identified by an application ID URI.
- [WithApplicationOwners](/reference/api/go/aspire.hosting.azure.entraid/withapplicationowners.md) -- `method` - on `EntraIdApplicationResource` -- Appends an application owner supplied as a literal directory object GUID or a parameter.
- [WithAppRole](/reference/api/go/aspire.hosting.azure.entraid/withapprole.md) -- `method` - on `EntraIdApplicationResource` -- Declares an application role on a registration created by Aspire.
- [WithAudience](/reference/api/go/aspire.hosting.azure.entraid/withaudience.md) -- `method` - on `EntraIdApplicationResource` -- Adds an accepted audience for this application.
- [WithCertificateDistinguishedName](/reference/api/go/aspire.hosting.azure.entraid/withcertificatedistinguishedname.md) -- `method` - on `EntraIdApplicationResource` -- Adds a certificate credential from the certificate store by distinguished name.
- [WithCertificateFromFile](/reference/api/go/aspire.hosting.azure.entraid/withcertificatefromfile.md) -- `method` - on `EntraIdApplicationResource` -- Appends a certificate file credential. The file path is on the consuming resource, not the AppHost.
- [WithCertificateFromKeyVault](/reference/api/go/aspire.hosting.azure.entraid/withcertificatefromkeyvault.md) -- `method` - on `EntraIdApplicationResource` -- Adds a certificate credential using a vault URL or Key Vault resource.
- [WithCertificateThumbprint](/reference/api/go/aspire.hosting.azure.entraid/withcertificatethumbprint.md) -- `method` - on `EntraIdApplicationResource` -- Adds a certificate credential from the certificate store by thumbprint.
- [WithClientCapability](/reference/api/go/aspire.hosting.azure.entraid/withclientcapability.md) -- `method` - on `EntraIdApplicationResource` -- Adds a client capability (e.g., `"cp1"` for Continuous Access Evaluation).
- [WithClientSecret](/reference/api/go/aspire.hosting.azure.entraid/withclientsecret.md) -- `method` - on `EntraIdApplicationResource` -- Adds a client secret credential to this Entra ID application.
- [WithExternalApiAdminConsent](/reference/api/go/aspire.hosting.azure.entraid/withexternalapiadminconsent.md) -- `method` - on `EntraIdApplicationResource` -- Grants tenant-wide consent to permissions that this registration declared for an API that is not an Aspire resource.
- [WithExternalApiPermissions](/reference/api/go/aspire.hosting.azure.entraid/withexternalapipermissions.md) -- `method` - on `EntraIdApplicationResource` -- Declares permissions to a Microsoft first-party or other API that is not an Aspire resource, such as Microsoft Graph.
- [WithExtraQueryParameter](/reference/api/go/aspire.hosting.azure.entraid/withextraqueryparameter.md) -- `method` - on `EntraIdApplicationResource` -- Adds an extra query parameter to send to the identity provider.
- [WithFederatedManagedIdentityCredential](/reference/api/go/aspire.hosting.azure.entraid/withfederatedmanagedidentitycredential.md) -- `method` - on `EntraIdApplicationResource` -- Configures a pre-existing managed identity trust for token acquisition, without provisioning or assigning an identity.
- [WithIdTokenIssuance](/reference/api/go/aspire.hosting.azure.entraid/withidtokenissuance.md) -- `method` - on `EntraIdApplicationResource` -- Enables ID-token issuance through implicit and hybrid flows for a registration created by Aspire.
- [WithInstance](/reference/api/go/aspire.hosting.azure.entraid/withinstance.md) -- `method` - on `EntraIdApplicationResource` -- Configures the Entra ID instance URL. Defaults to `https://login.microsoftonline.com/`.
- [WithOwners](/reference/api/go/aspire.hosting.azure.entraid/withowners.md) -- `method` - on `EntraIdApplicationResource` -- Appends an owner to both the application registration and service principal.
- [WithPreAuthorizedApplication](/reference/api/go/aspire.hosting.azure.entraid/withpreauthorizedapplication.md) -- `method` - on `EntraIdApplicationResource` -- Pre-authorizes a client application to request some of this registration's scopes without any consent prompt.
- [WithRedirectUris](/reference/api/go/aspire.hosting.azure.entraid/withredirecturis.md) -- `method` - on `EntraIdApplicationResource` -- Appends web redirect URIs supplied as a literal, a parameter, or an endpoint.
- [WithScope](/reference/api/go/aspire.hosting.azure.entraid/withscope.md) -- `method` - on `EntraIdApplicationResource` -- Exposes a delegated permission scope that clients can request to call this registration as an API.
- [WithSendX5C](/reference/api/go/aspire.hosting.azure.entraid/withsendx5c.md) -- `method` - on `EntraIdApplicationResource` -- Sends the `x5c` claim (the public key of the certificate) with token requests.
- [WithServicePrincipalOwners](/reference/api/go/aspire.hosting.azure.entraid/withserviceprincipalowners.md) -- `method` - on `EntraIdApplicationResource` -- Appends a service principal owner supplied as a literal directory object GUID or a parameter.
- [WithSignedAssertionFile](/reference/api/go/aspire.hosting.azure.entraid/withsignedassertionfile.md) -- `method` - on `EntraIdApplicationResource` -- Appends a signed assertion file credential, such as an AKS workload identity token.
- [WithSignInAudience](/reference/api/go/aspire.hosting.azure.entraid/withsigninaudience.md) -- `method` - on `EntraIdApplicationResource` -- Configures which accounts can sign in to this application.
- [WithEntraIdReference](/reference/api/go/aspire.hosting.azure.entraid/withentraidreference.md) -- `method` - on `ResourceWithEnvironment` -- Injects Entra ID authentication configuration into a consuming resource and sets the prefix of its DownstreamApis entries.
