Skip to content

Commit 1277f6f

Browse files
Merge pull request #113357 from hansenms/personal/hansenms/azure-rbac2
Bringing Azure RBAC changes back
2 parents 210195d + 942b6d0 commit 1277f6f

18 files changed

+171
-72
lines changed

.openpublishing.redirection.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51475,16 +51475,6 @@
5147551475
"redirect_url": "/azure/sql-database/sql-database-security-best-practice",
5147651476
"redirect_document_id": false
5147751477
},
51478-
{
51479-
"source_path": "articles/healthcare-apis/configure-azure-rbac.md",
51480-
"redirect_url": "/azure/healthcare-apis/azure-api-for-fhir-additional-settings",
51481-
"redirect_document_id": false
51482-
},
51483-
{
51484-
"source_path": "articles/healthcare-apis/configure-local-rbac.md",
51485-
"redirect_url": "/azure/healthcare-apis/azure-api-for-fhir-additional-settings",
51486-
"redirect_document_id": false
51487-
},
5148851478
{
5148951479
"source_path": "articles/media-services/previous/media-services-configure-tricaster-live-encoder.md",
5149051480
"redirect_url": "/azure/media-services",

articles/healthcare-apis/TOC.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
- name: Tutorials
2323
expanded: false
2424
items:
25-
- name: Deploy javascript application
25+
- name: Deploy JavaScript application
2626
expanded: false
2727
items:
2828
- name: 1. Initial setup and FHIR deployment
@@ -57,7 +57,11 @@
5757
expanded: false
5858
items:
5959
- name: Configure additional Azure API for FHIR settings
60-
href: azure-api-for-fhir-additional-settings.md
60+
href: azure-api-for-fhir-additional-settings.md
61+
- name: Configure Azure RBAC
62+
href: configure-azure-rbac.md
63+
- name: Configure Local RBAC
64+
href: configure-local-rbac.md
6165
- name: Configure database settings
6266
href: configure-database.md
6367
- name: Configure CORS

articles/healthcare-apis/access-fhir-postman-tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.date: 02/07/2019
1313

1414
# Access Azure API for FHIR with Postman
1515

16-
A client application would access an FHIR API through a [REST API](https://www.hl7.org/fhir/http.html). You may also want to interact directly with the FHIR server as you build applications, for example, for debugging purposes. In this tutorial, we will walk through the steps needed to use [Postman](https://www.getpostman.com/) to access an FHIR server. Postman is a tool often used for debugging when building applications that access APIs.
16+
A client application would access an FHIR API through a [REST API](https://www.hl7.org/fhir/http.html). You may also want to interact directly with the FHIR server as you build applications, for example, for debugging purposes. In this tutorial, we will walk through the steps needed to use [Postman](https://www.getpostman.com/) to access a FHIR server. Postman is a tool often used for debugging when building applications that access APIs.
1717

1818
## Prerequisites
1919

@@ -103,9 +103,9 @@ If you inspect the access token with a tool like [https://jwt.ms](https://jwt.ms
103103
}
104104
```
105105

106-
In troubleshooting situations, validating that you have the correct audience (`aud` claim) is a good place to start. The managed Azure API for FHIR uses [identity object IDs](find-identity-object-ids.md) to restrict access to the service. Make sure that `oid` claim of the token contains an object ID from the list of allowed object IDs.
106+
In troubleshooting situations, validating that you have the correct audience (`aud` claim) is a good place to start. If your token is from the correct issuer (`iss` claim) and has the correct audience (`aud` claim), but you are still unable to access the FHIR API, it is likely that the user or service principal (`oid` claim) does not have access to the FHIR data plane. We recommend you [use Azure Role Based Access Control](configure-azure-rbac.md) to assign data plane roles to users. If you are using an external, secondary Azure Active directory tenant for your data plane, you will need to [configure local RBAC assignments](configure-local-rbac.md).
107107

108-
It is also possible to [get a token for the Azure API for FHIR using the Azure CLI](get-healthcare-apis-access-token-cli.md).
108+
It is also possible to [get a token for the Azure API for FHIR using the Azure CLI](get-healthcare-apis-access-token-cli.md). If you are using a token obtained with the Azure CLI, you should use Authorization type "Bearer Token" and paste the token in directly.
109109

110110
## Inserting a patient
111111

articles/healthcare-apis/azure-ad-hcapi-token-validation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ Once the server has verified the authenticity of the token, the FHIR server will
9999
When using the Azure API for FHIR, the server will validate:
100100

101101
1. The token has the right `Audience` (`aud` claim).
102-
1. The `oid` claim contains an identity object ID, which is in the list of allowed object IDs.
102+
1. The user or principal that the token was issued for is allowed to access the FHIR server data plane. The `oid` claim of the token contains an identity object ID, which uniquely identifies the user or principal.
103103

104-
See details on [finding identity object IDs](find-identity-object-ids.md).
104+
We recommend that the FHIR service be [configured to use Azure RBAC](configure-azure-rbac.md) to manage data plane role assignments. But you can also [configure local RBAC](configure-local-rbac.md) if your FHIR service uses an external or secondary Azure Active Directory tenant.
105105

106106
When using the OSS Microsoft FHIR server for Azure, the server will validate:
107107

articles/healthcare-apis/azure-api-for-fhir-additional-settings.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ Throughput must be provisioned to ensure that sufficient system resources are av
2222

2323
For more information on how to change the default settings, see [configure database settings](configure-database.md).
2424

25-
## Find identity object IDs
26-
The fully managed Azure API for FHIR service is configured to allow access for only a pre-defined list of identity object IDs. When an application or user is trying to access the FHIR API, a bearer token must be presented. This bearer token will have certain claims (fields). In order to grant access to the FHIR API, the token must contain the right issuer (`iss`), audience (`aud`), and an object ID (`oid`) from a list of allowed object IDs. An identity object ID is either the object ID of a user or a service principal in Azure Active Directory.
25+
## Access control
2726

28-
When you create a new Azure API for FHIR instance, you can configure a list of allowed object IDs. To configure this list, see our how-to-guide to [find identity object IDs](find-identity-object-ids.md).
27+
The Azure API for FHIR will only allow authorized users to access the FHIR API. You can configure authorized users through two different mechanisms. The primary and recommended way to configure access control is using [Azure Role Based Access Control (RBAC)](https://docs.microsoft.com/azure/role-based-access-control/), which is accessible through the **Access control (IAM)** blade. Azure RBAC only works if you want to secure data plane access using the Azure Active Directory tenant associated with your subscription. If you wish to use a different tenant, the Azure API for FHIR offers a local FHIR data plane access control mechanism. The configuration options are not as rich when using the local RBAC mechanism. For details, choose one of the following options:
28+
29+
* [Azure RBAC for FHIR data plane](configure-azure-rbac.md). This is the preferred option when you are using the Azure Active Directory tenant associated with your subscription.
30+
* [Local FHIR data plane access control](configure-local-rbac.md). Use this option only when you need to use an external Azure Active Directory tenant for data plane access control.
2931

3032
## Enable diagnostic logging
3133
You may want to enable diagnostic logging as part of your setup to be able to monitor your service and have accurate reporting for compliance purposes. For details on how to set up diagnostic logging, see our [how-to-guide](enable-diagnostic-logging.md) on how to set up diagnostic logging, along with some sample queries.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Configure Azure Role Based Access Control (RBAC) for Azure API for FHIR
3+
description: This article describes how to configure Azure RBAC for the Azure API for FHIR data plane
4+
author: hansenms
5+
ms.service: healthcare-apis
6+
ms.subservice: fhir
7+
ms.topic: reference
8+
ms.date: 03/15/2020
9+
ms.author: mihansen
10+
---
11+
# Configure Azure RBAC for FHIR
12+
13+
In this article, you will learn how to use [Azure Role Based Access Control (RBAC)](https://docs.microsoft.com/azure/role-based-access-control/) to assign access to the Azure API for FHIR data plane. Azure RBAC is the preferred methods for assigning data plane access when data plane users are managed in the Azure Active Directory tenant associated with your Azure subscription. If you are using an external Azure Active Directory tenant, refer to the [local RBAC assignment reference](configure-local-rbac.md).
14+
15+
## Confirm Azure RBAC mode
16+
17+
To use Azure RBAC, your Azure API for FHIR must be configured to use your Azure subscription tenant for data plane and there should be no assigned identity object IDs. You can verify your settings by inspecting the **Authentication** blade of your Azure API for FHIR:
18+
19+
:::image type="content" source="media/rbac/confirm-azure-rbac-mode.png" alt-text="Confirm Azure RBAC mode":::
20+
21+
The **Authority** should be set to the Azure Active directory tenant associated with your subscription and there should be no GUIDs in the box labeled **Allowed object IDs**. You will also notice that the box is disabled and a label indicates that Azure RBAC should be used to assign data plane roles.
22+
23+
## Assign roles
24+
25+
To grant users, service principals or groups access to the FHIR data plane, click **Access control (IAM)**, then click **Role assignments** and click **+ Add**:
26+
27+
:::image type="content" source="media/rbac/add-azure-rbac-role-assignment.png" alt-text="Add Azure RBAC role assignment":::
28+
29+
In the **Role** selection, search for one of the built-in roles for the FHIR data plane:
30+
31+
:::image type="content" source="media/rbac/built-in-fhir-data-roles.png" alt-text="Built-in FHIR data roles":::
32+
33+
You can choose between:
34+
35+
* FHIR Data Reader: Can read (and search) FHIR data.
36+
* FHIR Data Writer: Can read, write, and soft delete FHIR data.
37+
* FHIR Data Exporter: Can read and export (`$export` operator) data.
38+
* FHIR Data Contributor: Can perform all data plane operations.
39+
40+
If these roles are not sufficient for your need, you can also [create custom roles](https://docs.microsoft.com/azure/role-based-access-control/tutorial-custom-role-powershell).
41+
42+
In the **Select** box, search for a user, service principal, or group that you wish to assign the role to.
43+
44+
## Caching behavior
45+
46+
The Azure API for FHIR will cache decisions for up to 5 minutes. If you grant a user access to the FHIR server by adding them to the list of allowed object IDs, or you remove them from the list, you should expect it to take up to five minutes for changes in permissions to propagate.
47+
48+
## Next steps
49+
50+
In this article, you learned how to assign Azure RBAC roles for the FHIR data plane. Next learn about additional settings for the Azure API for FHIR:
51+
52+
>[!div class="nextstepaction"]
53+
>[Additional settings Azure API for FHIR](azure-api-for-fhir-additional-settings.md)
54+
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Configure local Role Based Access Control (RBAC) for Azure API for FHIR
3+
description: This article describes how to configure the Azure API for FHIR to use an external Azure AD tenant for data plane
4+
author: hansenms
5+
ms.service: healthcare-apis
6+
ms.subservice: fhir
7+
ms.topic: reference
8+
ms.date: 03/15/2020
9+
ms.author: mihansen
10+
---
11+
# Configure local RBAC for FHIR
12+
13+
This article explains how to configure the Azure API for FHIR to use an external, secondary Azure Active Directory tenant for managing data plane access. Use this mode only if it is not possible for you to use the Azure Active Directory tenant associated with your subscription.
14+
15+
> [!NOTE]
16+
> If your FHIR service data plane is configured to use your primary Azure Active Directory tenant associated with your subscription, [use Azure RBAC to assign data plane roles](configure-azure-rbac.md).
17+
18+
## Add service principal
19+
20+
Local RBAC allows you to use an external Azure Active Directory tenant with your FHIR server. In order to allow the RBAC system to check group memberships in this tenant, the Azure API for FHIR must have a service principal in the tenant. This service principal will get created automatically in tenants tied to subscriptions that have deployed the Azure API for FHIR, but in case your tenant has no subscription tied to it, a tenant administrator will need to create this service principal with one of the following commands:
21+
22+
Using the `Az` PowerShell module:
23+
24+
```azurepowershell-interactive
25+
New-AzADServicePrincipal -ApplicationId 3274406e-4e0a-4852-ba4f-d7226630abb7
26+
```
27+
28+
or you can use the `AzureAd` PowerShell module:
29+
30+
```azurepowershell-interactive
31+
New-AzureADServicePrincipal -AppId 3274406e-4e0a-4852-ba4f-d7226630abb7
32+
```
33+
34+
or you can use Azure CLI:
35+
36+
```azurecli-interactive
37+
az ad sp create --id 3274406e-4e0a-4852-ba4f-d7226630abb7
38+
```
39+
40+
## Configure local RBAC
41+
42+
You can configure the Azure API for FHIR to use an external or secondary Azure Active Directory tenant in the **Authentication** blade:
43+
44+
![Local RBAC Assignments](media/rbac/local-rbac-guids.png).
45+
46+
In the authority box, enter a valid Azure Active Directory tenant. Once the tenant has been validated, the **Allowed object IDs** box should be activated and you can enter a list of identity object IDs. These IDs can be the identity object IDs of:
47+
48+
* An Azure Active Directory user.
49+
* An Azure Active Directory service principal.
50+
* An Azure Active directory security group.
51+
52+
You can read the article on how to [find identity object IDs](find-identity-object-ids.md) for more details.
53+
54+
After entering the required object IDs, click **Save** and wait for changes to be saved before trying to access the data plane using the assigned users, service principals, or groups.
55+
56+
## Caching behavior
57+
58+
The Azure API for FHIR will cache decisions for up to 5 minutes. If you grant a user access to the FHIR server by adding them to the list of allowed object IDs, or you remove them from the list, you should expect it to take up to five minutes for changes in permissions to propagate.
59+
60+
## Next steps
61+
62+
In this article, you learned how to assign FHIR data plane access using an external (secondary) Azure Active Directory tenant. Next learn about additional settings for the Azure API for FHIR:
63+
64+
>[!div class="nextstepaction"]
65+
>[Additional settings Azure API for FHIR](azure-api-for-fhir-additional-settings.md)
66+

articles/healthcare-apis/fhir-oss-cli-quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ az group deployment create -g $servicename --template-uri https://raw.githubuser
3939

4040
Obtain a capability statement from the FHIR server with:
4141

42-
```console
42+
```azurecli-interactive
4343
metadataurl="https://${servicename}.azurewebsites.net/metadata"
4444
curl --url $metadataurl
4545
```

articles/healthcare-apis/fhir-paas-cli-quickstart.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ Get a list of commands for HealthcareAPIs:
3030
az healthcareapis --help
3131
```
3232

33-
## Locate your identity object ID
34-
35-
Object ID values are guids that correspond to the object IDs of specific Azure Active Directory users or service principals in the directory associated with the subscription. If you would like to know the object ID of a specific user, you can find it with a command like:
36-
37-
```azurecli-interactive
38-
az ad user show --id [email protected] | jq -r .objectId
39-
```
40-
Read the how-to guide on [finding identity object IDs](find-identity-object-ids.md) for more details.
41-
4233
## Create Azure Resource Group
4334

4435
Pick a name for the resource group that will contain the Azure API for FHIR and create it:
@@ -50,16 +41,14 @@ az group create --name "myResourceGroup" --location westus2
5041
## Deploy the Azure API for FHIR
5142

5243
```azurecli-interactive
53-
az healthcareapis create --resource-group myResourceGroup --name nameoffhiraccount --kind fhir-r4 --location westus2 --access-policies-object-id "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
44+
az healthcareapis create --resource-group myResourceGroup --name nameoffhiraccount --kind fhir-r4 --location westus2
5445
```
5546

56-
where `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` is the identity object ID for a user or service principal that you would like to have access to the FHIR API.
57-
5847
## Fetch FHIR API capability statement
5948

6049
Obtain a capability statement from the FHIR API with:
6150

62-
```console
51+
```azurecli-interactive
6352
curl --url "https://nameoffhiraccount.azurehealthcareapis.com/metadata"
6453
```
6554

articles/healthcare-apis/fhir-paas-portal-quickstart.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: hansenms
66
ms.service: healthcare-apis
77
ms.subservice: fhir
88
ms.topic: quickstart
9-
ms.date: 02/07/2019
9+
ms.date: 03/15/2020
1010
ms.author: mihansen
1111
---
1212

@@ -26,34 +26,31 @@ Open the [Azure portal](https://portal.azure.com) and click **Create a resource*
2626

2727
You can find Azure API for FHIR by typing "FHIR" into the search box:
2828

29-
![Search for Healthcare APIs](media/quickstart-paas-portal/portal-search-healthcare-apis.png)
29+
:::image type="content" source="media/quickstart-paas-portal/portal-search-healthcare-apis.png" alt-text="Search for Healthcare APIs":::
3030

3131
## Create Azure API for FHIR account
3232

3333
Select **Create** to create a new Azure API for FHIR account:
3434

35-
![Create Azure API for FHIR account](media/quickstart-paas-portal/portal-create-healthcare-apis.png)
35+
:::image type="content" source="media/quickstart-paas-portal/portal-create-healthcare-apis.png" alt-text="Create Azure API for FHIR account":::
3636

3737
## Enter account details
3838

3939
Select an existing resource group or create a new one, choose a name for the account, and finally click **Review + create**:
4040

41-
![New healthcare api details](media/quickstart-paas-portal/portal-new-healthcareapi-details.png)
41+
:::image type="content" source="media/quickstart-paas-portal/portal-new-healthcareapi-details.png" alt-text="New healthcare api details":::
4242

4343
Confirm creation and await FHIR API deployment.
4444

45-
## Additional settings
45+
## Additional settings (optional)
4646

47-
Click **Next: Additional settings** to configure the authority, audience, identity object IDs that should be allowed to access this Azure API for FHIR, enable SMART on FHIR if needed, and configure database throughput:
47+
You can also click **Next: Additional settings** to view the authentication settings. The default configuration for the Azure API for FHIR is to [use Azure RBAC for assigning data plane roles](configure-azure-rbac.md). When configured in this mode, the "Authority" for the FHIR service will be set to the Azure Active Directory tenant of the subscription:
4848

49-
- **Authority:** You can specify different Azure AD tenant from the one that you are logged into as authentication authority for the service.
50-
- **Audience:** Best practice, and the default setting, is that the audience is set to the URL of the FHIR server. You can change that here. The audience identifies the recipient that the token is intended for. In this context, it should be set to something representing the FHIR API itself.
51-
- **Allowed object IDs:** You can specify identity object IDs that should be allowed to access this Azure API for FHIR. You can learn more on finding the object ID for users and service principals in the [Find identity object IDs](find-identity-object-ids.md) how-to guide.
52-
- **Smart On FHIR proxy:** You can enable SMART on FHIR proxy. For details on how to configure SMART on FHIR proxy see tutorial [Azure API for FHIR SMART on FHIR proxy](https://docs.microsoft.com/azure/healthcare-apis/use-smart-on-fhir-proxy)
53-
- **Provisioned throughput (RU/s):** Here you can specify throughput settings for the underlying database for your Azure API for FHIR. You can change this setting later in the Database blade. For more details, please see the [configure database settings](configure-database.md) page.
49+
:::image type="content" source="media/rbac/confirm-azure-rbac-mode-create.png" alt-text="Default Authentication settings":::
5450

51+
Notice that the box for entering allowed object IDs is grayed out, since we use Azure RBAC for configuring role assignments in this case.
5552

56-
![Configure allowed object IDs](media/quickstart-paas-portal/configure-audience.png)
53+
If you wish to configure the FHIR service to use an external or secondary Azure Active Directory tenant, you can change the Authority and enter object IDs for user and groups that should be allowed access to the server. For more information, see the [local RBAC configuration](configure-local-rbac.md) guide.
5754

5855
## Fetch FHIR API capability statement
5956

0 commit comments

Comments
 (0)