EntraIdApplicationResource

Handle
📦 Aspire.Hosting.Azure.EntraId v17.0.0-preview.1.26567.5
interface EntraIdApplicationResource
extends IAzureResource,
IResource,
EntraIdApplicationResource]],
IResourceWithParameters {
asExistingApplication(
tenantId: string | ParameterResource,
clientId: string | ParameterResource): EntraIdApplicationResource;
getScopeUri(scopeName: string): ReferenceExpression;
publishWithAppRoleAssignment(
identity: AzureUserAssignedIdentityResource | IComputeResource,
roleValues: string[]): EntraIdApplicationResource;
publishWithFederatedManagedIdentityCredential(identity?: IComputeResource | AzureUserAssignedIdentityResource): EntraIdApplicationResource;
runWithLocalDeveloperCertificateCredential(): EntraIdApplicationResource;
withAdminConsent(
api: EntraIdApplicationResource,
scopeNames: string[]): EntraIdApplicationResource;
withAllowWebApiToBeAuthorizedByACL(): EntraIdApplicationResource;
withApiPermissions(
api: EntraIdApplicationResource,
scopeNames: string[]): EntraIdApplicationResource;
withApplicationIdUri(applicationIdUri?: string): EntraIdApplicationResource;
withApplicationOwners(ownerObjectId: string | ParameterResource): EntraIdApplicationResource;
withAppRole(
value: string,
displayName: string,
description: string,
allowedMemberTypes?: string[],
id?: string,
isEnabled?: boolean): EntraIdApplicationResource;
withAudience(audience: string): EntraIdApplicationResource;
withCertificateDistinguishedName(
storePath: string,
distinguishedName: string): EntraIdApplicationResource;
withCertificateFromFile(
filePath: string,
password?: ParameterResource): EntraIdApplicationResource;
withCertificateFromKeyVault(
keyVaultUrl: string | AzureKeyVaultResource,
certificateName: string): EntraIdApplicationResource;
withCertificateThumbprint(
storePath: string,
thumbprint: string): EntraIdApplicationResource;
withClientCapability(capability: string): EntraIdApplicationResource;
withClientSecret(clientSecret: ParameterResource): EntraIdApplicationResource;
withExternalApiAdminConsent(
api: EntraIdWellKnownApi | EntraIdCustomApi,
permissions: EntraIdExternalApiPermission[]): EntraIdApplicationResource;
withExternalApiPermissions(
api: EntraIdWellKnownApi | EntraIdCustomApi,
permissions: EntraIdExternalApiPermission[]): EntraIdApplicationResource;
withExtraQueryParameter(
key: string,
value: string): EntraIdApplicationResource;
withFederatedManagedIdentityCredential(
managedIdentityClientId: string,
options?: EntraIdTokenExchangeOptions): EntraIdApplicationResource;
withIdTokenIssuance(): EntraIdApplicationResource;
withInstance(instance: string): EntraIdApplicationResource;
withOwners(ownerObjectId: string | ParameterResource): EntraIdApplicationResource;
withPreAuthorizedApplication(
client: EntraIdApplicationResource,
scopeNames: string[]): EntraIdApplicationResource;
withRedirectUris(
redirectUri: string | ParameterResource | EndpointReference,
callbackPaths?: string[]): EntraIdApplicationResource;
withScope(
name: string,
description: string,
options?: EntraIdScopeOptions): EntraIdApplicationResource;
withSendX5C(): EntraIdApplicationResource;
withServicePrincipalOwners(ownerObjectId: string | ParameterResource): EntraIdApplicationResource;
withSignedAssertionFile(filePath?: string): EntraIdApplicationResource;
withSignInAudience(signInAudience: EntraIdSignInAudience): EntraIdApplicationResource;
}

Methods

References an existing registration without undoing the Azure provisioning setup enabled when this resource was added.
asExistingApplication(
tenantId: string | ParameterResource,
clientId: string | ParameterResource): EntraIdApplicationResource
tenantIdstring | ParameterResourceThe registration's home tenant GUID or domain, as a literal or parameter.
clientIdstring | ParameterResourceThe registration's application client GUID, as a literal or parameter.
EntraIdApplicationResource
Gets an expression for the full URI of one of this registration's scopes, such as api://{clientId}/access_as_user.
getScopeUri(scopeName: string): ReferenceExpression
scopeNamestringThe name of a scope added with withScope.
ReferenceExpression
Publishes explicit application-role assignments to a managed identity or a compute resource's managed identity.
publishWithAppRoleAssignment(
identity: AzureUserAssignedIdentityResource | IComputeResource,
roleValues: string[]): EntraIdApplicationResource
identityAzureUserAssignedIdentityResource | IComputeResourceThe user-assigned identity or compute resource receiving the roles.
roleValuesstring[]Enabled role values declared on this API that allow Application members.
EntraIdApplicationResource
Publishes managed identity federation trust for a registration created by Aspire.
publishWithFederatedManagedIdentityCredential(identity?: IComputeResource | AzureUserAssignedIdentityResource): EntraIdApplicationResource
identityIComputeResource | AzureUserAssignedIdentityResourceoptionalA compute resource whose identity to trust, an explicit user-assigned identity, or no value to trust every consumer's own identity.
EntraIdApplicationResource
Creates and provisions a short-lived certificate credential for local development.
runWithLocalDeveloperCertificateCredential(): EntraIdApplicationResource
EntraIdApplicationResource
methodwithAdminConsentbuilder
Grants tenant-wide consent to delegated permissions that this registration declared for another registration in the AppHost.
withAdminConsent(
api: EntraIdApplicationResource,
scopeNames: string[]): EntraIdApplicationResource
apiEntraIdApplicationResourceThe registration that exposes the scopes.
scopeNamesstring[]The names of scopes already declared with `WithApiPermissions`.
EntraIdApplicationResource
Enables ACL-based authorization for daemon-to-API scenarios.
withAllowWebApiToBeAuthorizedByACL(): EntraIdApplicationResource
EntraIdApplicationResource
methodwithApiPermissionsbuilder
Declares that this registration requires delegated permissions to scopes of another registration in the AppHost.
withApiPermissions(
api: EntraIdApplicationResource,
scopeNames: string[]): EntraIdApplicationResource
apiEntraIdApplicationResourceThe registration that exposes the scopes.
scopeNamesstring[]The names of the scopes, added with `WithScope` to `api`.
EntraIdApplicationResource
Exposes the registration as an API identified by an application ID URI.
withApplicationIdUri(applicationIdUri?: string): EntraIdApplicationResource
applicationIdUristringoptionalA custom URI, such as api://contoso-orders or https://contoso.onmicrosoft.com/orders. Omit to use the default api://{clientId}.
EntraIdApplicationResource
Appends an application owner supplied as a literal directory object GUID or a parameter.
withApplicationOwners(ownerObjectId: string | ParameterResource): EntraIdApplicationResource
ownerObjectIdstring | ParameterResourceThe directory object ID of a user or service principal.
EntraIdApplicationResource
methodwithAppRolebuilder
Declares an application role on a registration created by Aspire.
withAppRole(
value: string,
displayName: string,
description: string,
allowedMemberTypes?: string[],
id?: string,
isEnabled?: boolean): EntraIdApplicationResource
valuestringThe value emitted in the roles claim, for example Admin. It must be unique for the application, at most 120 characters, must not start with a period, and may contain only ASCII letters, digits and the punctuation that Microsoft Graph allows.
displayNamestringThe display name shown in the Microsoft Entra admin center.
descriptionstringThe description shown in assignment and consent experiences.
allowedMemberTypesstring[]optionalThe member types the role can be assigned to, passed through to Microsoft Graph (for example User or Application). Defaults to User.
idstringoptionalAn optional role GUID. When omitted, a stable ID is derived from the registration's resource name and value.
isEnabledbooleanoptionalWhether the role is enabled. Defaults to true. To retire a role, deploy it with false and leave it declared; disabling is not access revocation because existing assignments still receive the role in tokens.
EntraIdApplicationResource
methodwithAudiencebuilder
Adds an accepted audience for this application.
withAudience(audience: string): EntraIdApplicationResource
audiencestringThe audience value (e.g., `api://<client-id>`).
EntraIdApplicationResource
Adds a certificate credential from the certificate store by distinguished name.
withCertificateDistinguishedName(
storePath: string,
distinguishedName: string): EntraIdApplicationResource
storePathstringThe certificate store path (e.g., `"CurrentUser/My"`).
distinguishedNamestringThe certificate distinguished name (e.g., `"CN=MyCert"`).
EntraIdApplicationResource
Appends a certificate file credential. The file path is on the consuming resource, not the AppHost.
withCertificateFromFile(
filePath: string,
password?: ParameterResource): EntraIdApplicationResource
filePathstringThe path to the certificate file on the consumer.
passwordParameterResourceoptionalAn optional secret parameter for a password-protected certificate.
EntraIdApplicationResource
Adds a certificate credential using a vault URL or Key Vault resource.
withCertificateFromKeyVault(
keyVaultUrl: string | AzureKeyVaultResource,
certificateName: string): EntraIdApplicationResource
keyVaultUrlstring | AzureKeyVaultResourceThe vault URL or Key Vault resource containing the certificate.
certificateNamestringThe name of the certificate in Key Vault.
EntraIdApplicationResource
Adds a certificate credential from the certificate store by thumbprint.
withCertificateThumbprint(
storePath: string,
thumbprint: string): EntraIdApplicationResource
storePathstringThe certificate store path (e.g., `"CurrentUser/My"`).
thumbprintstringThe certificate thumbprint.
EntraIdApplicationResource
Adds a client capability (e.g., `"cp1"` for Continuous Access Evaluation).
withClientCapability(capability: string): EntraIdApplicationResource
capabilitystringThe capability identifier.
EntraIdApplicationResource
methodwithClientSecretbuilder
Adds a client secret credential to this Entra ID application.
withClientSecret(clientSecret: ParameterResource): EntraIdApplicationResource
clientSecretParameterResourceA secret parameter containing the client secret.
EntraIdApplicationResource
Grants tenant-wide consent to permissions that this registration declared for an API that is not an Aspire resource.
withExternalApiAdminConsent(
api: EntraIdWellKnownApi | EntraIdCustomApi,
permissions: EntraIdExternalApiPermission[]): EntraIdApplicationResource
apiEntraIdWellKnownApi | EntraIdCustomApiA well-known API, or an API identified by its application ID and application ID URI.
permissionsEntraIdExternalApiPermission[]Permissions already declared with withExternalApiPermissions.
EntraIdApplicationResource
Declares permissions to a Microsoft first-party or other API that is not an Aspire resource, such as Microsoft Graph.
withExternalApiPermissions(
api: EntraIdWellKnownApi | EntraIdCustomApi,
permissions: EntraIdExternalApiPermission[]): EntraIdApplicationResource
apiEntraIdWellKnownApi | EntraIdCustomApiA well-known API, or an API identified by its application ID and application ID URI.
permissionsEntraIdExternalApiPermission[]The permissions to declare. Each is delegated unless its type is Application.
EntraIdApplicationResource
Adds an extra query parameter to send to the identity provider.
withExtraQueryParameter(
key: string,
value: string): EntraIdApplicationResource
keystringThe query parameter key.
valuestringThe query parameter value.
EntraIdApplicationResource
Configures a pre-existing managed identity trust for token acquisition, without provisioning or assigning an identity.
withFederatedManagedIdentityCredential(
managedIdentityClientId: string,
options?: EntraIdTokenExchangeOptions): EntraIdApplicationResource
managedIdentityClientIdstringThe client GUID of a user-assigned managed identity that the registration already trusts.
optionsEntraIdTokenExchangeOptionsoptionalOptional token exchange settings.
EntraIdApplicationResource
methodwithIdTokenIssuancebuilder
Enables ID-token issuance through implicit and hybrid flows for a registration created by Aspire.
withIdTokenIssuance(): EntraIdApplicationResource
EntraIdApplicationResource
methodwithInstancebuilder
Configures the Entra ID instance URL. Defaults to `https://login.microsoftonline.com/`.
withInstance(instance: string): EntraIdApplicationResource
instancestringThe Entra ID instance URL, such as `https://login.microsoftonline.us/` for Azure Government or `https://contoso.ciamlogin.com/` for an external tenant.
EntraIdApplicationResource
methodwithOwnersbuilder
Appends an owner to both the application registration and service principal.
withOwners(ownerObjectId: string | ParameterResource): EntraIdApplicationResource
ownerObjectIdstring | ParameterResourceThe directory object GUID of a user or service principal, as a literal or parameter.
EntraIdApplicationResource
Pre-authorizes a client application to request some of this registration's scopes without any consent prompt.
withPreAuthorizedApplication(
client: EntraIdApplicationResource,
scopeNames: string[]): EntraIdApplicationResource
clientEntraIdApplicationResourceThe client application to pre-authorize.
scopeNamesstring[]The names of the scopes, added with `WithScope`, that the client may request.
EntraIdApplicationResource
methodwithRedirectUrisbuilder
Appends web redirect URIs supplied as a literal, a parameter, or an endpoint.
withRedirectUris(
redirectUri: string | ParameterResource | EndpointReference,
callbackPaths?: string[]): EntraIdApplicationResource
redirectUristring | ParameterResource | EndpointReferenceA full URI, a parameter containing comma-separated full URIs, or an endpoint. With callback paths, a parameter supplies a host instead.
callbackPathsstring[]optionalCallback paths starting with '/'. Required for an endpoint; with a host parameter, produces HTTPS URIs. Omit for full URIs.
EntraIdApplicationResource
methodwithScopebuilder
Exposes a delegated permission scope that clients can request to call this registration as an API.
withScope(
name: string,
description: string,
options?: EntraIdScopeOptions): EntraIdApplicationResource
namestringThe scope's name, which appears in the token's scp claim, such as access_as_user.
descriptionstringWhat the scope allows, shown on the consent page.
optionsEntraIdScopeOptionsoptionalOptional settings for the scope.
EntraIdApplicationResource
methodwithSendX5Cbuilder
Sends the `x5c` claim (the public key of the certificate) with token requests.
withSendX5C(): EntraIdApplicationResource
EntraIdApplicationResource
Appends a service principal owner supplied as a literal directory object GUID or a parameter.
withServicePrincipalOwners(ownerObjectId: string | ParameterResource): EntraIdApplicationResource
ownerObjectIdstring | ParameterResourceThe directory object ID of a user or service principal.
EntraIdApplicationResource
Appends a signed assertion file credential, such as an AKS workload identity token.
withSignedAssertionFile(filePath?: string): EntraIdApplicationResource
filePathstringoptionalThe token file path on the consumer. Omit to use the consumer's AZURE_FEDERATED_TOKEN_FILE setting.
EntraIdApplicationResource
methodwithSignInAudiencebuilder
Configures which accounts can sign in to this application.
withSignInAudience(signInAudience: EntraIdSignInAudience): EntraIdApplicationResource
signInAudienceEntraIdSignInAudienceThe accounts that can sign in. It must match the "Supported account types" setting of the app registration.
EntraIdApplicationResource