microsoft / microsoft/fhir-server
Base url used in responses from FHIR service use internal urls when behind an Application Gateway
Nobody has claimed this yet.
- Dominant language
- TSQL
- Stars
- 1.4k
- Forks
- 592
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 41
Description
**Describe the bug**
We have a FHIR server running in an Azure Health Data Services workspace. The FHIR server is not accessible directly, all requests are routed through a public endpoint at an Application Gateway. This means the url of the FHIR server is not exposed or usable externally. When we make requests to the FHIR server via the application gateway, the responses contain hateoas links to things like the next page of search results, but those links are using the internal url and therefore do not work. Is it possible to configure the FHIR server or the Application Gateway so that those urls use the correct external base url?
We've tried various options in the gateway backend settings for "Host name - Override with new host name". If we select No then every request returns 502 Bad Gateway.
If we select Yes and choose a specific Host Name other than the host name of the backend FHIR service i.e. xxx.fhir.azurehealthcareapis.com we get 502 Bad Gateway
If we select Yes and set the Host Name to the host name of the backend FHIR service then we get a correct response, but all the links in the response are internal links.
**FHIR Version?**
R4
**Data provider?**
SQL Server (Azure Health Data Services FHIR Service so inaccessible to us)
**To Reproduce**
Steps to reproduce the behavior:
1. Configure an Azure Application Gateway to route requests to an Azure Health Data Services FHIR service
2. Make a FHIR search query to the Gateway front end url
3. Inspect the next and current properties of the response
**Expected behavior**
The next and current properties should be in the form https://my-external-url.com/
**Actual behavior**
The next and current properties are in the form https://xxx.fhir.azurehealthcareapis.com/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file, test, or code entry point is named. Reproduce the setup with an Azure Application Gateway in front of the FHIR service, compare the gateway host-name override settings, and inspect the response's next and current links; done means those links use the external gateway URL without causing 502 responses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, sql
- Domain
- api, backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100