You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/includes/quickstarts/full-text-csharp.md
+25-7Lines changed: 25 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -623,23 +623,41 @@ In *Program.cs*, you created two clients:
623
623
624
624
Both clients need the search service endpoint and credentials described previously in the [resource information](#retrieve-resource-information) section.
625
625
626
-
Because the code builds out the URI for you, you only specify the search service name in the `serviceName` property.
626
+
The sample code in this quickstart uses Microsoft Entra ID for authentication. If you prefer to use an API key, you can replace the `DefaultAzureCredential` object with a `AzureKeyCredential` object.
627
+
628
+
#### [Microsoft Entra ID](#tab/keyless)
629
+
630
+
```csharp
631
+
Uri serviceEndpoint = new Uri($"https://<Put your search service NAME here>.search.windows.net/");
632
+
DefaultAzureCredential credential = new();
633
+
```
634
+
635
+
#### [API key](#tab/api-key)
636
+
637
+
```csharp
638
+
Uri serviceEndpoint = new Uri($"https://<Put your search service NAME here>.search.windows.net/");
639
+
AzureKeyCredential credential = new AzureKeyCredential("<Your search service admin key>");
0 commit comments