These samples show how this toolkit works for a few sample scenarios:
- Quickstart: A simple example showing how to setup, test, and deploy a custom operation.
- Feature Samples: Small projects showing how the toolkit features work. Local only.
- UseCaseSample: A simple example showing how to setup, test, and deploy a custom operation.
- An Azure account with an active subscription.
- You need access to create resource groups, resources, and role assignments in Azure
- .NET 8.0
- Visual Studio or Visual Studio Code
- Or another code editor and proficiency with the command line
For samples that work with resources or deploy code to Azure (like the Quickstart), you will need:
- Azure Command-Line Interface (CLI)
- Azure Developer CLI
- If you are using Visual Studio:
- Azure Functions Tools. To add Azure Function Tools, include the Azure development workload in your Visual Studio installation.
- If you are using Visual Studio Code:
Use quickstart sample to see a basic end-to-end deployment of the Azure Health Data Services toolkit.
- Getting an access token for the FHIR service.
- Adding a header to audit the original requestor.
- Using a transform for a basic modification of FHIR server behavior.
- Using a pipeline with input and output filters to modify the request and response.
These samples go deep into individual feature areas of this toolkit, showing you how the individual pieces work so you can use them to build custom operations that fit your needs. These samples are not meant to be deployed to Azure, but executed on your local machine.
Sample | Description |
---|---|
Blob Channel | Shows how to use a Blob Channel. |
Custom Headers | Shows how to inject custom headers. |
Event Grid Channel | Shows how to use an Event Grid Channel. |
Event Hub Channel | Shows how to use an Event Hub Channel. |
JSON Transform | Shows how to easily transform a JSON payload. |
Memory/Blob Cache | Shows how to use a memory cache with Azure Blob storage backing. |
Memory/Redis Cache | Shows how to use a memory cache with Redis backing. |
Service Bus Channel | Shows how to use a Service Bus Channel. |
Simple External API | Shows how an external API could be used with a custom operation. |
Use UseCase sample to see a basic end-to-end deployment of the Azure Health Data Services toolkit.
- Getting an access token for the FHIR service.
- Adding a header to audit the original requestor.
- Using a transform for a basic modification of FHIR server behavior.
- Using a pipeline with output filters to modify the response.
One workaround to accommodate the OnBehalfOfCredential in our "token cache" is to pass the token by hand using an InputFilter.
Program.cs
builder.Services.AddBinding<RestBinding, RestBindingOptions>(options =>
{
options.BaseAddress = new Uri(configuration.GetValue<string>("FhirServerUrl"));
options. PassThroughAuthorizationHeader = true;
});
CustomAuthInputBinding.cs
var credential = new OnBehalfOfCredential(<TenantId>, <clientId>, <clientSecret>, context.Request.Headers.Authorization.Parameter);
var scopes = string[]{ $"{<fhirAddress>.TrimEnd('/')}/.default" }
var accessToken = await _tokenCredential.GetTokenAsync(TokenRequestContext(scopes), <cancellationToken>));
context.Headers.Add(new HeaderNameValuePair("Authorization", accessToken.Token, CustomHeaderType.RequestStatic));