Azure / Azure/data-api-builder

Challenges with Data API Integration through Azure Front Door

Offen
#2,488 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
known-issue
Vorherrschende Sprache
C#
Sterne
1.5k
Forks
370
Ø Merge
3 T. 22 Std.
Gemergte PRs (30 T.)
9

Beschreibung

**Issue Summary**
We are currently facing multiple issues with integrating our Data API, hosted as an Azure App Service Linux Container, with Azure Front Door. Below are the details of the setup and the specific issues encountered.

**Setup Details**
1. Data API Hosting: The Data API is hosted as an Azure App Service Linux Container.
2. Database: The Data API uses an Azure SQL database.
3. Routing via Front Door: Azure Front Door is used to expose the Data API. The route configuration in Front Door is as follows:
- Route: `/api/` maps to the backend `/api`, which is the Azure App Service hosting the Data API.
4. Client apps are outside our domain so manipulations from the client apps are not possible.

**Issues Identified**
1. Root Route Issue
- Problem:
- The Data API has a route `/` (root) used as the status page. This conflicts with the need to host multiple APIs with distinct paths (e.g., `/api`, `/api2`, `/api3`) through Azure Front Door.
- Direct access to `/` for the Data API does not align with our multi-API architecture.
- Potential Solution:
- Expose the status page of the Data API at `/api/status` instead of `/`. We need guidance on how to implement this change or if there’s an alternative approach to handle this scenario.
2. Swagger Documentation Access
- Problem:
- The Data API hosts Swagger documentation on the endpoint `/swagger`. When accessed through Front Door (`/api/swagger`), the initial request is routed correctly to the App Service. However, the OpenAPI URL triggers a second redirect, resulting in an error indicating that the OpenAPI path is not found.
- Potential Solution:
- Advice is needed on how to handle secondary redirects through Azure Front Door or how to configure the Data API to avoid such issues.
3. Pagination URL Issue
- Problem:
- When the first request to the Data API is made, a pagination URL is returned in the response. This URL points to the static endpoint of the App Service.
- Subsequent requests using this static endpoint fail when routed through Azure Front Door.
- Potential Solution:
- The Data API seems unaware of being behind Azure Front Door. Can the pagination URL generation logic be updated to return the Front Door endpoint instead of the static App Service URL? If so, what would be the recommended approach?

**Expected Outcome**
- Status Page: Ability to access the Data API status page through a route like `/api/status` while maintaining compatibility with other APIs hosted via Front Door.
- Swagger Documentation: Successful access to Swagger documentation through `/api/swagger`, including handling secondary redirects.
- Pagination URLs: Pagination URLs should be Front Door-aware, allowing seamless pagination requests.
Additional Context

- These issues are blocking us from hosting multiple APIs behind Azure Front Door efficiently.
- Any advice, workarounds, or updates to the Data API configuration to address these issues would be highly appreciated.

Thank you!

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Der Bericht behandelt das Azure-Front-Door-Routing für die Root-Statusseite, den Swagger-Endpunkt und die Paginierungs-URLs der Data API. Beginne damit, jeden Pfad über Front Door zu reproduzieren und ihn mit dem direkten Zugriff auf App Service zu vergleichen. Als abgeschlossen gilt die Aufgabe, wenn die Statusseite, Swagger einschließlich seiner OpenAPI-Anfrage und alle Paginierungslinks über die `/api`-Route funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, sql
Bereich
api, backend, cloud, networking
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.