In this quickstart, you'll learn how to deploy an Open Source FHIR server in Azure using the Azure CLI.
If you don't have an Azure subscription, create a free account before you begin.
Azure hosts Azure Cloud Shell, an interactive shell environment that you can use through your browser. You can use either Bash or PowerShell with Cloud Shell to work with Azure services. You can use the Cloud Shell preinstalled commands to run the code in this article without having to install anything on your local environment.
To start Azure Cloud Shell:
- Select Try It in the upper-right corner of a code block. Selecting Try It doesn't automatically copy the code to Cloud Shell.
- Go to https://shell.azure.com, or select the Launch Cloud Shell button to open Cloud Shell in your browser.
- Select the Cloud Shell button on the menu bar at the upper right in the Azure portal. Choose to run in Bash mode.
To run the code in this article in Azure Cloud Shell:
- Start Cloud Shell.
- Select the Copy button on a code block to copy the code.
- Paste the code into the Cloud Shell session by selecting Ctrl+Shift+V on Windows and Linux or by selecting Cmd+Shift+V on macOS.
- Select Enter to run the code.
Pick a name for the resource group that will contain the provisioned resources and create it:
(Note: this name must be globally unique to avoid DNS collision with other App Service deployments. For testing purposes, try prepending a descriptive name like FhirService
with your intials and the date, e.g. abMay1
)
servicename="abMay1FhirService"
az group create --name $servicename --location westus
The Microsoft FHIR Server for Azure GitHub Repository contains a template that will deploy all necessary resources.
Deploy using CosmosDB as the data store with the following command:
az deployment group create -g $servicename --template-uri https://raw.githubusercontent.com/Microsoft/fhir-server/main/samples/templates/default-azuredeploy-docker.json --parameters serviceName=$servicename
Alternatively, to deploy using SQL Server as the data store:
az deployment group create -g $servicename --template-uri https://raw.githubusercontent.com/Microsoft/fhir-server/main/samples/templates/default-azuredeploy-docker.json --parameters serviceName=$servicename solutionType=FhirServerSqlServer sqlSchemaAutomaticUpdatesEnabled=auto sqlAdminPassword=<replace me>
(Note: ensure that your SQL admin password meets the minimum policy requirements to avoid deployment errors)
Obtain a capability statement from the FHIR server with:
metadataurl="https://${servicename}.azurewebsites.net/metadata"
curl --url $metadataurl
It will take a minute or so for the server to respond the first time.
If you're not going to continue to use this application, delete the resource group with the following steps:
az group delete --name $servicename
In this tutorial, you've deployed the Microsoft Open Source FHIR Server for Azure into your subscription. To learn how to access the FHIR API using Postman, you can take a look at the Postman tutorial on the Azure Docs site.