Skip to content

Latest commit

 

History

History
81 lines (55 loc) · 4.48 KB

QuickstartDeployPowershell.md

File metadata and controls

81 lines (55 loc) · 4.48 KB

Quickstart: Deploy Open Source FHIR server using PowerShell

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.

Use Azure Cloud Shell

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:

  1. Select Try It in the upper-right corner of a code block. Selecting Try It doesn't automatically copy the code to Cloud Shell.
  2. Go to https://shell.azure.com, or select the Launch Cloud Shell button to open Cloud Shell in your browser.
  3. 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:

  1. Start Cloud Shell.
  2. Select the Copy button on a code block to copy the code.
  3. 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.
  4. Select Enter to run the code.

Create a resource group

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

Deploy the FHIR server template

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)

Verify FHIR server is running

$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.

Clean up resources

If you're not going to continue to use this application, delete the resource group with the following steps:

Remove-AzResourceGroup -Name $rg.ResourceGroupName

Next steps

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.