-
Notifications
You must be signed in to change notification settings - Fork 518
Build and debug locally
Brendan Kowitz edited this page Dec 6, 2023
·
10 revisions
- Install your favorite editor (VS 2019, VS Code)
- Install the Cosmos DB Emulator: https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator
- Install the Azurite Storage Emulator: https://learn.microsoft.com/azure/storage/common/storage-use-azurite (also included with Visual Studio: https://learn.microsoft.com/azure/storage/common/storage-use-azurite?tabs=visual-studio#azurite-executable-file-location)
- Install SQL Server Developer: https://www.microsoft.com/en-us/sql-server/sql-server-downloads
git clone https://github.com/Microsoft/fhir-server
- Install .Net core SDK version as listed in the global.json file (
fhir-server/global.json
, and backwards compat versionfhir-server/build/dotnet6-compat/global.json
) https://dotnet.microsoft.com/en-us/download/dotnet
- The solution should now build without errors
- Ensure the Cosmos DB Emulator and Storage Emulator are running
- Open Microsoft.Health.Fhir.sln, set Microsoft.Health.Fhir.R4.Web (or Microsoft.Health.Fhir.Stu3.Web) as StartUp Project, and press F5
- If you get a timeout error with respect to initializing the DocumentClient (which is used to talk to the Cosmos DB instance) make sure Cosmos DB emulator is running and you are able to access it normally. If it still does not work, create an actual Cosmos DB instance on Azure and update the Host and Key properties in appsettings.json file
- Launch a web browser and navigate to
https://localhost:44348
. If the web page shows a HTTP 401 error, that is expected. As long as you are able to hit the metadata endpoint (https://localhost:44348/metadata?_format=json&_pretty=true) it means that the server is running. - (Optional) If you would like to debug locally without the need to fetch an auth token, you can disable the "FhirServer:Security:Enabled" setting in the "appSettings.json" file.
- From here we recommend looking at the example FHIR HTTP Requests in the docs/rest folder such as the SearchExamples.
Our service is built on ASP .NET Core. In case you are not already familiar with the framework, the following resource(s) might be a good place to start.
- The official documentation for our product - https://docs.microsoft.com/en-us/azure/healthcare-apis/
- Microsoft docs - https://docs.microsoft.com/en-us/aspnet/core/fundamentals/
- Pluralsight