Skip to content

Latest commit

 

History

History
254 lines (166 loc) · 12.5 KB

azure-api-fhir-resource-manager-template.md

File metadata and controls

254 lines (166 loc) · 12.5 KB
title description author ms.service ms.subservice ms.topic ms.custom ms.author ms.date
Quickstart: Deploy Azure API for FHIR using an ARM template
In this quickstart, learn how to deploy Azure API for Fast Healthcare Interoperability Resources (FHIR®), by using an Azure Resource Manager template (ARM template).
expekesheth
azure-health-data-services
fhir
quickstart
subject-armqs, devx-track-azurepowershell, mode-api, devx-track-arm-template
kesheth
09/27/2023

Quickstart: Use an ARM template to deploy Azure API for FHIR

[!INCLUDEretirement banner]

In this quickstart, you learn how to use an Azure Resource Manager template (ARM template) to deploy Azure API for Fast Healthcare Interoperability Resources (FHIR®). You can deploy Azure API for FHIR through the Azure portal, PowerShell, or CLI.

[!INCLUDEAbout Azure Resource Manager]

If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to Azure button. The template opens in the Azure portal once you sign in.

:::image type="content" source="~/reusable-content/ce-skilling/azure/media/template-deployments/deploy-to-azure-button.svg" alt-text="Button to deploy the Resource Manager template to Azure." border="false" link="https://portal.azure.com/#create/Microsoft.Template/uri/https%3a%2f%2fraw.githubusercontent.com%2fAzure%2fazure-quickstart-templates%2fmaster%2fquickstarts%2fmicrosoft.healthcareapis%2fazure-api-for-fhir%2fazuredeploy.json":::

Prerequisites

An Azure account with an active subscription. Create one for free.


Review the template

The template used in this quickstart is from Azure Quickstart Templates.

:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.healthcareapis/azure-api-for-fhir/azuredeploy.json":::

The template defines one Azure resource.

  • Microsoft.HealthcareApis/services

Deploy the template

Select the following link to deploy the Azure API for FHIR using the ARM template in the Azure portal:

:::image type="content" source="~/reusable-content/ce-skilling/azure/media/template-deployments/deploy-to-azure-button.svg" alt-text="Button to deploy the Resource Manager template to Azure." border="false" link="https://portal.azure.com/#create/Microsoft.Template/uri/https%3a%2f%2fraw.githubusercontent.com%2fAzure%2fazure-quickstart-templates%2fmaster%2fquickstarts%2fmicrosoft.healthcareapis%2fazure-api-for-fhir%2fazuredeploy.json":::

On the Deploy Azure API for FHIR page:

  1. If you want, change the Subscription from the default to a different subscription.

  2. For Resource group, select Create new, enter a name for the new resource group, and select OK.

  3. If you created a new resource group, select a Region for the resource group.

  4. Enter a new Service Name and choose the Location of the Azure API for FHIR. The location can be the same as or different from the region of the resource group.

    Deploy Azure API for FHIR using the ARM template in the Azure portal.

  5. Select Review + create.

  6. Read the terms and conditions, and then select Create.

Note

If you want to run the PowerShell scripts locally, first enter Connect-AzAccount to set up your Azure credentials.

If the Microsoft.HealthcareApis resource provider isn't already registered for your subscription, you can register it with the following interactive code. To run the code in Azure Cloud Shell, select Try it at the upper corner of any code block.

Register-AzResourceProvider -ProviderNamespace Microsoft.HealthcareApis

Use the following code to deploy the Azure API for FHIR service using the ARM template. The code prompts you for the new FHIR service name, the name of a new resource group, and the locations for each of them.

$serviceName = Read-Host -Prompt "Enter a name for the new Azure API for FHIR service"
$serviceLocation = Read-Host -Prompt "Enter an Azure region (for example, westus2) for the service"
$resourceGroupName = Read-Host -Prompt "Enter a name for the new resource group to contain the service"
$resourceGroupRegion = Read-Host -Prompt "Enter an Azure region (for example, centralus) for the resource group"

Write-Verbose "New-AzResourceGroup -Name $resourceGroupName -Location $resourceGroupRegion" -Verbose
New-AzResourceGroup -Name $resourceGroupName -Location $resourceGroupRegion
Write-Verbose "Run New-AzResourceGroupDeployment to create an Azure API for FHIR service using an ARM template" -Verbose
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName `
    -TemplateUri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.healthcareapis/azure-api-for-fhir/azuredeploy.json `
    -serviceName $serviceName `
    -location $serviceLocation
Read-Host "Press [ENTER] to continue"

If the Microsoft.HealthcareApis resource provider isn't already registered for your subscription, you can register it with the following interactive code. To run the code in Azure Cloud Shell, select Try it at the upper corner of any code block.

az extension add --name healthcareapis

Use the following code to deploy the Azure API for FHIR service using the ARM template. The code prompts you for the new FHIR service name, the name of a new resource group, and the locations for each of them.

read -p "Enter a name for the new Azure API for FHIR service: " serviceName &&
read -p "Enter an Azure region (for example, westus2) for the service: " serviceLocation &&
read -p "Enter a name for the new resource group to contain the service: " resourceGroupName &&
read -p "Enter an Azure region (for example, centralus) for the resource group: " resourceGroupRegion &&
params='serviceName='$serviceName' location='$serviceLocation &&
echo "CREATE RESOURCE GROUP:  az group create --name $resourceGroupName --location $resourceGroupRegion" &&
az group create --name $resourceGroupName --location $resourceGroupRegion &&
echo "RUN az deployment group create, which creates an Azure API for FHIR service using an ARM template" &&
az deployment group create --resource-group $resourceGroupName --parameters $params --template-uri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.healthcareapis/azure-api-for-fhir/azuredeploy.json &&
read -p "Press [ENTER] to continue: "

Note

The deployment takes a few minutes to complete. Note the names for the Azure API for FHIR service and the resource group, for use in reviewing deployed resources.

Review deployed resources

Follow these steps to see an overview of your new Azure API for FHIR service:

  1. In the Azure portal, search for and select Azure API for FHIR.

  2. In the FHIR list, select your new service. The Overview page for the new Azure API for FHIR service appears.

  3. To validate that the new FHIR API account is provisioned, select the link next to FHIR metadata endpoint to fetch the FHIR API capability statement. The link has a format of https://<service-name>.azurehealthcareapis.com/metadata. If the account is provisioned, a JSON file is displayed.

Run the following interactive code to view details about your Azure API for FHIR service. You have to enter the name and resource group of the new service.

$serviceName = Read-Host -Prompt "Enter the name of your Azure API for FHIR service"
$resourceGroupName = Read-Host -Prompt "Enter the resource group name"
Write-Verbose "Get-AzHealthcareApisService -ResourceGroupName $resourceGroupName -Name $serviceName" -Verbose
Get-AzHealthcareApisService -ResourceGroupName $resourceGroupName -Name $serviceName
Read-Host "Press [ENTER] to fetch the FHIR API capability statement, which shows that the new service has been provisioned"

$requestUri="https://" + $serviceName + ".azurehealthcareapis.com/metadata"
$metadata = Invoke-WebRequest -Uri $requestUri
$metadata.RawContent
Read-Host "Press [ENTER] to continue"

Run the following interactive code to view details about your Azure API for FHIR service. You have to enter the name of the new service and the resource group.

read -p "Enter the name of your Azure API for FHIR service: " serviceName &&
read -p "Enter the resource group name: " resourceGroupName &&
echo "SHOW SERVICE DETAILS:  az healthcareapis service show --resource-group $resourceGroupName --resource-name $serviceName" &&
az healthcareapis service show --resource-group $resourceGroupName --resource-name $serviceName &&
read -p "Press [ENTER] to fetch the FHIR API capability statement, which shows that the new service has been provisioned: " &&
requestUrl='https://'$serviceName'.azurehealthcareapis.com/metadata' &&
curl --url $requestUrl &&
read -p "Press [ENTER] to continue: "

Clean up resources

When no longer needed, delete the resource group. This deletes the resources in the resource group.

  1. In the Azure portal, search for and select Resource groups.

  2. In the resource group list, choose the name of your resource group.

  3. In the Overview page of your resource group, select Delete resource group.

  4. In the confirmation dialog box, type the name of your resource group, and then select Delete.

$resourceGroupName = Read-Host -Prompt "Enter the name of the resource group to delete"
Write-Verbose "Remove-AzResourceGroup -Name $resourceGroupName" -Verbose
Remove-AzResourceGroup -Name $resourceGroupName
Read-Host "Press [ENTER] to continue"
read -p "Enter the name of the resource group to delete: " resourceGroupName &&
echo "DELETE A RESOURCE GROUP (AND ITS RESOURCES):  az group delete --name $resourceGroupName" &&
az group delete --name $resourceGroupName &&
read -p "Press [ENTER] to continue: "

For a step-by-step tutorial that guides you through the process of creating an ARM template, see the tutorial to create and deploy your first ARM template

Next steps

In this quickstart guide, you've deployed the Azure API for FHIR into your subscription. For information about how to register applications and the Azure API for FHIR configuration settings, see the following.

[!div class="nextstepaction"] Register Applications Overview

[!div class="nextstepaction"] Configure Azure RBAC

[!div class="nextstepaction"] Configure local RBAC

[!div class="nextstepaction"] Configure database settings

[!div class="nextstepaction"] Configure customer-managed keys

[!div class="nextstepaction"] Configure CORS

[!div class="nextstepaction"] Configure Private Link

[!INCLUDE FHIR trademark statement]