Optionally, you can run the scripts in Visual Studio Code with the REST Client extension. For more information, see Make a link to the REST Client doc.
Before accessing the Azure Health Data Services, you must grant the user or client app with proper permissions. For more information on how to grant permissions, see Azure Health Data Services authorization.
There are several different ways to obtain an Azure access token for the Azure Health Data Services.
Note
Make sure that you have logged into Azure and that you are in the Azure subscription and tenant where you have deployed the Azure Health Data Services instance.
### check Azure environment and PowerShell versionsGet-AzContextSet-AzContext -Subscription <subscriptionid>
$PSVersionTable.PSVersion
Get-InstalledModule -Name Az -AllVersions
curl --version### get access token for the FHIR service$fhirservice="https://<fhirservice>.fhir.azurehealthcareapis.com"$token=(Get-AzAccessToken -ResourceUrl$fhirservice).Token
Azure CLI
### check Azure environment and CLI versionsaz account show --output table
az account set --subscription<subscriptionid>
cli –version
curl --version### get access token for the FHIR service$fhirservice=https://<fhirservice>.fhir.azurehealthcareapis.com
token=$(az account get-access-token--resource=$fhirservice--query accessToken --output tsv)
### get access token for the DICOM servicedicomtokenurl= https://dicom.healthcareapis.azure.com/
token=$(az account get-access-token--resource=$dicomtokenurl--query accessToken --output tsv)
Note
When the FHIR® service audience parameter is not mapped to the FHIR service endpoint url, the resource parameter value should be mapped to Audience value under the FHIR Service Authentication blade.