# EntraIdApplicationResource

- Module: [Aspire.Hosting.Azure.EntraId](/reference/api/go/aspire.hosting.azure.entraid.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

A resource that represents a Microsoft Entra ID application registration.

## 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`.

## Definition

```go
type EntraIdApplicationResource interface {
    Resource
}
```

## Embeds

- `Resource`

## Methods

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