Skip to content

Commit 2afe30c

Browse files
Merge pull request #313141 from cebundy-work/access-tokens-update
update get access token how-to
2 parents 3e4646e + 8aef4a9 commit 2afe30c

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

articles/healthcare-apis/get-access-token.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
---
22
title: Get an access token to use the FHIR service or the DICOM service
3-
description: Learn how to get an access token for the FHIR service or the DICOM service.
3+
description: Learn how to get an access token to access the FHIR service or the DICOM service using Azure CLI or Powershell.
44
services: healthcare-apis
55
author: chachachachami
66
ms.service: azure-health-data-services
77
ms.topic: how-to
8-
ms.date: 06/02/2025
8+
ms.date: 03/31/2026
99
ms.author: chrupa
10+
ms.reviewer: v-catheribun
1011
ms.custom: devx-track-azurepowershell, devx-track-azurecli
1112
ms.devlang: azurecli
1213
---
1314

1415
# Get an access token by using Azure CLI or Azure PowerShell
1516

16-
To use the FHIR® service or the DICOM® service, you need an access token that verifies your identity and permissions to the server. You can obtain an access token using [PowerShell](/powershell/scripting/overview) or the [Azure Command-Line Interface (CLI)](/cli/azure/what-is-azure-cli), which are tools for creating and managing Azure resources.
17+
To use the FHIR® service or the DICOM® service, you need an access token that verifies your identity and permissions to the service. You can get an access token by using [PowerShell](/powershell/scripting/overview) or the [Azure Command-Line Interface (CLI)](/cli/azure/what-is-azure-cli). These tools help you create and manage Azure resources.
1718

18-
Keep in mind that to access the FHIR service or the DICOM service, users and applications must be granted permissions through [role assignments](configure-azure-rbac.md) from Azure portal, or by using [scripts](configure-azure-rbac-using-scripts.md).
19+
Manage the permissions for users and applications to access FHIR or the DICOM services through [role assignments](configure-azure-rbac.md) from the Azure portal or by using [scripts](configure-azure-rbac-using-scripts.md).
1920

20-
---
2121
## Get an access token for the FHIR service
2222

23-
The FHIR service uses a specific `resource` or `Audience` with URI equal to the URI of the FHIR server `https://<workspacename-fhirservicename>.fhir.azurehealthcareapis.com`. Obtain a token and store it in a variable (named `$token`) with the following command:
23+
The FHIR service uses a specific `--resource` or `-resourceUrl` with a URI equal to the URI of the FHIR service audience (`https://<workspacename-fhirservicename>.fhir.azurehealthcareapis.com`) to get a token. The following example gets a token and uses it to get a list of patients. To run the example, you need at least the FHIR Data Reader role assignment. Replace the `<placeholder>` with the service URL for your FHIR service.
2424

2525
### [Azure CLI](#tab/azure-cli)
2626

@@ -38,13 +38,14 @@ Invoke-WebRequest -Method GET -Headers $headers -Uri 'https://<workspacename-fhi
3838
```
3939

4040
---
41+
4142
## Get an access token for the DICOM service
4243

43-
The DICOM service uses the same `resource` or `Audience` with URI equal to `https://dicom.healthcareapis.azure.com` to obtain an access token. Obtain a token and store it in a variable (named `$token`) with the following command:
44+
The following example gets an access token for the DICOM service. The `--resource` or `-resourceUrl` is the DICOM service audience (`https://dicom.healthcareapis.azure.com`). The token is then used to get the service logs. To run the example, you need at least the DICOM Data Reader role assignment. Replace the `<placeholder>` with the service URL for your DICOM service.
4445

4546
### [Azure CLI](#tab/azure-cli)
4647

47-
```Azure CLICopy
48+
```azurecli-interactive
4849
token=$(az account get-access-token --resource=https://dicom.healthcareapis.azure.com --query accessToken --output tsv)
4950
curl -X GET --header "Authorization: Bearer $token" https://<workspacename-dicomservicename>.dicom.azurehealthcareapis.com/v<version of REST API>/changefeed
5051
```
@@ -58,10 +59,10 @@ Invoke-WebRequest -Method GET -Headers $headers -Uri 'https://<workspacename-dic
5859
```
5960

6061
---
61-
## Next steps
6262

63-
[Access the FHIR service by using REST client](./fhir/using-rest-client.md)
63+
## Related content
6464

65-
[Access the DICOM service by using cURL](dicom/dicomweb-standard-apis-curl.md)
65+
- [Access the FHIR service by using REST client](./fhir/using-rest-client.md)
66+
- [Access the DICOM service by using cURL](dicom/dicomweb-standard-apis-curl.md)
6667

6768
[!INCLUDE [FHIR and DICOM trademark statement](./includes/healthcare-apis-fhir-dicom-trademark.md)]

0 commit comments

Comments
 (0)