Migrating from Azure API for FHIR to HAPI FHIR: what the move involves
A team running FHIR data on Azure API for FHIR has to leave a service that is being retired and move that data onto infrastructure it controls. Azure API for FHIR is deprecated, so the move is no longer optional on the vendor's timeline, and the team needs a self-hosted FHIR server that can take over the same resources, searches and applications. The short answer on effort is that the data move is usually the simpler part. The parity work (search parameters, profiles, operations) and the authentication and cutover changes drive most of the effort, because those are where connected applications quietly depend on behavior the new server must reproduce.
The scope depends on four things that you should measure before any quote: the volume of data to export and load, the FHIR versions in use, any custom operations or extensions the current service exposes, and the number of applications that call the server. Each one changes the work. A large store with several FHIR versions needs more load validation and version alignment. Custom operations need to be rebuilt as HAPI FHIR providers or interceptors. Every connected application needs its authentication, token scopes and search behavior checked against the new server. Ask the vendor or your own team to produce an inventory of these four items first, because it determines the shape of the plan.
DeployOpen plans the move in a written, fixed scope that names the deliverables, the parity tests, the cutover steps and the acceptance criteria before work starts. Confirm with your team which Azure identity setup, export storage account and downstream systems must be covered, and which parts of the current service you will retire rather than replace. The HAPI FHIR JPA server introduction describes the server capabilities that the target design will rely on, and you should review them against your inventory before agreeing on scope.
Which Azure API for FHIR capabilities map to HAPI FHIR and which need redesign
This table compares common Azure API for FHIR capabilities with what HAPI FHIR documents as building blocks, and marks where your team must build or configure the equivalent. Confirm each row against the Azure version you run and the HAPI FHIR version you pin, because documented building blocks are not the same as feature parity.
| Capability | Azure API for FHIR (source) | HAPI FHIR (target) |
|---|---|---|
| FHIR REST API and resource types | Managed FHIR R4 endpoint; confirm the versions and resource types your instance exposes | JPA server covers DSTU2, DSTU3, R4, R4B and R5; confirm the version you pin and any resource gaps |
| Search parameters | Standard search plus any custom search parameters configured on the source service | Standard search is provided; custom search parameters must be re-declared and reindexed on the new server |
| $export operation | Bulk export writes NDJSON to Azure Storage; confirm the export scope and storage settings you use | Bulk export is a server feature to verify in your version; the export target and storage wiring are yours to build |
| Authentication | Managed by Azure AD (Microsoft Entra ID) integration on the service | No single security layer; you configure an authentication interceptor and connect an external identity provider |
| Custom authorization and access rules | Role-based access configured through the managed service and Azure role assignments | AuthorizationInterceptor and consent or search narrowing interceptors are building blocks; policies must be written and tested |
| Profiles and validation | Profile and validation behavior of the managed service; confirm which IGs were loaded | Validation and IG package installation are documented; you choose, install and test each implementation guide |
| Audit logging | Audit records provided by the managed platform and Azure monitoring; confirm retention and export | BALP audit logging is documented as a building block; log storage, retention and review are your responsibility |
| Multitenancy and data separation | Separation depends on how you provisioned services and accounts; confirm your current model | JPA partitioning assigns resources to partitions for multitenancy or regional grouping; the design is yours to plan |
Which documented export and import paths the move can use
Moving from Azure API for FHIR to a self-hosted HAPI FHIR server usually combines a bulk export, an NDJSON transfer, a bundle-based load and a production database choice. Each path has a distinct job and limits, so confirm the exact options in your chosen HAPI FHIR version before you plan the cutover around them.
Bulk $export to storage
The source server's bulk $export operation writes resources to storage as NDJSON files, grouped by resource type. Confirm with your Azure API for FHIR configuration which export options and destination storage the service supports for your account, and whether the export covers every resource type your data uses. Check the export's completion status and file count before you treat it as a complete copy, because a partial export is the most common source of a silent data gap.
NDJSON files as the transfer format
NDJSON stores one FHIR resource per line, which makes files easy to split, count and re-read during a load. It does not carry load order or validation, so the target must resolve references and reject malformed lines itself. Plan to keep the export files immutable once they are copied to your environment, so that counts and checksums stay comparable across retries.
Transaction and batch bundles
FHIR transaction bundles send many resources to the HAPI FHIR REST API in one request, and the server applies them together or not at all. Batch bundles process entries independently, which suits loads where a single bad resource should not stop the rest. Test bundle size and ID preservation on a sample first, because conditional creates and reference rewriting can change IDs if they are used carelessly. Confirm whether your HAPI FHIR version offers a dedicated bulk import path before you build around one.
HAPI JPA server starter deployment options
The hapi-fhir-jpaserver-starter project can run as the hapiproject/hapi Docker image, through Docker Compose, with Spring Boot, as a WAR on Tomcat, Jetty or Wildfly, or on Kubernetes with a Helm chart. Choose the option your platform team already operates, since the migration window is a poor time to learn a new runtime. Confirm the Java requirement for your target version, because HAPI FHIR 8.2.0 requires JDK 17.
PostgreSQL or SQL Server for production
The starter defaults to an embedded H2 database, which is suitable for trials only. For production, PostgreSQL and Microsoft SQL Server are the supported choices, and the database sizing, backup and failover plan should be set before the load starts. MySQL is not supported by the starter, so it cannot be used as a substitute. Ask your team to confirm the exact database versions your chosen HAPI FHIR release supports.
How data moves from Azure to HAPI FHIR during the parallel run
The diagram starts with the source FHIR service inside the Azure tenant, where a bulk $export writes NDJSON files to storage in the same tenant. Those files cross the trust boundary into the client's infrastructure, where a load step converts them into transactions for the HAPI FHIR JPA server and its PostgreSQL or SQL Server database. Before any traffic moves, a validation and count comparison checks both sides. During the parallel run, client applications read from both systems, so teams can compare results before the traffic switch.
Data path from the Azure source through the load step to HAPI FHIR during parallel running.
Which search parameters and profiles need a parity check before cutover
Applications depend on exact search behavior, so a parity check should start before any data moves. Inventory every resource type your applications read or write, every search parameter they send, and every profile and validation rule the Azure API for FHIR enforced on writes. Then compare that list with what your HAPI FHIR server serves, using its CapabilityStatement as the starting point. Pay particular attention to custom search parameters that were registered in the Azure service, since they must be recreated on HAPI FHIR before any query that uses them can return the same results. Confirm which FHIR version each side uses and which implementation guides are loaded on each, because a profile missing on one side can change what a conformant server accepts or returns.
Build a test set of real queries from application logs and integration configurations, and run each one against both servers. Include the patterns that most often differ: _include and _revinclude chains, paging behavior controlled by _count and the bundle next links, sort order, chained searches, and modifiers such as :exact or :missing. For each query, record the result counts, the resource IDs returned, the included resources, and any OperationOutcome warnings. Store the differences in a table with the query, the expected behavior, the observed behavior and the owning application. Expect some differences to come from paging defaults and sort order rather than from data, so normalize those before deciding a query has failed. Check the HAPI FHIR documentation for the version you deploy, and confirm each behavior in your own environment rather than assuming it carries over.
The decision on each difference belongs to the team that owns the application, not to the migration team. A migration engineer can explain why a result changed, but only the application owner can decide whether to change the client query, accept the new behavior, or ask for a server-side fix such as a registered search parameter or a stricter validation rule. Record that decision next to each difference and make the parity sign-off a cutover gate. Queries marked as accepted differences should be rerun after every load, because a change in data or configuration can reopen a difference that was closed earlier.
How authentication changes depending on the identity setup
Keeping Microsoft Entra ID as the token issuer is the lowest-change path for client applications that already obtain tokens from Entra ID. The HAPI FHIR server stays a resource server: it validates the signature, issuer, audience and expiry of each bearer token, and it does not issue tokens itself. Azure API for FHIR often sat behind this same pattern, so applications may need only an endpoint change, but you should confirm that every client still requests the audience your server expects.
- Client applications: Confirm whether clients call the server with their existing Entra ID tokens or whether the audience value must change.
- Token audiences and scopes: Set the expected audience to the value your server registration uses. Scopes that Azure API for FHIR used may not map one to one onto the scopes you define for HAPI FHIR, so list them before cutover.
- SMART on FHIR configuration: Publish the authorization and token endpoints in the SMART configuration document only if you use SMART apps, and point them at the Entra ID endpoints you intend to keep.
- Token validation: Configure the authentication interceptor in the server so that only tokens from the approved tenant and audience are accepted.
- Audit logging with BALP: Enable the Basic Audit Log Pattern so that each read, search and write records the caller identity, which the Entra ID token supplies.
Before cutover, ask your security team to confirm the token lifetime, the tenant restrictions and which role claims the server will rely on for access decisions.
Moving to a different OpenID Connect provider that the organization already runs changes the token issuer for every client. This setup often makes sense when the organization has standardized on a corporate identity platform, or when Azure API for FHIR was the only reason Entra ID was in the FHIR path. Every client must be re-registered with the new provider, and the server must trust the new issuer and its signing keys. Plan this as an identity migration in its own right, separate from the data move.
- Client applications: Each client needs a new registration, new redirect URIs and new client secrets or certificates, and users may need to sign in again.
- Token audiences and scopes: Define a new audience for the FHIR server and map the provider's scopes to the SMART scopes your applications request, such as read and write permissions for specific resource types.
- SMART on FHIR configuration: Update the SMART configuration so that the authorization and token endpoints match the new provider, and verify the discovery document the server publishes.
- Issuer trust: Configure the server to accept only the new issuer and confirm how key rotation is handled, since a stale key cache causes failed logins.
- Audit logging with BALP: Confirm that the subject claim the server records is stable and unique in the new provider, so audit entries can be matched to people over time.
Ask your identity team to confirm the claim names, the group or role mapping and the procedure for revoking access before you finalize the design.
Running authorization inside the server uses the AuthorizationInterceptor together with consent and search narrowing interceptors. The identity provider still authenticates the user, but the HAPI FHIR server decides which resources, compartments and operations each caller may access. HAPI FHIR provides these as building blocks rather than one complete security layer, so the rules, testing and governance are your responsibility. This setup suits cases where access depends on patient, organization or data partition rules that a token scope alone cannot express.
- Client applications: Clients may keep their current tokens, but the server will reject requests that fall outside the rules you write, so test each application against realistic user roles.
- Token audiences and scopes: Scopes can still gate broad access, while the AuthorizationInterceptor applies finer rules, such as compartment membership or resource-type limits.
- SMART on FHIR configuration: Keep the SMART configuration aligned with the rules, and document which launch contexts and scopes the server actually enforces.
- Consent and search narrowing: Use consent interceptors for patient-level restrictions and search narrowing interceptors so that searches return only permitted results, including for chained and included resources.
- Audit logging with BALP: Log both allowed and denied access so that auditors can see who attempted each action, and test that denied requests appear in the log.
Before go-live, have your security team review the rule set, run negative tests for each role and confirm the design against your own compliance obligations.
The migration sequence from inventory to decommissioning the Azure service
The sequence moves a FHIR workload from Azure API for FHIR to a self-hosted HAPI FHIR server in five phases, with a client-side input and a verifiable exit check at each one. The end state is a decommissioned Azure service with its data retention and audit evidence kept.
Inventory resource types, volumes and client dependencies
The client team provides a list of resource types in use, approximate resource counts per type, the FHIR version and any profiles or implementation guides the data conforms to, the search parameters applications rely on, and every client app with its authentication flow. DeployOpen maps these against the target HAPI FHIR JPA server's supported FHIR versions and the search and validation behavior that must be matched. The step is done when the team signs off a written inventory that names each gap, such as a custom search parameter or profile that must be recreated before load.
Run a pilot load of a representative subset
DeployOpen exports a representative subset of resources from the Azure service to storage, loads it into a non-production HAPI FHIR instance, and checks resource counts and reference integrity against the source. The client team confirms which patient cohorts and resource types are representative, and which application workflows should be exercised against the pilot. The step is complete when counts match per resource type, unresolved references are explained or fixed, and the load steps are documented well enough to repeat at full scale.
Execute the full export, load and validation run
The full $export runs against the Azure service, the NDJSON files are loaded in the order defined during the pilot, and the results are validated for completeness and conformance. The client team provides a change window for the source if writes continue, a decision on how writes made after the export starts will be captured, and access to the storage account holding the export files. The step closes when full counts, reference checks and profile validation results are recorded and reviewed by the client's data owners.
Run both servers in parallel and compare results
Reads and writes are sent to both servers, and responses are compared for the same queries, including search results, paging and resource content. The client team provides a set of representative test queries, the applications to be switched first, and owners for each open risk, such as authentication differences or client search behavior. The phase exits when the discrepancy list is empty or each remaining item has an accepted fix and a named owner, and the client's security team has approved the authentication and authorization setup on HAPI FHIR.
Cut over clients to HAPI FHIR
Client applications are repointed to the HAPI FHIR endpoint, the Azure service is set to read-only or taken out of the write path, and final delta data is reconciled. The client team provides the change plan, rollback criteria, and sign-off from application owners who confirm their workflows. The step is done when production traffic is confirmed on HAPI FHIR, reconciliation counts match, and the rollback path has been tested or explicitly accepted as is.
Decommission the Azure service with retention and audit evidence
After a stable period agreed by the client, the Azure API for FHIR instance is removed, but the exported files, load logs, validation reports, comparison results and access records are kept under the client's retention policy. The client team decides the retention period with its legal and compliance owners and confirms where evidence is stored. The step is complete when the decommission record lists what was deleted, what was retained, where it sits, and who approved each action.
What drives the cost and duration of the migration
This table lists the factors that move the effort and recurring cost of leaving Azure API for FHIR for a self-hosted HAPI FHIR server, with what to ask for in a quote. No price or duration is given here because both depend on the written scope, so use the rows to build that scope before comparing offers.
| Driver | Why it matters | What to ask for in a quote |
|---|---|---|
| Data volume and resource mix | Export size, resource types and history depth set export time, load time and storage. Large Observation or DocumentReference counts usually dominate the load window. | Resource counts by type, total export size, history retention to keep, and the load method and throughput assumed |
| Connected applications and custom operations | Each app that reads or writes FHIR, and each custom $operation, needs a retest against HAPI FHIR. Azure-specific extensions have no direct equivalent. | Inventory of connected systems, list of custom operations, and the test scope for each application |
| Search parameter and profile parity | Custom search parameters, SearchParameter resources and profiles must be recreated and verified. Gaps appear as silent query differences. | Search parameter and profile inventory, how parity is verified, and which queries are compared before cutover |
| Authentication redesign | Azure AD token handling, role mapping and SMART scopes move to an identity provider you run. HAPI FHIR offers building blocks, not a complete security layer. | Identity provider choice, scope and role mapping, audit logging design, and who approves the access model |
| Number of environments | Each environment needs its own database, configuration, identity setup and data load. Lower environments can slow the schedule when they are rebuilt by hand. | Environments in scope, whether they are built from code, and the data refresh process for test environments |
| Parallel-run length and comparison tooling | Running Azure and HAPI FHIR side by side means paying for both platforms and comparing results. Automated comparison of counts and query results reduces manual review. | Parallel-run duration as agreed by you, comparison scripts or tools, and the criteria for cutover |
| Database and hosting choices | PostgreSQL and Microsoft SQL Server are supported for production, and H2 is the default embedded option. Choice affects backup, high availability and patching effort. MySQL is not supported. | Database engine and version, high availability design, backup and restore tests, and the hosting model in your cloud or data center |
| One-time versus recurring costs | One-time work covers analysis, loading, parity testing, identity setup and cutover. Recurring costs cover hosting, database operations, HAPI FHIR upgrades, monitoring and support. | Separate one-time and recurring lines, with the upgrade and support model for the years after cutover |
What usually goes wrong in Azure to HAPI FHIR moves and how to prevent it
Most failures in a move from Azure API for FHIR to a self-hosted HAPI FHIR server surface after cutover, when a client notices a changed result or a rejected token. The cards below cover six failure points, each paired with a control to put in place before the source is switched off.
Search behavior changes after cutover
Queries that worked against the managed service can return different result sets on HAPI FHIR because search parameters, modifiers and sort behavior depend on what the server has indexed. Teams often find this only when a clinical app or report returns fewer or different records. Build a query parity suite from the real query log of the source, run it against both servers, and compare result counts and identifiers for each search parameter your applications use. Confirm which search parameters the target supports for each FHIR version you load.
Broken references from load order
Resources that point to other resources, such as an Observation referencing a Patient, fail or silently dangle when they are loaded before their targets. Bulk loads from NDJSON files are especially exposed because the files are not guaranteed to follow dependency order. Define load-order rules by resource type, load reference targets first, and run a reference integrity check after each stage that lists every unresolved reference by resource type. Treat any unresolved reference as a blocking defect.
Missing profiles and validation
The managed service may have accepted resources that the applications expect to conform to specific profiles, and a plain load into HAPI FHIR may store them without the validation or implementation guide packages those apps assume. Inventory the profiles your consumers declare in resource meta and the validation rules they rely on, install the matching implementation guide packages on the target, and validate a sample of each resource type before the full load. Record which failures are expected and which are migration defects.
Tokens rejected after the switch
Applications and integrations authenticate against Microsoft Entra ID with audiences and scopes configured for the managed service, so tokens are often rejected by a self-hosted server that expects different issuers, audiences or roles. Failures appear as 401 or 403 responses in only some clients. Run a staged authentication test with each client application against a non-production HAPI FHIR instance, confirm issuer, audience and scope claims, and document the access rules you configure with the AuthorizationInterceptor before cutover.
Incomplete exports found late
A $export to storage can finish with a status that looks successful while some resource types, batches or files are missing or truncated. If the gap is found after the source is shut down, recovery depends on access you no longer have. Compare resource counts per type between the source and the loaded target, check every NDJSON file listed in the export manifest, and keep the export output in retained storage until the counts match and the cutover is signed off.
Audit evidence lost at shutdown
When the Azure API for FHIR instance is decommissioned, its diagnostic logs, access records and audit trails may go with it, leaving a gap in the evidence a compliance review will request. Decide in advance which logs must be retained, where they will be stored and for how long, and who can retrieve them. Export the source audit and diagnostic logs before shutdown, keep them in storage you control, and confirm that the HAPI FHIR audit logging covers the access paths that replace the old ones. Retention periods should come from your own policy and your compliance team.
Questions teams ask before moving off Azure API for FHIR
What drives the cost of moving off Azure API for FHIR to HAPI FHIR?
The cost is driven by how much data and how many custom integrations you have, not by a fixed package. The main components are the one-time work of exporting data, building the target HAPI FHIR JPA server, matching search parameters and profiles, rewriting authentication, and testing cutover, plus the recurring cost of running the database, compute, storage, backups and upgrades in your own infrastructure. Costs rise with the number of resource types, custom search parameters, bespoke operations, and downstream systems that depend on the Azure endpoint. Ask any partner for a quote built from a written scope that lists these items separately, and ask which costs recur after go-live. DeployOpen does not publish prices; a quote follows from the agreed scope.
How long does a migration from Azure API for FHIR take?
Duration depends on data volume, how many FHIR versions and profiles are involved, how many applications call the server, and how strict the cutover window must be. Export and load throughput, validation of counts, and the time needed to reproduce behavior your applications rely on often set the critical path more than the server installation does. Authentication changes and the number of clients to reconfigure can also add time. Ask for a timeline that is tied to named milestones, such as a parity test pass and a rehearsed cutover, rather than a single end date. Confirm your own export size and the current state of the Azure service with your team before agreeing a schedule.
What does our team need to provide for the migration?
You will need to provide access to the existing Azure API for FHIR instance and the storage account that receives $export output, the list of client applications and their authentication methods, and the FHIR profiles, implementation guides and custom search parameters in use. You should also supply the target infrastructure details: cloud account or data center, network routes, database and backup standards, identity provider, and the people who approve changes and cutover. Named owners for application testing and a clinical or business sign-off process are also necessary. Ask the partner to produce a written list of inputs at the start, so gaps are found before the build begins.
Can an internal team migrate from Azure API for FHIR without a partner?
An internal team with FHIR, Java and database operations skills can plan and carry out a migration, and HAPI FHIR is open source under the Apache Software License 2.0, so there is no license fee for the server software. The harder parts are usually the parity work, the verification of data completeness, and the operational responsibilities that move to your side, including upgrades, backups, security controls and monitoring. Consider whether your team has the time and experience to cover these alongside its normal duties. A partner can take a defined part of the work, such as the build or the verification, while your team keeps ownership of decisions. Compare both options against a written scope.
Do both systems need to run in parallel during cutover, and for how long?
Running both systems in parallel is common when clients cannot tolerate downtime or when data must be reconciled after the initial load. The length of the overlap depends on risk: how many applications write to the server, how quickly you can detect and correct differences, and how easily you can roll back. Read-heavy systems with a short, well-rehearsed switch may need little overlap, while systems with ongoing writes need a plan for synchronizing changes made after the export. Agree the rollback criteria and the overlap period in writing before cutover, and confirm the write behavior of your applications during the switch.
How do we check that the migrated data is complete?
Completeness checks compare resource counts by type between the Azure export and the HAPI FHIR server, then sample individual resources to confirm that IDs, references, versions and key fields survive the load. Load order matters because references must resolve, so verification should also look for dangling references and failed entries in the load logs. Include checks for search results on common queries, not just totals, because a count match does not prove that searches return the same records. Ask for the verification method, the acceptance criteria and the list of reports that will be delivered before any sign-off.
Can HAPI FHIR match Azure API for FHIR behavior exactly?
Exact matching is unlikely to be the right goal, because the two services are different products with different internal designs, configuration models and extensions. The practical goal is parity for the behavior your applications depend on: the resource types and FHIR version in use, the search parameters clients call, the profiles that validation enforces, the authentication flows, and the response shapes for the operations you rely on. Make a written inventory of those behaviors from your own logs and client code, then test each item on the new server. Where the Azure behavior cannot be reproduced, record the difference and agree how the affected clients will change. Confirm the Azure service's documented features and limits with Microsoft before you set the parity list.
What happens to the exported data after the migration?
The $export files written to your storage account remain your data and are subject to your own retention and deletion policies, so you should decide how long they are kept, where they are stored and who can access them. Keep them until the cutover is verified and the rollback window has closed, then delete or archive them under documented procedures. Confirm with Microsoft how the Azure service handles data after you stop using it, and confirm the deletion steps for the Azure instance itself. Your compliance and privacy teams should review the retention decision, because exported files often contain protected health information.
How DeployOpen scopes, delivers and supports the migration
DeployOpen plans and runs the move from Azure API for FHIR to a self-hosted HAPI FHIR JPA server inside your own Azure subscription, data center or network. The work starts with a written scope that covers export, load, parity testing and cutover, so your team knows what is delivered before any change is made.
How we scope
- Inventory the Azure API for FHIR workspace, FHIR version, resource counts, custom search parameters and profiles in use.
- Agree in writing which resource types, export paths and client applications are in scope for the migration.
- Define the target HAPI FHIR version, JDK 17 runtime and PostgreSQL or SQL Server database before build starts.
How we build
- Set up the export to your storage account and load NDJSON into HAPI FHIR with preserved IDs and references.
- Compare search parameters, profiles and authentication behavior against the current service using agreed test queries.
- Reconcile resource counts and test the cutover runbook, including rollback, in a non-production environment first.
How we hand over
- Document the deployment, configuration keys, authentication settings and the parity test results for your team.
- Walk your engineers through the cutover runbook and the checks used to confirm data completeness.
- Deliver the written findings, open items and decisions so your compliance and security reviewers can assess the new system.
How we support
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer after cutover.
- Confirm with your team which post-cutover support, monitoring and upgrade responsibilities should sit in the retainer.

