Search code examples
azurehl7-fhirfhir-server-for-azure

Authentication error when requesting FHIR resource from Azure FHIR Services


I have deployed Healthcare Workspace and HFIR Service to Azure. I successfully get capability statement and access token.

I'm failing with Get FHIR resource request to get Patient list by Postman. I can see that this request connects to right App registration by correct secret.

I wonder if API permission of App Registration is correct: I have given "Azure Healthcare APIs", which has url https://fhir.azurehealthcareapis.com

However Postmain is requesting: https://healthcareworkspace-my123demo.fhir.azurehealthcareapis.com

I wonder where is problem?

https://learn.microsoft.com/en-us/azure/healthcare-apis/fhir/using-postman

Get: {{fhirurl}}/Patient

 {
    "resourceType": "OperationOutcome",
    "id": "1111d698deb63c41b7b0a6731a527b15",
    "issue": [
        {
            "severity": "error",
            "code": "forbidden",
            "diagnostics": "Authorization failed."
        }
    ]
}

Solution

  • You will also need to assign an application role such as "FHIR Data Contributor" to the client app to access the FHIR service. More info at https://learn.microsoft.com/en-us/azure/healthcare-apis/fhir/configure-azure-rbac-for-fhir