In this quickstart, learn how to deploy the Open Source Microsoft FHIR server for Azure Using PowerShell.
If you don't have an Azure subscription, create a free account before you begin.
NOTE: This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. For Az module installation instructions, see Install Azure PowerShell.
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.
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
)
$fhirServiceName = "abMay1FhirService"
$rg = New-AzResourceGroup -Name $fhirServiceName -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:
New-AzResourceGroupDeployment -TemplateUri https://raw.githubusercontent.com/Microsoft/fhir-server/main/samples/templates/default-azuredeploy-docker.json -ResourceGroupName $rg.ResourceGroupName -serviceName $fhirServiceName
Alternatively, to deploy using SQL Server as the data store:
$sqlAdminPassword = ConvertTo-SecureString "mySecretPassword123" -AsPlainText -Force
New-AzResourceGroupDeployment -TemplateUri https://raw.githubusercontent.com/Microsoft/fhir-server/main/samples/templates/default-azuredeploy-docker.json -ResourceGroupName $rg.ResourceGroupName -serviceName $fhirServiceName -solutionType FhirServerSqlServer -sqlSchemaAutomaticUpdatesEnabled auto -sqlAdminPassword $sqlAdminPassword
(Note: ensure that your SQL admin password meets the minimum policy requirements to avoid deployment errors)
$metadataUrl = "https://" + $fhirServiceName + ".azurewebsites.net/metadata"
$metadata = Invoke-WebRequest -Uri $metadataUrl
$metadata.RawContent
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:
Remove-AzResourceGroup -Name $rg.ResourceGroupName
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.