Skip to content

Commit a7cd52f

Browse files
Merge pull request #223970 from HeidiSteen/heidist-rbac
[azure search] Tested AAD steps for apps and local testing
2 parents 803bd43 + 3bda170 commit a7cd52f

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

articles/search/search-howto-aad.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Authorize search app requests using Azure AD
2+
title: Configure search apps for Azure AD
33
titleSuffix: Azure Cognitive Search
4-
description: Acquire a token from Azure AD to authorize search requests to an app built on Azure Cognitive Search.
4+
description: Acquire a token from Azure Active Directory to authorize search requests to an app built on Azure Cognitive Search.
55

66
author: gmndrg
77
ms.author: gimondra
88
ms.service: cognitive-search
99
ms.topic: how-to
10-
ms.date: 1/05/2022
10+
ms.date: 01/13/2023
1111
ms.custom: subject-rbac-steps
1212
---
1313

@@ -89,7 +89,7 @@ It's a best practice to grant minimum permissions. If your application only need
8989

9090
1. Select **+ Add** > **Add role assignment**.
9191

92-
![Access control (IAM) page with Add role assignment menu open.](../../includes/role-based-access-control/media/add-role-assignment-menu-generic.png)
92+
:::image type="content" source="../../includes/role-based-access-control/media/add-role-assignment-menu-generic.png" alt-text="Screenshot of Access control (IAM) page with Add role assignment menu open." border="true":::
9393

9494
1. Select an applicable role:
9595

@@ -143,10 +143,18 @@ The following instructions reference an existing C# sample to demonstrate the co
143143
SearchClient srchclient = new SearchClient(serviceEndpoint, indexName, new DefaultAzureCredential());
144144
```
145145

146-
> [!NOTE]
147-
> User-assigned managed identities work only in Azure environments. If you run this code locally, `DefaultAzureCredential` will fall back to authenticating with your credentials. Make sure you've also given yourself the required access to the search service if you plan to run the code locally.
146+
### Local testing
147+
148+
User-assigned managed identities work only in Azure environments. If you run this code locally, `DefaultAzureCredential` will fall back to authenticating with your credentials. Make sure you've also given yourself the required access to the search service if you plan to run the code locally.
149+
150+
1. Verify your account has role assignments to run all of the operations in the quickstart sample. To both create and query an index, you'll need "Search Index Data Reader" and "Search Index Data Contributor".
148151

149-
The Azure.Identity documentation has more details about `DefaultAzureCredential` and using [Azure AD authentication with the Azure SDK for .NET](/dotnet/api/overview/azure/identity-readme). `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types.
152+
1. Go to **Tools** > **Options** > **Azure Service Authentication** to choose your Azure sign-on account.
153+
154+
You should now be able to run the project from Visual Studio on your local system, using role-based access control for authorization.
155+
156+
> [!NOTE]
157+
> The Azure.Identity documentation has more details about `DefaultAzureCredential` and using [Azure AD authentication with the Azure SDK for .NET](/dotnet/api/overview/azure/identity-readme). `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types.
150158
151159
### [**REST API**](#tab/aad-rest)
152160

articles/search/search-security-rbac.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Use Azure role-based access control
2+
title: Connect using Azure roles
33
titleSuffix: Azure Cognitive Search
44
description: Use Azure role-based access control for granular permissions on service administration and content tasks.
55

@@ -12,7 +12,7 @@ ms.date: 01/12/2023
1212
ms.custom: subject-rbac-steps, references_regions
1313
---
1414

15-
# Use Azure role-based access controls (Azure RBAC) in Azure Cognitive Search
15+
# Connect to Azure Cognitive Search using Azure role-based access control (Azure RBAC)
1616

1717
Azure provides a global [role-based access control authorization system](../role-based-access-control/role-assignments-portal.md) for all services running on the platform. In Cognitive Search, you can:
1818

0 commit comments

Comments
 (0)