Deploy a FHIR service within Azure Health Data Services using Bicep
In this article, you'll learn how to deploy FHIR service within the Azure Health Data Services using Bicep.
Bicep is a domain-specific language (DSL) that uses declarative syntax to deploy Azure resources. It provides concise syntax, reliable type safety, and support for code reuse. Bicep offers the best authoring experience for your infrastructure-as-code solutions in Azure.
Prerequisites
- An Azure account with an active subscription. Create one for free.
- If you want to run the code locally:
Review the Bicep file
The Bicep file used in this article is from Azure Quickstart Templates.
@description('The name of the service.')
param serviceName string
@description('Location of Azure API for FHIR')
@allowed([
'australiaeast'
'eastus'
'eastus2'
'japaneast'
'northcentralus'
'northeurope'
'southcentralus'
'southeastasia'
'uksouth'
'ukwest'
'westcentralus'
'westeurope'
'westus2'
])
param location string
resource service 'Microsoft.HealthcareApis/services@2021-11-01' = {
name: serviceName
location: location
kind: 'fhir-R4'
properties: {
authenticationConfiguration: {
audience: 'https://${serviceName}.azurehealthcareapis.com'
authority: uri(environment().authentication.loginEndpoint, subscription().tenantId)
}
}
}
The Bicep file defines three Azure resources:
Microsoft.HealthcareApis/workspaces: create a Microsoft.HealthcareApis/workspaces resource.
Microsoft.HealthcareApis/workspaces/fhirservices: create a Microsoft.HealthcareApis/workspaces/fhirservices resource.
Microsoft.Storage/storageAccounts: create a Microsoft.Storage/storageAccounts resource.
Deploy the Bicep file
Save the Bicep file as main.bicep to your local computer.
Deploy the Bicep file using either Azure CLI or Azure PowerShell.
New-AzResourceGroup -Name exampleRG -Location eastus New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -serviceName "<service-name>" -location "<location>"
Replace <service-name> with the name of the service. Replace <location> with the location of the Azure API for FHIR. Location options include:
- australiaeast
- eastus
- eastus2
- japaneast
- northcentralus
- northeurope
- southcentralus
- southeastasia
- uksouth
- ukwest
- westcentralus
- westeurope
- westus2
Note
When the deployment finishes, you should see a message indicating the deployment succeeded.
Review the deployed resources
Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.
Get-AzResource -ResourceGroupName exampleRG
Note
You can also verify that the FHIR service is up and running by opening a browser and navigating to https://<yourfhirservice>.azurehealthcareapis.com/metadata
. If the
capability statement is automatically displayed or downloaded, your deployment was successful. Make sure to replace <yourfhirservice> with the <service-name> you
used in the deployment step of this quickstart.
Clean up the resources
When no longer needed, use the Azure portal, Azure CLI, or Azure PowerShell to delete the resource group and its resources.
Remove-AzResourceGroup -Name exampleRG
Next steps
In this quickstart guide, you've deployed the FHIR service within Azure Health Data Services using Bicep. For more information about FHIR service supported features, proceed to the following article:
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for