|
1 | 1 | ---
|
2 |
| -title: Find identity object IDs for authentication - Azure API for FHIR |
3 |
| -description: This article explains how to locate the identity object IDs needed to configure authentication for Azure API for FHIR |
| 2 | +title: Find identity object IDs for authentication in Azure API for FHIR |
| 3 | +description: This article explains how to locate the identity object IDs needed to configure authentication for Azure API for FHIR. |
4 | 4 | services: healthcare-apis
|
5 | 5 | author: expekesheth
|
6 | 6 | ms.service: healthcare-apis
|
7 | 7 | ms.subservice: fhir
|
8 | 8 | ms.custom: has-azure-ad-ps-ref
|
9 | 9 | ms.topic: conceptual
|
10 |
| -ms.date: 9/27/2023 |
| 10 | +ms.date: 3/21/2024 |
11 | 11 | ms.author: kesheth
|
12 | 12 | ---
|
13 | 13 |
|
14 |
| -# Find identity object IDs for authentication configuration for Azure API for FHIR |
| 14 | +# Find identity object IDs for authentication configuration in Azure API for FHIR |
15 | 15 |
|
16 | 16 | [!INCLUDE [retirement banner](../includes/healthcare-apis-azure-api-fhir-retirement.md)]
|
17 | 17 |
|
18 |
| -In this article, you'll learn how to find identity object IDs needed when configuring the Azure API for FHIR to [use an external or secondary Active Directory tenant](configure-local-rbac.md) for data plane. |
| 18 | +In this article, learn how to find the identity object IDs needed to configure the Azure API for FHIR service to [use an external or secondary Active Directory tenant](configure-local-rbac.md) for data plane. |
19 | 19 |
|
20 | 20 | ## Find user object ID
|
21 | 21 |
|
22 |
| -If you have a user with user name `[email protected]`, you can locate the users `ObjectId` using the following PowerShell command : |
| 22 | +If you have a user with user name `[email protected]`, you can locate the user's `ObjectId` by using a Microsoft Graph PowerShell command or the Azure Command-Line Interface (CLI). |
23 | 23 |
|
24 |
| -```azurepowershell-interactive |
25 |
| -$(Get-AzureADUser -Filter "UserPrincipalName eq '[email protected]'").ObjectId |
| 24 | +#### [PowerShell](#tab/powershell) |
| 25 | + |
| 26 | +```powershell |
| 27 | +$(Get-MgUser -Filter "UserPrincipalName eq '[email protected]'").Id |
26 | 28 | ```
|
27 | 29 |
|
28 |
| -or you can use the Azure CLI: |
| 30 | +#### [Azure CLI](#tab/command-line) |
29 | 31 |
|
30 | 32 | ```azurecli-interactive
|
31 | 33 | az ad user show --id [email protected] --query id --out tsv
|
32 | 34 | ```
|
33 | 35 |
|
| 36 | +--- |
| 37 | + |
34 | 38 | ## Find service principal object ID
|
35 | 39 |
|
36 |
| -Suppose you've registered a [service client app](register-service-azure-ad-client-app.md) and you would like to allow this service client to access the Azure API for FHIR, you can find the object ID for the client service principal with the following PowerShell command: |
| 40 | +Suppose you registered a [service client app](register-service-azure-ad-client-app.md) and you want to allow this service client to access the Azure API for FHIR. Find the object ID for the client service principal with a Microsoft Graph PowerShell command or the Azure CLI. |
37 | 41 |
|
38 |
| -```azurepowershell-interactive |
39 |
| -$(Get-AzureADServicePrincipal -Filter "AppId eq 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'").ObjectId |
| 42 | +#### [PowerShell](#tab/powershell) |
| 43 | + |
| 44 | +```powershell |
| 45 | +$(Get-MgServicePrincipal -Filter "AppId eq 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'").Id |
40 | 46 | ```
|
41 | 47 |
|
42 |
| -where `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` is the service client application ID. Alternatively, you can use the `DisplayName` of the service client: |
| 48 | +Where `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX` is the service client application ID. Alternatively, you can use the `DisplayName` of the service client: |
43 | 49 |
|
44 |
| -```azurepowershell-interactive |
45 |
| -$(Get-AzureADServicePrincipal -Filter "DisplayName eq 'testapp'").ObjectId |
| 50 | +```powershell |
| 51 | +$(Get-MgServicePrincipal -Filter "DisplayName eq 'testapp'").Id |
46 | 52 | ```
|
47 | 53 |
|
48 |
| -If you're using the Azure CLI, you can use: |
| 54 | +#### [Azure CLI](#tab/command-line) |
49 | 55 |
|
50 | 56 | ```azurecli-interactive
|
51 | 57 | az ad sp show --id XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX --query id --out tsv
|
52 | 58 | ```
|
53 | 59 |
|
| 60 | +--- |
| 61 | + |
54 | 62 | ## Find a security group object ID
|
55 | 63 |
|
56 |
| -If you would like to locate the object ID of a security group, you can use the following PowerShell command: |
| 64 | +If you would like to locate the object ID of a security group, you can use a Microsoft Graph PowerShell command or the Azure CLI. |
| 65 | + |
| 66 | +#### [PowerShell](#tab/powershell) |
57 | 67 |
|
58 |
| -```azurepowershell-interactive |
59 |
| -$(Get-AzureADGroup -Filter "DisplayName eq 'mygroup'").ObjectId |
| 68 | +```powershell |
| 69 | +$(Get-MgGroup -Filter "DisplayName eq 'mygroup'").Id |
60 | 70 | ```
|
| 71 | + |
61 | 72 | Where `mygroup` is the name of the group you're interested in.
|
62 | 73 |
|
63 |
| -If you're using the Azure CLI, you can use: |
| 74 | +#### [Azure CLI](#tab/command-line) |
64 | 75 |
|
65 | 76 | ```azurecli-interactive
|
66 | 77 | az ad group show --group "mygroup" --query id --out tsv
|
67 | 78 | ```
|
68 | 79 |
|
| 80 | +--- |
| 81 | + |
69 | 82 | ## Next steps
|
70 | 83 |
|
71 |
| -In this article, you've learned how to find identity object IDs needed to configure the Azure API for FHIR to use an external or secondary Microsoft Entra tenant. Next read about how to use the object IDs to configure local RBAC settings: |
72 |
| - |
73 |
| ->[!div class="nextstepaction"] |
74 |
| ->[Configure local RBAC settings](configure-local-rbac.md) |
| 84 | +[Configure local RBAC settings](configure-local-rbac.md) |
75 | 85 |
|
76 |
| -FHIR® is a registered trademark of [HL7](https://hl7.org/fhir/) and is used with the permission of HL7. |
| 86 | +[!INCLUDE [FHIR trademark statement](../includes/healthcare-apis-fhir-trademark.md)] |
0 commit comments