# EntraIdApplicationResource.WithApplicationIdUri

- Module: [Aspire.Hosting.Azure.EntraId](/reference/api/go/aspire.hosting.azure.entraid.md)
- Defined on: [EntraIdApplicationResource](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md)
- Version: `17.0.0-preview.1.26567.5`
- Kind: `method`

Exposes the registration as an API identified by an application ID URI.

## Remarks

For a registration created by Aspire, the URI is written to the registration and must be unique in the tenant. The default api://{clientId}
form is set by a second update of the registration, after Microsoft Graph creates it, and is accepted by the tenant's default policy.
A custom URI fails deployment if the tenant's policy rejects it. For an existing registration, the URI is configuration only: Aspire does not
modify the registration, and getScopeUri uses the URI to build scope names for callers. Existing registrations require an explicit URI;
omitting it throws instead of inferring the registration's URI.

## Definition

```go
type EntraIdApplicationResource interface {
    // ... omitted for brevity
    WithApplicationIdUri(options ...*WithApplicationIdUriOptions) EntraIdApplicationResource
}
```

## Signature

```go
WithApplicationIdUri(options ...*WithApplicationIdUriOptions) EntraIdApplicationResource
```

## Parameters

- `options` (`...*WithApplicationIdUriOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithApplicationIdUriOptions` argument.

- `ApplicationIdUri` (`*string`) -- A custom URI, such as api://contoso-orders or https://contoso.onmicrosoft.com/orders. Omit to use the default api://{clientId}.

## Returns

[`EntraIdApplicationResource`](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md) -- The registration builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [EntraIdApplicationResource](/reference/api/go/aspire.hosting.azure.entraid/entraidapplicationresource.md) -- `handle`
