Domien Van Steendam Thanks for sharing the additional details. Since you already know how to use DefaultAzureCredential in Azure App Service (DefaultAzureCredential.GetToken() to retrieve the access token), I will focus on Firely SDK part of the question.
Looking at the code snippet, it appears Authorization
header was not added to FhirClient
class and hence error 401 Unauthenticated
was thrown. Check out Message Handlers doc and you would need to add a custom handler to FhirClient
which should add Authorization
before making the request. The doc has a code snippet to specifically add Authorization
header and you can also add additional headers if needed.
If you have any more questions about the usage of firely-net-sdk, I suggest you posting it in repo: Issues and for Discussions. I hope this helps and let me know if you have any questions.
If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.