EntraIdApi Methods
ClassMethods1 member
Identifies an API that is not modeled as an Aspire resource, such as Microsoft Graph, by its well-known application ID.
FromApplicationId(string, string, string, string?) Section titled FromApplicationId(string, string, string, string?)staticEntra Identifies another API, whose service principal must exist in the tenant, by its application ID.
public sealed class EntraIdApi{ public static EntraIdApi FromApplicationId( string displayName, string applicationId, string resourceUri, string? baseUrl = null) { // ... }}Parameters
displayName stringA name for the API used in diagnostics and as the name of its DownstreamApis entry (its letters and digits).applicationId stringThe API's application (client) ID, as a GUID.resourceUri string The API's application ID URI, the prefix of its scopes in token requests, such as api://contoso-orders or https://contoso.onmicrosoft.com/orders . It is shown as "Application ID URI" on the API's registration. It is not derived from applicationId because an API can use any URI. baseUrl string?optional The API's root URL, such as https://graph.microsoft.us , which Aspire adds to the DownstreamApis entry as BaseUrl . When null, no BaseUrl is set and the caller must supply the address itself. Returns
EntraIdApi The API. Its permissions must be requested with explicit IDs.Exceptions
ArgumentExceptionapplicationId is not a GUID, resourceUri is not a valid application ID URI, or baseUrl is not an absolute HTTP or HTTPS URL.