“Why does my Azure FHIR $import job show resources as successfully imported (count > 0) but when I query the FHIR API the resources don’t exist — is this an $import commit/indexing issue?”

Avanish Jain 0 Reputation points
2025-09-05T08:39:10.1366667+00:00

We are bulk importing FHIR resources (Patient, Practitioner) from Azure Data Lake Storage (ADLS) into an Azure API for FHIR workspace using the $import operation. The import job completes successfully and reports the expected counts, but when we query the FHIR service afterwards, the resources are not found (total = 0).

What We See

  • Import Status Response (example)
{
  "transactionTime": "2025-09-04T10:11:32.473+00:00",
  "request": "https://<workspace>.fhir.azurehealthcareapis.com/$import",
  "output": [
    {
      "type": "Practitioner",
      "count": 10,
      "inputUrl": "https://<storageaccount>.blob.core.windows.net/adls-to-fhir/care_manager_fhir/care_managers_batch_1.ndjson"
    }
  ],
  "error": []
}

Job completes with correct counts (Imported Practitioner resources: 10).

When validating via GET {{FHIR_URL}}/Practitioner?_count=10 → response shows:

{ "resourceType": "Bundle", "total": 0, "entry": [] }

Direct read via GET {{FHIR_URL}}/Practitioner/{id} also returns 404 Not Found.

Additional Info

Import configuration in workspace:

"importConfiguration": {
  "enabled": true,
  "initialImportMode": false,
  "integrationDataStore": "<storageaccount>"
}

Using UUIDs for every resource id (auto-generated, always unique).

Import manifest example:

{
  "resourceType": "Parameters",
  "parameter": [
    { "name": "inputFormat", "valueString": "application/fhir+ndjson" },
    { "name": "input", "part": [
        { "name": "type", "valueString": "Practitioner" },
        { "name": "url", "valueUri": "https://<storageaccount>.blob.core.windows.net/adls-to-fhir/care_manager_fhir/care_managers_batch_1.ndjson" }
      ]
    }
  ]
}

If we POST a single Practitioner/Patient via the FHIR REST API, it works fine and the resource is retrievable.

Error logs container (import-error-logs) is empty.

Expected Behavior

After $import reports success with count > 0, resources should be retrievable via FHIR REST API (GET /Patient, GET /Practitioner).

Actual Behavior

Resources are not retrievable (total=0 or 404) even though import shows success.

Question

Has anyone else faced this issue where $import reports success but resources are not accessible afterwards? Is this related to the $import commit/indexing behavior, and how can we reliably ensure imported resources are available?We are bulk importing FHIR resources (Patient, Practitioner) from Azure Data Lake Storage (ADLS) into an Azure API for FHIR workspace using the $import operation. The import job completes successfully and reports the expected counts, but when we query the FHIR service afterwards, the resources are not found (total = 0).

What We See

Import Status Response (example)

{

Job completes with correct counts (Imported Practitioner resources: 10).

When validating via GET {{FHIR_URL}}/Practitioner?_count=10 → response shows:

{

Direct read via GET {{FHIR_URL}}/Practitioner/{id} also returns 404 Not Found.

Additional Info

Import configuration in workspace:

"importConfiguration":

Using UUIDs for every resource id (auto-generated, always unique).

Import manifest example:

{

If we POST a single Practitioner/Patient via the FHIR REST API, it works fine and the resource is retrievable.

Error logs container (import-error-logs) is empty.

Expected Behavior

After $import reports success with count > 0, resources should be retrievable via FHIR REST API (GET /Patient, GET /Practitioner).

Actual Behavior

Resources are not retrievable (total=0 or 404) even though import shows success.

Question

Has anyone else faced this issue where $import reports success but resources are not accessible afterwards? Is this related to the $import commit/indexing behavior, and how can we reliably ensure imported resources are available?

Azure Health Data Services
Azure Health Data Services
An Azure offering that provides a suite of purpose-built technologies for protected health information in the cloud.
{count} votes

1 answer

Sort by: Most helpful
  1. Rakesh Mishra 4,030 Reputation points Microsoft External Staff Moderator
    2025-09-09T16:25:51.07+00:00

    Hi Avanish Jain,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    The job reports that count: 10 which means 10 Practitioner resources were processed successfully, but since a direct GET /Practitioner/{id} returns 404, it’s important to check whether the data is in the history store instead of the current view.

    Could you please check below and share requested details to assist you further on this.

    1. Compare current vs. history counts

    • Run:
        GET {{FHIR_URL}}/Practitioner?_summary=count        
        GET {{FHIR_URL}}/Practitioner/_history?_summary=count        
      
    • If _history shows 10 but current count is 0 --> all resources were imported only as historical versions.

    2. Check resource history directly

    • For one of your resource IDs, run:
          GET {{FHIR_URL}}/Practitioner/{id}/_history  
      
      • If you see versions here but not with GET {{FHIR_URL}}/Practitioner/{id}, the resource exists only in history.

    3. Share one anonymized NDJSON line

    • Please provide one sample line (with PII removed).
    • Specifically check if it contains:
      • a meta block with versionId or lastUpdated, or
      • the deleted-state extension (http://azurehealthcareapis.com/data-extensions/deleted-state).
    • These can cause the resources to be imported as historical or deleted, not current.
    • Why this matters:
      • If your NDJSON includes meta.versionId or meta.lastUpdated, $import replays that history exactly, and the resources may only appear under _history unless you also import the latest version.
      • If the deleted-state extension is present, the resources are imported as deleted, so direct reads/searches return 404 (or 410) but the records remain visible in _history.
      • Reference: https://dori-uw-1.kuma-moon.com/en-us/azure/healthcare-apis/fhir/import-data#incremental-load
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.