-
Notifications
You must be signed in to change notification settings - Fork 560
Build and debug locally
Brendan Kowitz edited this page Feb 8, 2022
·
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 Azure Storage Emulator: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator
- 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) https://dotnet.microsoft.com/en-us/download/dotnet
- The solution should now build without errors
- Ensure the Cosmos DB Emulator and Azure 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
- This will launch a web browser
- 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
- 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