Quickstart: Deploy Azure API for FHIR using Azure CLI

In this quickstart, you'll learn how to deploy Azure API for FHIR in Azure using the Azure CLI.

If you don't have an Azure subscription, create a free account before you begin.


  • Use the Bash environment in Azure Cloud Shell.

    Launch Cloud Shell in a new window

  • If you prefer, install the Azure CLI to run CLI reference commands.

    • If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For additional sign-in options, see Sign in with the Azure CLI.

    • When you're prompted, install Azure CLI extensions on first use. For more information about extensions, see Use extensions with the Azure CLI.

    • Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.

Add HealthcareAPIs extension

az extension add --name healthcareapis

Get a list of commands for HealthcareAPIs:

az healthcareapis --help

Create Azure Resource Group

Pick a name for the resource group that will contain the Azure API for FHIR and create it:

az group create --name "myResourceGroup" --location westus2

Deploy the Azure API for FHIR

az healthcareapis create --resource-group myResourceGroup --name nameoffhiraccount --kind fhir-r4 --location westus2 

Fetch FHIR API capability statement

Obtain a capability statement from the FHIR API with:

curl --url "https://nameoffhiraccount.azurehealthcareapis.com/metadata"

Clean up resources

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

az group delete --name "myResourceGroup"

Next steps

In this quickstart guide, you've deployed the Azure API for FHIR into your subscription. To set additional settings in your Azure API for FHIR, proceed to the additional settings how-to guide. If you are ready to start using the Azure API for FHIR, read more on how to register applications.